日期:2014-05-16  浏览次数:20575 次

linux apache安装
三. 安装apache
cd /usr/local/src/
wget http://archive.apache.org/dist/httpd/httpd-2.2.14.tar.gz
chmod +x httpd-2.2.14.tar.gz
tar -zxvf httpd-2.2.14.tar.gz
# 下载并解压apache源文件

cd httpd-2.2.14
./configure --prefix=/usr/local/apache2 --enable-so --enable-rewrite=share --enable-dav=share --enable-dav-fs
--enable-so 
指定允许DSO(动态共享对像)
--enable-rewrite=share 
开启Rewrite支持,以实现URL静态化,建议开启。
--enable-dav-fs
开启WebDAV支持,svn服务器等需要
make
make install
# 如果没有错误的话,那么Apache就已经安装在/usr/local/apache2目录中了
/usr/local/apache2/bin/apachectl start
# 启动服务
cp /usr/local/apache2/bin/apachectl /etc/rc.d/init.d/httpd
vim /etc/rc.d/init.d/httpd
在 #!/bin/sh 下增加如下两行
# chkconfig: 35 70 30
# description: Apache
chkconfig --add httpd
service httpd stop
service httpd start
# 将apache添加为随机启动