Under CENTOS7 compile and install httpd2.4

1、yum -y install pcre-devel expat-devel openssl-devel gcc-c++ bzip2
2、tar xf apr-1.7.0.tar
3、tar xf apr-util-1.6.1.tar
4、tar xf httpd-2.4.39.tar
5、mv apr-1.7.0 httpd-2.4.39/srclib/apr
6、mv apr-util-1.6.1 httpd-2.4.39/srclib/apr-util
7、cd httpd-2.4.39/
8、./configure --prefix=/usr/local/apache --sysconfdir=/etc/httpd24 --enable-so --enable-ssl --enable-cgi --enable-write --with-zlib --with-pcre --enable-mpms-shared=all --with-mpm=event
9、make && make install
10、cp /usr/local/apache/bin/apachectl /etc/init.d/httpd
11、vim /etc/init.d/httpd
加入一行# chkconfig: 35 85 21
12、chmod+x /etc/init.d/httpd
13、chkconfig --add httpd
14、ln -sv /usr/local/apache/incule /usr/local/httpd
15, vim /etc/man_db.conf
added line MANDATORY_MANPATH / usr / local / Apache / man
16, Vim /etc/profile.d/httpd.sh
new row export PATH = / usr / local / apache / bin: $ PATH
17, Source /etc/profile.d/httpd.sh
18, vim /etc/httpd24/httpd.conf
find #ServerName localhost: 80 this line, remove the comment
19, systemctl Start httpd
20, and then open your browser and enter your IP address, if there is display it works! proves successful. If the browser can not access, firewall and look SELINUX have not closed.

Guess you like

Origin blog.51cto.com/12276015/2400333