Linux下Apache HTTP Server 2.4.26的安装

Linux下Apache HTTP Server 2.4.26的安装

1.下载apr-1.5.2.tar.gz、apr-util-1.5.4.tar.gz、pcre-8.37.tar.gz、httpd-2.4.26.tar.gz

2.将apr-1.5.2.tar.gz、apr-util-1.5.4.tar.gz、pcre-8.37.tar.gz、httpd-2.4.26.tar.gz解压到/usr/local/目录下
tar -zxvf apr-1.5.2.tar.gz -C /usr/local/
tar -zxvf apr-util-1.5.4.tar.gz -C /usr/local/
tar -zxvf pcre-8.37.tar.gz -C /usr/local/
tar -zxvf httpd-2.4.26.tar.gz -C /usr/local/
3.将apr与apr-util移动到指定目录(httpd-2.4.26/srclib/)下并安装编辑器
mv apr-1.5.2 httpd-2.4.26/srclib/apr
mv apr-util-1.5.4 httpd-2.4.26/srclib/apr-util
yum install gcc gcc-c++

4.到pcre-8.37目录下配置并安装pcre
./configure --prefix=/usr/local/pcre

make

make install

5.到http-2.4.26目录下配置并安装httpd
./configure --prefix=/usr/local/apache --with-included-apr --with-pcre=/usr/local/pcre

make

 

make install

 

成功后:

安装完成后,生成目录如下

6.修改httpd.conf,启动apache
vi conf/httpd.conf +/ServerName

bin/apachectl start
7.直接http://192.168.145.128/访问肯定是访问不了,因为防火墙没有开放80端口。可以验证如下,因为ping 192.168.145.128 能通,但是telnet 192.168.145.128 80却不通。为了简便,直接关闭防火墙。
service iptables stop
chkconfig iptables off

 

更多Apache相关教程见以下内容

猜你喜欢

转载自www.linuxidc.com/Linux/2017-07/145571.htm