|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
小知识:CentOS并不是第一个提供商业支持的RHEL克隆版,其他企业例如Oracle也提供了基于RedHat的自己的企业Linux发布版。
#反省并卸载
rpm-qa|grephttpd
rpm-ehttpd
rpm-qa|grepmysql
rpm-emysql
rpm-qa|grepphp
rpm-ephp
yum-yremovehttpd
#查找最快的源
yum-yinstallyum-fastestmirror
yum-yupdate
yum-yinstallpatchmakegccgcc-c++gcc-g77flexbisonfile
yum-yinstalllibtoollibtool-libsautoconfkernel-devel
yum-yinstalllibjpeglibjpeg-devellibpnglibpng-devellibpng10libpng10-develgdgd-devel
yum-yinstallfreetypefreetype-devellibxml2libxml2-develzlibzlib-devel
yum-yinstallglib2glib2-develbzip2bzip2-devellibeventlibevent-devel
yum-yinstallncursesncurses-develcurlcurl-devele2fsprogs
yum-yinstalle2fsprogs-develkrb5krb5-devellibidnlibidn-devel
yum-yinstallopensslopenssl-develvim-minimalnanosendmail
yum-yinstallfonts-chinesegettextgettext-devel
yum-yinstallncurses-devel
yum-yinstallgmp-develpspell-devel
yum-yinstallunzip
wget-chttp://soft.vpser.net/web/libmcrypt/libmcrypt-2.5.8.tar.gz
tarzxvflibmcrypt-2.5.8.tar.gz
cdlibmcrypt-2.5.8/
./configure
make&&makeinstall
/sbin/ldconfig
cdlibltdl/
./configure--enable-ltdl-install
make&&makeinstall
cdhttp://www.ckuyun.com/
wget-chttp://soft.vpser.net/web/mhash/mhash-0.9.9.9.tar.gz
tarzxvfmhash-0.9.9.9.tar.gz
cdmhash-0.9.9.9/
./configure
make&&makeinstall
cd../
wget-chttp://soft.vpser.net/web/libiconv/libiconv-1.13.tar.gz
tarzxvflibiconv-1.13.tar.gz
cdlibiconv-1.13/
./configure--prefix=/usr/local
make&&makeinstall
cd../
ln-s/usr/local/lib/libmcrypt.la/usr/lib/libmcrypt.la
ln-s/usr/local/lib/libmcrypt.so/usr/lib/libmcrypt.so
ln-s/usr/local/lib/libmcrypt.so.4/usr/lib/libmcrypt.so.4
ln-s/usr/local/lib/libmcrypt.so.4.4.8/usr/lib/libmcrypt.so.4.4.8
ln-s/usr/local/lib/libmhash.a/usr/lib/libmhash.a
ln-s/usr/local/lib/libmhash.la/usr/lib/libmhash.la
ln-s/usr/local/lib/libmhash.so/usr/lib/libmhash.so
ln-s/usr/local/lib/libmhash.so.2/usr/lib/libmhash.so.2
ln-s/usr/local/lib/libmhash.so.2.0.1/usr/lib/libmhash.so.2.0.1
wget-chttp://soft.vpser.net/web/mcrypt/mcrypt-2.6.8.tar.gz
tarzxvfmcrypt-2.6.8.tar.gz
cdmcrypt-2.6.8/
./configure
make&&makeinstall
cd../
#安装mysql
wget-chttp://soft.vpser.net/datebase/mysql/mysql-5.1.44.tar.gz
wget-chttp://soft.vpser.net/web/pdo/PDO_MYSQL-1.0.2.tgz
tar-zxvfmysql-5.1.44.tar.gz
cdmysql-5.1.44/
./configure--prefix=/usr/local/mysql--with-extra-charsets=all--enable-thread-safe-client--enable-assembler--with-charset=utf8--enable-thread-safe-client--with-extra-charsets=all--with-big-tables--with-readline--with-ssl--with-embedded-server--enable-local-infile
make&&makeinstall
cd../
groupaddmysql
useradd-gmysqlmysql
cp/usr/local/mysql/share/mysql/my-medium.cnf/etc/my.cnf
/usr/local/mysql/bin/mysql_install_db--user=mysql
chown-Rmysql/usr/local/mysql/var
chgrp-Rmysql/usr/local/mysql/.
cp/usr/local/mysql/share/mysql/mysql.server/etc/init.d/mysql
chmod755/etc/init.d/mysql
chkconfig--level345mysqlon
echo"/usr/local/mysql/lib/mysql">>/etc/ld.so.conf
echo"/usr/local/lib">>/etc/ld.so.conf
ldconfig
ln-s/usr/local/mysql/lib/mysql/usr/lib/mysql
ln-s/usr/local/mysql/include/mysql/usr/include/mysql
/etc/init.d/mysqlstart
/usr/local/mysql/bin/mysqladmin-urootpassword$mysqlrootpwd
/etc/init.d/mysqlrestart
/etc/init.d/mysqlstop
chkconfigmysql-ndboff
chkconfigmysql-ndb-mgmoff
#安装apache
wgethttp://soft.vpser.net/web/apache/httpd-2.2.11.tar.gz
tarzxvfhttpd-2.2.11.tar.gz
cdhttpd-2.2.11
./configure--prefix=/usr/local/apache--enable-deflate=shared--enable-headers=shared--enable-info=shared--enable-rewrite=shared--enable-so
make
makeinstall
cd../
#安装php
wgethttp://soft.vpser.net/web/php/php-5.2.10.tar.gz
tarzxvfphp-5.2.10.tar.gz
cdphp-5.2.10/
./configure--prefix=/usr/local/php--with-config-file-path=/usr/local/php/etc--with-apxs2=/usr/local/apache/bin/apxs--with-mysql=/usr/local/mysql--with-mysqli=/usr/local/mysql/bin/mysql_config--with-iconv-dir=/usr/local/libiconv--with-freetype-dir--with-jpeg-dir--with-png-dir--with-zlib--with-libxml-dir=/usr--enable-xml--disable-rpath--enable-discard-path--enable-safe-mode--enable-bcmath--enable-shmop--enable-sysvsem--enable-inline-optimization--with-curl--with-curlwrappers--enable-mbregex--enable-fastcgi--enable-force-cgi-redirect--enable-mbstring--with-mcrypt--with-gd--enable-gd-native-ttf--with-openssl--with-mhash--enable-pcntl--enable-sockets--with-xmlrpc--enable-zip--enable-soap--without-pear
#假如上面两行不必,可实验换此行#--lcrypt--liconv#make&&makeinstall
makeZEND_EXTRA_LIBS=-liconv
makeinstall
mkdir-p/usr/local/php/etc
cpphp.ini-dist/usr/local/php/etc/php.ini
cd../
#phpextensions
sed-is#output_buffering=Off#output_buffering=On#/usr/local/php/etc/php.ini
sed-is/post_max_size=8M/post_max_size=50M/g/usr/local/php/etc/php.ini
sed-is/upload_max_filesize=2M/upload_max_filesize=50M/g/usr/local/php/etc/php.ini
sed-is/;date.timezone=/date.timezone=PRC/g/usr/local/php/etc/php.ini
#安装zend
wgethttp://soft.vpser.net/web/zend/ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz
tarzxvfZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz
mkdir-p/usr/local/zend/
cpZendOptimizer-3.3.9-linux-glibc23-i386/data/5_2_x_comp/ZendOptimizer.so/usr/local/zend/
cat>>/usr/local/php/etc/php.ini<<EOF
[ZendOptimizer]
zend_optimizer.optimization_level=1
zend_extension="/usr/local/zend/ZendOptimizer.so"
EOF
#增加用户和建网站根目次
groupaddwww
useradd-gwwwwww
mkdir-p/home/wwwroot
chmod+w/home/wwwroot
chown-Rwww:www/home/wwwroot
#安装phpmyadmin
cd/home/wwwroot
wgethttp://soft.vpser.net/datebase/phpmyadmin/phpmyadmin.tar.gz
tarzxvfphpmyadmin.tar.gz
cd~
#安装PHP减速缓存插件eAccelerator
wgethttp://soft.vpser.net/web/eaccelerator/eaccelerator-0.9.5.3.tar.bz2
tarjxvfeaccelerator-0.9.5.3.tar.bz2
cdeaccelerator-0.9.5.3/
/usr/local/php/bin/phpize
./configure--enable-eaccelerator=shared--with-php-config=/usr/local/php/bin/php-config
make
makeinstall
cd../
mkdir-p/usr/local/eaccelerator_cache
cat>>/usr/local/php/etc/php.ini<<EOF
[eaccelerator]
zend_extension="/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so"
eaccelerator.shm_size="16"
eaccelerator.cache_dir="/usr/local/eaccelerator_cache"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="3600"
eaccelerator.shm_prune_period="3600"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"
eaccelerator.keys="disk_only"
eaccelerator.sessions="disk_only"
eaccelerator.content="disk_only"
EOF
####################
#启动apache
/usr/local/apache/bin/apachectl-kstart
#重启apache
#/usr/local/apache/bin/apachectl-krestart
#启动ssl
#/usr/local/apache/bin/apachectl-kstartssl
#启动mysql
/etc/init.d/mysqlstart
#开机启动
vi/etc/rc.local
#然后
ulimit-SHn51200
/etc/init.d/mysqlstart
/usr/local/apache/bin/apachectl-kstart
#反省设置
#/usr/local/apache/bin/apachectlconfigtest
#检测Apache运转模块
#/usr/local/apache/bin/httpd-l
小知识:CentOS在服务器提供商、中小型公司中装机量几乎是最大的Linux发行版。 |
|