CentOS 5.0 LAMP 安装手记

Apache-1.3.41(Apache-2.2.8) + MySQL-5.0.56 + PHP-5.2.5 + eaccelerator-0.9.5.2

如果安装过程中出现configure error,请参考:
PHP5常见的configure error的解决方法

一、安装 MySQL
# tar xzvf mysql-5.0.56.tar.gz
# cd mysql-5.0.56
# ./configure /
--prefix=/usr/local/mysql /
--localstatedir=/var/lib/mysql /
--with-comment=Source /
--with-server-suffix=-enterprise-gpl /
--with-mysqld-user=mysql /
--without-debug /
--with-big-tables /
--with-charset=utf8 /
--with-collation=utf8_general_ci /
--with-extra-charsets=all /
--with-pthread /
--enable-static /
--enable-thread-safe-client /
--with-client-ldflags=-all-static /
--with-mysqld-ldflags=-all-static /
--enable-assembler /
--without-innodb /
--without-ndb-debug /
--without-isam /
--enable-local-infile /
--with-readline /
--with-raid

# make
# make install
# useradd mysql
# cd /usr/local/mysql
# bin/mysql_install_db --user=mysql
# chown -R root:mysql .
# chown -R mysql /var/lib/mysql
# chgrp -R mysql .
# cp share/mysql/my-medium.cnf /etc/my.cnf
# cp share/mysql/mysql.server /etc/init.d/mysqld
# chmod 755 /etc/init.d/mysqld
# chkconfig --add mysqld
# echo "/usr/local/mysql/lib" >> /etc/ld.so.conf && ldconfig
# /etc/init.d/mysqld start
# ln -s /usr/local/mysql/bin/mysql /usr/bin/mysql

二、安装 Apache
# tar xzvf apache_1.3.41.tar.gz
# cd apache_1.3.41
# ./configure /
--prefix=/usr/local/apache /
--sysconfdir=/etc/httpd /
--logfiledir=/var/log/httpd /
--enable-shared=max /
--enable-module=most /
--disable-module=auth_dbm

# make
# make install
# cd /etc/httpd
# grep -v "#" httpd.conf.default > httpd.conf
# cp /usr/local/apache/bin/apachectl /etc/init.d/httpd
# /etc/init.d/httpd start

附一:安装apache日志截断程序 cronolog
# tar xzvf cronolog-1.6.2.tar.gz
# cd cronolog-1.6.2
# ./configure
# make
# make install
# cp src/cronolog /usr/bin/

httpd.conf 里配置:
CustomLog "|/usr/bin/cronolog /var/log/httpd/koven/%Y-%m-%d" common

附二:Apache 2.2.x + apr + apr-util 的编译安装
# tar xzvf httpd-2.2.8.tar.gz
# cd httpd-2.2.8
# cd srclib/apr
# ./configure --prefix=/usr/local/apr --enable-threads --enable-other-child --enable-static
# make
# make install
# cd ../apr-util
# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/ --with-mysql=/usr/local/mysql
# make
# make install
# cd /usr/local/src/httpd-2.2.8
# ./configure /
--prefix=/usr/local/apache2 /
--enable-mods-shared=all /
--enable-cache /
--enable-file-cache /
--enable-mem-cache /
--enable-disk-cache /
--enable-static-support /
--enable-static-htpasswd /
--enable-static-htdigest /
--enable-static-rotatelogs /
--enable-static-logresolve /
--enable-static-htdbm /
--enable-static-ab /
--enable-dav /
--enable-so /
--enable-static-checkgid /
--disable-cgid /
--disable-cgi /
--with-apr=/usr/local/apr/ /
--with-apr-util=/usr/local/apr-util/ /
--enable-ssl /
--with-ssl=/usr/include /
--with-pcre /
--sysconfdir=/etc/httpd

# make
# make install
# cp /usr/local/apache2/bin/apachectl /etc/init.d/httpd
# chkconfig --add httpd
# chkconfig --level 235 httpd on
# /etc/init.d/httpd start


三、安装 PHP
# tar xzvf php-5.2.5.tar.gz
# cd php-5.2.5
# ./configure /
--prefix=/usr/local/php /
--with-apxs=/usr/local/apache/bin/apxs /
--enable-inline-optimization /
--with-config-file-path=/etc /
--enable-calendar /
--enable-bcmath /
--enable-calendar /
--enable-exif /
--enable-ftp /
--enable-gd-native-ttf /
--enable-libxml /
--enable-magic-quotes /
--enable-mbstring /
--enable-soap /
--enable-sockets /
--enable-wddx /
--enable-zip /
--with-freetype-dir=/usr /
--with-gd /
--with-gettext /
--with-jpeg-dir=/usr /
--with-libxml-dir=/usr /
--with-mysql=/usr/local/mysql /
--with-mysql-sock=/tmp/mysql.sock /
--with-mysqli=/usr/local/mysql/bin/mysql_config /
--with-openssl=/usr /
--with-openssl-dir=/usr /
--with-png-dir=/usr /
--with-xmlrpc /
--with-xpm-dir=/usr/X11R6 /
--with-zlib /
--with-zlib-dir=/usr /
--with-pdo-mysql=/usr/local/mysql /
--with-curl

取消magic-quotes: --disable-magic-quotes
启用fcgi模式的添加 --enable-fastcgi --enable-force-cgi-redirect 这两个编译参数,一般用于与 Zeus 结合。
# make
# make install
# cp php.ini-dist /etc/php.ini

附一:安装 PHP 加速器 eaccelerator
# tar xjvf eaccelerator-0.9.5.2.tar.bz2
# cd eaccelerator-0.9.5.2
# /usr/local/php/bin/phpize
# ./configure /
--enable-eaccelerator=shared /
--with-php-config=/usr/local/php/bin/php-config
# make
# make install

编译安装后你会看到屏幕提示的eaccelerator.so所在的目录如:/usr/local/php/lib/php/extensions/no-debug-zts-20060613/eaccelerator.so请记住!

修改php.ini(etc/php.ini )
extension_dir = "/usr/local/php/lib/php/extensions"

加入以下内容:
[eaccelerator]
extension="/no-debug-non-zts-20060613/eaccelerator.so"
eaccelerator.shm_size="32"
eaccelerator.cache_dir="/tmp/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
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"

# mkdir /tmp/eaccelerator
# chmod 0777 /tmp/eaccelerator

乌秋博客原创,转载请注明。谢谢!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值