zoukankan      html  css  js  c++  java
  • CentOS6.5安装LAMP环境APACHE的安装

    1、卸载apr、apr-util
      [root@centos6 LAMP]# yum remove apr apr-util

    2、编译安装apr-1.5.1.tar.gz
      [root@centos6 LAMP]# tar zxvf apr-1.5.1.tar.gz
      [root@centos6 LAMP]# cd apr-1.5.1
      [root@centos6 apr-1.5.1]# ./configure --prefix=/usr/local/lamp/apr-httpd
      [root@centos6 apr-1.5.1]# make
      [root@centos6 apr-1.5.1]# make install

    3、编译安装apr-util-1.5.4.tar.gz
      [root@centos6 LAMP]# tar zxvf apr-util-1.5.4.tar.gz
      [root@centos6 LAMP]# cd apr-util-1.5.4
      [root@centos6 apr-util-1.5.4]# ./configure --prefix=/usr/local/lamp/apr-util-httpd --with-apr=/usr/local/lamp/apr-httpd
      [root@centos6 apr-util-1.5.4]# make
      [root@centos6 apr-util-1.5.4]# make install

    4、编译安装pcre-8.35.zip
      [root@centos6 LAMP]# unzip -o pcre-8.36.zip
      [root@centos6 LAMP]# cd pcre-8.36
      [root@centos6 pcre-8.36]# ./configure --prefix=/usr/local/lamp/pcre
      [root@centos6 pcre-8.36]# make
      [root@centos6 pcre-8.36]# make install

    5、编译安装apache
      [root@centos6 LAMP]# tar -zxvf httpd-2.4.10.tar.gz
      [root@centos6 LAMP]# cd httpd-2.4.10
      [root@centos6 httpd-2.4.10]# ./configure --prefix=/usr/local/lamp/apache --enable-mods-shared=all --enable-deflate --enable-speling --enable-cache  --enable-file-cache --enable-disk-cache --enable-mem-cache --enable-so --enable-expires=shared --enable-rewrite=shared --enable-static-support --sysconfdir=/etc/httpd
    --with-z=/usr/local/lamp/zlib --with-apr=/usr/local/lamp/apr-httpd --with-apr-util=/usr/local/lamp/apr-util-httpd --with-pcre=/usr/local/lamp/pcre/ --disable-userdir
      [root@centos6 httpd-2.4.10]# make && make instal

    6、修改配置
      [root@centos6 httpd-2.4.10]# vi /etc/httpd/httpd.conf

      修改成 ServerName localhost:80

    7、启动apache
      [root@centos6 httpd-2.4.10]# /usr/local/apache/bin/apachectl start

      浏览器访问本机IP地址,出现It works!,就OK了!

    8、做成服务  [root@localhost apache]# echo "/usr/local/lamp/apache/bin/apachectl start" >> /etc/rc.d/rc.local
      [root@centos6 LAMP]# /usr/local/lamp/apache/bin/apachectl start
      [root@centos6 LAMP]# cp /usr/local/lamp/apache/bin/apachectl /etc/init.d/httpd
      [root@centos6 LAMP]# chmod +x /etc/init.d/httpd
      [root@centos6 ~]# chkconfig --add httpd
      注意:如果提示service httpd does not support chkconfig错误,解决办法:编辑/etc/rc.d/init.d/httpd在文件第二行加入         
        #chkconfig:2345 10 90
        #description:Activates/Deactivates Apache Web Server
      [root@centos6 ~]# chkconfig --level 2345 httpd on
      [root@centos6 LAMP]# service httpd restart

  • 相关阅读:
    【2021-03-03】人生十三信条
    【2021-03-02】勤奋和努力是积极乐观的自然导向
    【2021-03-01】解铃还需系铃人
    【2021-02-28】人生十三信条
    【2021-02-27】人生十三信条
    【2021-02-26】人生十三信条
    【2021-02-25】“活到老,做到老”的观念趋势
    【一句日历】2021年3月
    【2021-02-24】理想化中的积极进取精神
    机器人走方格
  • 原文地址:https://www.cnblogs.com/oo-oo/p/CentOS6-apache.html
Copyright © 2011-2022 走看看