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

  • 相关阅读:
    电商总结(二)日志与监控系统的解决方案
    倾力推荐,哪一本让你想要加入书单
    电商总结(一)小型电商网站的架构
    聊一聊如何提升团队开发效率
    Nancy总结(三)Nancy资料介绍
    【推荐】2016年不得不读的九本好书
    Solr学习总结(七)Solr搜索引擎的整体架构
    再见 2015,你好 2016
    Solr学习总结(六)SolrNet的高级用法(复杂查询,分页,高亮,Facet查询)
    Solr学习总结(五)SolrNet的基本用法及CURD
  • 原文地址:https://www.cnblogs.com/oo-oo/p/CentOS6-apache.html
Copyright © 2011-2022 走看看