CentOS 6.5安装Apache(LAMP)
时间:2016-04-02 03:29 来源:linux.it.net.cn 作者:IT
1.清除系统中httpd痕迹:
yum remove httpd
rm -rvf /etc/httpd
2.解压:
tar zxvf httpd-2.2.19.tar.gz -C /usr/src/
3.配置:
cd /usr/src/httpd-2.2.19/
./configure --prefix=/usr/local/apache \
--enable-module=rewrite \
--disable-access \
--disable-auth \
--disable-charset-lite \
--disable-include \
--disable-log-config \
--disable-env \
--disable-setenvif \
--disable-mime \
--disable-status \
--disable-autoindex \
--disable-asis \
--disable-cgid \
--disable-cgi \
--disable-negotiation \
--disable-dir \
--disable-actions \
--disable-userdir \
--disable-alias \
--enable-so \
--enable-mods-shared='access auth auth_anon auth_dbm auth_digest dav dav_fs actions alias asis autoindex cache cern_meta cgi charset_lite deflate dir disk_cache env expires file_cache headers include info log_config logio mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias'
4.编译:
make
5.安装:
make install
6.修改配置:
cd /usr/local/apache/conf
mv httpd.conf httpd.conf.bak
grep -v "#" httpd.conf.bak >> httpd.conf
vim httpd.conf
添加以下一行:
ServerName localhost:80
7.添加httpd系统服务:
cp /usr/local/apache/bin/apachectl /etc/init.d/httpd
vim /etc/init.d/httpd
添加以下两行:
# chkconfig: 2345 80 20
# description: Start and Stop Apache
chmod a+x /etc/init.d/httpd
chkconfig --add httpd
chkconfig --level 2345 httpd on
chkconfig --list | grep httpd
8.重启apache服务:
service httpd restart
ps -aux | grep httpd
netstat -anptu | grep :80
9.测试:
http://localhost/
(能显示页面"It Works!",Apache成功安装完成)
(责任编辑:IT)
1.清除系统中httpd痕迹: yum remove httpd rm -rvf /etc/httpd 2.解压: tar zxvf httpd-2.2.19.tar.gz -C /usr/src/ 3.配置: cd /usr/src/httpd-2.2.19/ ./configure --prefix=/usr/local/apache \ --enable-module=rewrite \ --disable-access \ --disable-auth \ --disable-charset-lite \ --disable-include \ --disable-log-config \ --disable-env \ --disable-setenvif \ --disable-mime \ --disable-status \ --disable-autoindex \ --disable-asis \ --disable-cgid \ --disable-cgi \ --disable-negotiation \ --disable-dir \ --disable-actions \ --disable-userdir \ --disable-alias \ --enable-so \ --enable-mods-shared='access auth auth_anon auth_dbm auth_digest dav dav_fs actions alias asis autoindex cache cern_meta cgi charset_lite deflate dir disk_cache env expires file_cache headers include info log_config logio mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias' 4.编译: make 5.安装: make install 6.修改配置: cd /usr/local/apache/conf mv httpd.conf httpd.conf.bak grep -v "#" httpd.conf.bak >> httpd.conf vim httpd.conf 添加以下一行: ServerName localhost:80 7.添加httpd系统服务: cp /usr/local/apache/bin/apachectl /etc/init.d/httpd vim /etc/init.d/httpd 添加以下两行: # chkconfig: # description: chmod a+x /etc/init.d/httpd chkconfig --add httpd chkconfig --level 2345 httpd on chkconfig --list | grep httpd 8.重启apache服务: service httpd restart ps -aux | grep httpd netstat -anptu | grep :80 9.测试: http://localhost/ (能显示页面"It Works!",Apache成功安装完成) (责任编辑:IT) |