zoukankan      html  css  js  c++  java
  • Apache-rhel5.8环境下编译安装

    Apache安装过程

    Step 1:安装包gcc或gcc-c++
    # yum install gcc
    #yum install gcc-c++

    Step 2:安装包APR和APR-Util
    apr-1.4.8.tar.gz apr-util-1.5.2.tar.gz

    # tar -zxf apr-1.4.8.tar.gz
    # cd apr-1.4.8

    新建目录/usr/local/apr,用作安装目录:
    # mkdir /usr/local/apr
    # ./configure --prefix=/usr/local/apr
    # make
    # make install

    安装apr-util
    # ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
    # make
    # make install

    Step 3:安装包PRCE
    # cd pcre-8.33
    #mkdir /usr/local/pcre
    ./configure --prefix=/usr/local/apache --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util
    # make
    # make install

    Step 4:安装Apache Http Server
    # tar zxvf httpd-2.4.6.tar.gz
    #cd httpd-2.4.6

    #./configure --prefix=/opt/data/apache2
    --enable-so
    --enable-mods-shared=most
    --with-mpm=worker
    --with-apr=/usr/local/apr
    --with-apr-util=/usr/local/apr-util
    --with-included-apr
    --with-pcre=/usr/local/pcre

    #make
    #make install

    Step 5:启动Apache服务
    #/opt/data/apache2 /bin/apachectl start

    用浏览器访问http://localhost时提示It works!

    启动报错:
    # /usr/local/apache/bin/apachectl start

    AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using getlnx05.gfg1.esquel.com. Set the 'ServerName' directive globally to suppress this message

    这个时候需要编辑httpd.conf配置文件,添加SeraverName的具体IP地址。
    SeraverName 192.168.1.123:80

    如果从其它电脑连接访问Apache时,输入url地址:http://ip 页面没有显示正常,而上面配置也OK,那么你必须关闭防火墙,有时候甚至需要重启电脑才能OK,重启Apache服务都无效。
    # chkconfig iptables off
    # chkconfig iptables off
    # /usr/local/apache/bin/apachectl restart

  • 相关阅读:
    zookeeper端口号冲突:8080冲突
    Linux 开机报 or type Control-D to continue
    linux分区和系统文件和挂载
    linux添加JAVA环境变量
    root用户安装的软件在普通用户不生效
    微信小程序:text元素中加入空格
    Java Swing:JPanel添加边框
    Java Swing:JPanel中添加JPanel
    Spring Boot:项目打包成war并发布到Tomcat上运行
    IDEA将MAVEN项目打包成war包
  • 原文地址:https://www.cnblogs.com/rusking/p/4471409.html
Copyright © 2011-2022 走看看