CentOS 7.0 安装apache

本文提供了一步一步的指导来安装Apache Web服务器。首先安装了APR和APR-UTIL库,随后配置并安装了HTTPD服务器,启用了SSL、CGI等模块,并进行了必要的系统设置以确保Apache能正常启动。

1、安装apr

1
2
3
4
5
yum -y install gcc gcc-c++ openssl-devel pcre-devel
tar zxf apr-1.5.2.tar.gz 
cd apr-1.5.2
./configure --prefix=/usr/local/apr --disable-ipv6
make && make install

2、安装apr-util

1
2
3
4
tar zxf apr-util-1.5.4.tar.gz 
cd apr-util-1.5.4
./configure  --prefix=/usr/local/apr-util  --with-apr=/usr/local/apr
make && make install

3、安装httpd

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
tar zxf httpd-2.4.17.tar.gz 
cd httpd-2.4.17
tar zxf httpd-2.4.17.tar.gz 
cd httpd-2.4.17
./configure \
--prefix=/usr/local/apache \
--sysconfdir=/etc/httpd \
--enable-so \
--enable-ssl \
--enable-cgi \
--enable-rewrite \
--with-zlib \
--with-pcre \
--with-apr=/usr/local/apr \
--with-apr-util=/usr/local/apr-util \
--enable-modules=most \
--enable-mods-shared=most \
--enable-mpms-shared=all \
--with-mpm=event
make && make install
cp /usr/local/apache/bin/apachectl /etc/rc.d/init.d/httpd
vim /etc/rc.d/init.d/httpd
    # Comments to support chkconfig on RedHat Linux
    # chkconfig:2345 90 90
    # description:http server 
vim /etc/httpd/httpd.conf 
    ServerName localhost:80
yum install -y lynx
chkconfig --add httpd
chkconfig httpd on
service httpd start


参考博文:http://www.360doc.com/content/15/0320/09/14900341_456614079.shtml




     本文转自1321385590 51CTO博客,原文链接:http://blog.51cto.com/linux10000/1741964,如需转载请自行联系原作者


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值