阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

CentOS 6.6编译安装httpd2.4.10

211次阅读
没有评论

共计 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

正文完
星哥玩云-微信公众号
post-qrcode
 0
星锅
版权声明:本站原创文章,由 星锅 于2022-01-21发表,共计2468字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中