Centos6.6下安装apache2.4

来源:互联网 发布:视音频切换矩阵 编辑:程序博客网 时间:2024/06/05 17:22

安装以下包需要gcc,请自行安装gcc

1.安装apr-1.5.1.tar.gz

tar -zxvf apr-1.5.1.tar.gz cd apr-1.5.1./configure --prefix=/usr/local/aprmakemake install

2.安装apr-util-1.5.4.tar.gz

tar -zxvf apr-util-1.5.4.tar.gz cd apr-util-1.5.4./configure --with-apr=/usr/local/aprmakemake install

3.安装pcre-8.36.tar.gz

tar -zxvf pcre-8.36.tar.gzcd pcre-8.36./configure --prefix=/usr/local/pcremakemake install

4.安装httpd-2.4.10.tar.gz

tar -zxvf httpd-2.4.10.tar.gz cd httpd-2.4.10./configure --prefix=/usr/local/apache --with-apr=/usr/local/apr/ --with-pcre=/usr/local/pcre/makemake install

5.修改/usr/local/apache/conf/httpd.conf 

找到#ServerName www.example.com:80修改为ServerName localhost:80

6.将http加入service

cp /usr/local/apache/bin/apachectl /etc/rc.d/init.d/httpd

7.修改/etc/rc.d/init.d/httpd

在#!/bin/bash下加入

# chkconfig: 2345 50 90# description:Activates/Deactivates Apache Web Server)

8.启动apache

service httpd start

9.验证apache是否启动成功

lsof -i:80

出现如下输出则证明apache启动

COMMAND  PID   USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
httpd   4158   root    4u  IPv6  50349      0t0  TCP *:http (LISTEN)
httpd   4159 daemon    4u  IPv6  50349      0t0  TCP *:http (LISTEN)
httpd   4160 daemon    4u  IPv6  50349      0t0  TCP *:http (LISTEN)
httpd   4161 daemon    4u  IPv6  50349      0t0  TCP *:http (LISTEN)



0 0
原创粉丝点击