CentOS 7.0 安装apache


1、安装apr

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

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

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


你可能感兴趣的:(local)