centos7安装httpd服务编译安装apache要注意的事情
http://archive.apache.org/dist
wget http://archive.apache.org/dist/apr/apr-1.5.2.tar.gz
wget http://archive.apache.org/dist/apr/apr-util-1.5.4.tar.gz
Pcre 下载地址
wget https://ftp.pcre.org/pub/pcre/pcre-8.38.tar.gz
yum install gcc gcc-c++ -y 这个必须要安装,否则会报错
[ ~]# ll
总用量 3876
-rw-------. 1 root root 1227 10月 1 2019 anaconda-ks.cfg
-rw-r--r--. 1 root root 1031613 4月 29 2015 apr-1.5.2.tar.gz
-rw-r--r--. 1 root root 874044 9月 20 2014 apr-util-1.5.4.tar.gz
-rw-r--r--. 1 root root 2053336 7月 21 2017 pcre-8.38.tar.gz
[ ~]#
[ ~]# tar zxf apr-1.5.2.tar.gz
[ ~]# cd apr-1.5.2
[ ~]# ./configure --prefix=/usr/local/apr
[ ~]# make && make install
[ ~]# tar zxf apr-util-1.5.4.tar.gz
[ ~]# cd apr-util-1.5
[]#./configure --prefix=/usr/local/web/apr-util -with-apr=/usr/local/apr
[ apr-util-1.5.4]# make && make install
[ ~]# tar zxf pcre-8.38.tar.gz
[ ~]# cd pcre-8.38
[ pcre-8.38]# ./configure --prefix=/usr/local/pcre
[ pcre-8.38]# make && make install
Apache 安装过程
1.下载apache
历史版本下载:
http://archive.apache.org/dist/httpd/
[ ~]# wget http://archive.apache.org/dist/httpd/httpd-2.4.33.tar.gz
[ ~]# tar zxf httpd-2.4.33.tar.gz
[ ~]# cd httpd-2.4.33
[]#./configure --prefix=/usr/local/apache2.4.33\
--enable-expires \
--enable-headers \
--enable--modules=most \
--enable-so \
--enable-rewrite \
--with-mpm=worker \
--with-apr=/usr/local/apr \
--with-apr-util=/usr/local/web/apr-util \
--with-pcre=/usr/local/pcre
[ httpd-2.4.33]# make && make install
[ ~]# /usr/local/apache2.4.33/bin/apachectl
AH00558: httpd: Could not reliably determine the server‘s fully qualified domain name, using fe80::20b7:18c6:149e:92fd. Set the ‘ServerName‘ directive globally to suppress this message
Vi /usr/local/apache2.4.33/conf
把httpd.conf中的#ServerName www.example.com:80 注释取消掉
这里会发现 centos图形界面能打开网站,其他主机却打不开,这里是因为防火墙未关闭
[ conf]# systemctl stop firewalld.service
[ conf]# systemctl disable firewalld.service
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[ conf]#