zoukankan      html  css  js  c++  java
  • centos6.5-搭建Apache

    准备工作

    1.关闭防火墙

    service iptables stop

    2.关闭selinux安全机制

    setenforce 0

    3.卸载rpm格式的httpd

    这说明已经安装了rpm格式的软件包。所以要卸载它。

    4.卸载

    rpm -e httpd –nodeps

    二、安装httpd

     

    1、下载apache

        wget http://archive.apache.org/dist/httpd/httpd-2.2.17.tar.gz

    2、解压压缩包

        tar xf httpd-2.2.17.tar.gz –C /usr/src

    3、编译源码包,并且安装

        (1)cd httpd-2.2.17

        

    ./configure --prefix=/usr/local/httpd --enable-so --enable-rewrite --enable-charset-lite --enable-cgi

    编译完成后,如上图,说明已经编译成功

    如果出现以下错误

    则在编译时入加 --with-included-apr 即可解决。

    优化路径

        ln -s /usr/local/httpd/bin/* /usr/local/bin/

    cp /usr/local/httpd/bin/apachectl   /etc/init.d/httpd

    4.  vi /etc/init.d/httpd  #编辑启动脚本,增加红色部分内容

        #!/bin/sh

        #chkconfig:345 66 88

        #description:http apache

    解释:

        345 66 88表示345运行级别是开启的,66为服务启动顺序,88服务为停止顺序。

     

        4chmod +x /etc/init.d/httpd

             chkconfig --add httpd

             chkconfig --list httpd

    5、启动服务

        service httpd start

        报错1httpd: Could not reliably determine the server's fully qualified domain name, using ::1 for ServerName

        解决:vim /usr/local/httpd/conf/httpd.conf

           97 #ServerName www.example.com:80

           98 ServerName localhost:80

  • 相关阅读:
    go timer
    go语言函数作为参数传递
    gomail发送附件
    统计和图片来说话
    一个发邮件的demo 用golang
    Shelled-out Commands In Golang
    阅读笔记
    语言和人收藏
    在线学习网址
    通用首席娱乐官:了解自己是成功的基础
  • 原文地址:https://www.cnblogs.com/pangbing/p/6534319.html
Copyright © 2011-2022 走看看