共计 2468 个字符,预计需要花费 7 分钟才能阅读完成。
系统安装包是 CentOS-6.6-x86_64-minimal.iso
查看一下 uname 信息
[root@localhost ~]# uname -a
Linux localhost.localdomain 2.6.32-504.el6.x86_64 #1 SMP Wed Oct 15 04:27:16 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost ~]#yum install -y vim wget lrzsz
需要的安装包 httpd-2.4.10.tar.bz2、apr-1.5.1.tar.bz2(Apache portable Run-time libraries)、apr-util-1.5.4.tar.bz2。
下载地址直接上 apache.org 官网
[root@localhost src]# pwd
/usr/local/src
[root@localhost src]# ls
apr-1.5.1.tar.bz2 apr-util-1.5.4.tar.bz2 httpd-2.4.10.tar.bz2
[root@localhost src]# tar jxvf apr-1.5.1.tar.bz2
[root@localhost src]# tar jxvf apr-util-1.5.4.tar.bz2
[root@localhost src]# tar jxf httpd-2.4.10.tar.bz2
[root@localhost src]# mv apr-1.5.1 httpd-2.4.10/srclib/apr
[root@localhost src]# mv apr-1.5.1 httpd-2.4.10/srclib/apr-util
[root@localhost src]# more httpd-2.4.10/INSTALL
有这么一句话:download the latest versions and unpack them to ./srclib/apr and ./srclib/apr-util (no version numbers in the directory names)
编译前组件安装
[root@localhost httpd-2.4.10]# yum install -y gcc pcre-devel
配置 configure 及编译安装
[root@localhost httpd-2.4.10]# ./configure –prefix=/usr/local/apache2 –with-included-apr
[root@localhost httpd-2.4.10]# make
[root@localhost httpd-2.4.10]# make install
开放防火墙 80 端口,顺便关闭 selinux,这玩意高端本人不会玩
[root@localhost ~]# vim /etc/sysconfig/iptables
…
-A INPUT -m state –state NEW -m tcp -p tcp –dport 22 -j ACCEPT
-A INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT
…
[root@localhost ~]# /etc/init.d/iptables reload
iptables: Trying to reload firewall rules: [OK]
[root@localhost ~]# getenforce
Enforcing
[root@localhost ~]# setenforce 0
[root@localhost ~]# getenforce
Permissive
复制启动文件
[root@localhost ~]# cp /usr/local/apache2/bin/apachectl /etc/init.d/httpd
[root@localhost ~]# chmod +x /etc/init.d/httpd
[root@localhost ~]# /etc/init.d/httpd start
AH00558: httpd: Could not reliably determine the server’s fully qualified domain name, using localhost.localdomain. Set the ‘ServerName’ directive globally to suppress this message
有报错,挺不舒服的,虽然它不影响
[root@localhost ~]# vim /usr/local/apache2/conf/httpd.conf
…
ServerName 192.168.128.152
…
[root@localhost ~]# /etc/init.d/httpd graceful
客户测试访问,正常 OK。
Linux 下配置 Apache httpd http://www.linuxidc.com/Linux/2016-04/130379.htm
Linux 下安装 Apache httpd http://www.linuxidc.com/Linux/2016-04/130378.htm
基于 CentOS 6.7 搭建 LAMP(httpd-2.4.18+mysql-5.5.47+php-5.6.16)环境 http://www.linuxidc.com/Linux/2016-04/130356.htm
Linux 下编译安装 Apache httpd 2.4 http://www.linuxidc.com/Linux/2016-04/130294.htm
CentOS 6 编译 httpd-2.4.10 http://www.linuxidc.com/Linux/2016-01/127611.htm
更多 CentOS 相关信息见 CentOS 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=14
本文永久更新链接地址 :http://www.linuxidc.com/Linux/2016-05/131329.htm