zoukankan      html  css  js  c++  java
  • [笔记] 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

  • 相关阅读:
    高并发场景之RabbitMQ
    后台任务利器之Hangfire
    【Spring】Redis的两个典型应用场景--good
    【Spring】如何在单个Boot应用中配置多数据库?
    Spring Boot中集成Spring Security 专题
    RestTemplateIntegrationTests
    Spring REST实践之客户端和测试
    Android 高仿豌豆荚 一键安装app 功能
    使用Android studio下载github上的工程及问题解决
    Windows下AndroidStudio 中使用Git(AndroidStudio项目于GitHub关联)
  • 原文地址:https://www.cnblogs.com/hjfeng1988/p/4372411.html
Copyright © 2011-2022 走看看