且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

CentOS 7.0 安装apache

更新时间:2022-09-20 20:19:31


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,如需转载请自行联系原作者