1.查看系统版本;
<pre>uname -a
Linux vm11060057 2.6.18-164.el5 #1 SMP Thu Sep 3 03:28:30 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux</pre>
<pre>head -n 1 /etc/issue
CentOS release 5.4 (Final)</pre>
2.安装apache2.2
1)下载httpd-2.2.21.tar.gz | apr-util-1.3.12.tar.gz|apr-1.4.5.tar.gz |pcre-8.12.tar.gz
2) tar -zxvf 解压对应压缩包。
3)到apache目录下 ,vi INSTALL</pre>
4)#./configure --prefix……检查编辑环境时出现:
checking for APR... no
configure: error: APR not found . Please read the documentation.
5)安装APR,cd apr-1.4.5
# ./configure
# make
# make install
6)再次编译出现该错误:configure: error: APR-util not found . Please read the documentation.
7)安装apr-util
# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
# make
# make install
8)接着提示:configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/
9)安装PCRE
# ./configure --prefix=/usr/local/pcre
# make
# make install
10)继续安装Apache/httpd,./configure 时加上参数 --with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre;
11)安装完毕apache;
3.安装PHP 5.3.8
1)下载php-5.3.8.tar.gz,后tar -zxvf
# ./configure --prefix=/usr/ali/php --with-apxs2=/$APACHEPATH/bin/apxs --with-config-file-path=/$APACHEPATH/conf
# make
# make install
# make test
# make clean
# vi /$APACHEPATH/conf/httpd.conf
2)任意位置添加如下内容
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
4. 单独编译安装Apache rewrite_module
1)编译
# cd /modules/mappers
# /$APACHEPATH/bin/apxs -i -a -c ./mod_rewrite.c
5.配置对应虚拟目录和.htaccess
1)配置目录略
2)Options FollowSymLinks
AllowOverride None
改为
Options FollowSymLinks
AllowOverride All
打开
LoadModule rewrite_module modules/mod_rewrite.so
6.重启,可以正常访问。
<pre>uname -a
Linux vm11060057 2.6.18-164.el5 #1 SMP Thu Sep 3 03:28:30 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux</pre>
<pre>head -n 1 /etc/issue
CentOS release 5.4 (Final)</pre>
2.安装apache2.2
1)下载httpd-2.2.21.tar.gz | apr-util-1.3.12.tar.gz|apr-1.4.5.tar.gz |pcre-8.12.tar.gz
2) tar -zxvf 解压对应压缩包。
3)到apache目录下 ,vi INSTALL</pre>
4)#./configure --prefix……检查编辑环境时出现:
checking for APR... no
configure: error: APR not found . Please read the documentation.
5)安装APR,cd apr-1.4.5
# ./configure
# make
# make install
6)再次编译出现该错误:configure: error: APR-util not found . Please read the documentation.
7)安装apr-util
# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
# make
# make install
8)接着提示:configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/
9)安装PCRE
# ./configure --prefix=/usr/local/pcre
# make
# make install
10)继续安装Apache/httpd,./configure 时加上参数 --with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre;
11)安装完毕apache;
3.安装PHP 5.3.8
1)下载php-5.3.8.tar.gz,后tar -zxvf
# ./configure --prefix=/usr/ali/php --with-apxs2=/$APACHEPATH/bin/apxs --with-config-file-path=/$APACHEPATH/conf
# make
# make install
# make test
# make clean
# vi /$APACHEPATH/conf/httpd.conf
2)任意位置添加如下内容
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
4. 单独编译安装Apache rewrite_module
1)编译
# cd /modules/mappers
# /$APACHEPATH/bin/apxs -i -a -c ./mod_rewrite.c
5.配置对应虚拟目录和.htaccess
1)配置目录略
2)Options FollowSymLinks
AllowOverride None
改为
Options FollowSymLinks
AllowOverride All
打开
LoadModule rewrite_module modules/mod_rewrite.so
6.重启,可以正常访问。