• [笔记] centos6.6编译安装httpd2.4.10


    系统安装包是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

  • 相关阅读:
    php.h: No such file or directory
    检查日期是否为节假日api
    Linux下实现秒级的crontab定时任务
    Apache 两种mpm prefork 和 worker 的区别
    centos6 安装mysql报错Requires: libc.so.6(GLIBC_2.14)
    Yii2 高级模板添加更多Application
    Yii2 assets注册的css样式文件没有加载
    Yii rbac原理和实践
    Yii2 ActiveRecord save失败
    Yii2 手动安装yii2-imagine插件
  • 原文地址:https://www.cnblogs.com/hjfeng1988/p/4372411.html
Copyright © 2020-2023  润新知