更新yum源 见CentOS
cd /etc/yum.repos.d mv CentOS-Base.repo CentOS-Base.repo.save wget http://centos.ustc.edu.cn/CentOS-Base.repo.5 mv CentOS-Base.repo.5 CentOS-Base.repo
更新yum
yum -y update
安装常用包
yum install -y ntp vim-enhanced gcc gcc-c++ gcc-g77 flex bison autoconf automake bzip2-devel ncurses-devel libjpeg-devel libpng-devel libtiff-devel freetype-devel pam-devel kernel
注意: 使用yum方式安装apache和php会存在以下问题:
建议全新安装php+mysql+apache
yum list mysql* yum -y install mysql.i386 mysql-devel.i386
yum -y install php php-devel php-mcrypt php-mbstring php-gd php-mysql
./configure --enable-eaccelerator=shared --with-php-config=/usr/bin/php-config
yum -y install libevent libevent-devel
./configure --with-libevent=/usr make make install
/usr/local/bin/memcached -d -m 512 -p 11211 -u root
/usr/bin/phpize ./configure --enable-memcache --with-php-config=/usr/bin/php-config --with-zlib-dir make make install
./configure --enable-eaccelerator=shared --with-php-config=/usr/bin/php-config make make install mkdir /tmp/eaccelerator && chmod 777 /tmp/eaccelerator && touch /var/log/eaccelerator_log
vi /etc/php.d/eaccelerator.ini
extension=eaccelerator.so eaccelerator.shm_size="16" eaccelerator.cache_dir="/tmp/eaccelerator" eaccelerator.enable="1" eaccelerator.optimizer="1" eaccelerator.check_mtime="1" eaccelerator.debug="0" eaccelerator.log_file = "/var/log/eaccelerator_log" eaccelerator.filter="" eaccelerator.shm_max="0" eaccelerator.shm_ttl="0" eaccelerator.shm_prune_period="0" eaccelerator.shm_only="0" eaccelerator.compress="1" eaccelerator.compress_level="9"