9780j 发表于 2016-2-15 09:11:48

CentOS 7.0 安装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






页: [1]
查看完整版本: CentOS 7.0 安装apache