Linux系统安装apache
1)下载apache 所需的安装包(apr-1.5.2.tar.gz 、apr-util-1.5.4.tar.gz、httpd-2.4.16.tar.gz)# wget http://mirrors.axint.net/apache//httpd/httpd-2.4.16.tar.gz
# wget http://mirrors.axint.net/apache//apr/apr-1.5.2.tar.gz
# wget http://mirrors.axint.net/apache//apr/apr-util-1.5.4.tar.gz
2)解压安装包
# tar xzvfhttpd-2.4.16.tar.gz
# tar xvzf apr-1.5.2.tar.gz
# tar xvzf apr-util-1.5.4.tar.gz
3)移动
# mv apr-1.5.2 httpd-2.4.16/srclib/apr ->httpd-2.4.16/srclib/apr 不能带有版本号
# mv apr-util-1.5.4 httpd-2.4.16/srclib/apr-util ->httpd-2.4.16/srclib/apr-util 不能带有版本号
4)pcre安装包,在光盘里面可以找到。
# rpm -ivh pcre-7.8-6.el6.i686.rpm 还有 pcre-devel-7.8-3.1.el6.i686.rpm
5)进入httpd-2.4.16
# ./configure --prefix=/usr/local/apache --enable-so --enable-deflate=shared --enable-ssl=shared --enable-expires=shared--enable-headers=shared --enable-rewrite=shared --enable-static-support--with-included-apr --with-mpm=prefork
6)编译安装
# make && make install
7)完成后启动apache
#/usr/local/apache/bin/apachectl -t 检查语句
Syntax OK
#/usr/local/apache/bin/apachectl start 启动
netstat -ntpl | grep ":80"
8)添加apache到系统服务
# cp /usr/local/apache/bin/apachectl /etc/init.d/
# chmod a+x /etc/init.d/apachectl
# vim /etc/init.d/apachectl
#!/bin/sh
#chkconfig:35 61 61
# chkconfig --add apachectl
# chkconfig --list apachectl
apachectl 0:off 1:off 2:off 3:on 4:off 5:on 6:off
# serviceapachectl stop
# serviceapachectl start
页:
[1]