码迷,mamicode.com
首页 > Web开发 > 详细

LINUX 下源码安装 Apache

时间:2015-09-10 14:26:35      阅读:182      评论:0      收藏:0      [点我收藏+]

标签:

操作系统CentOS 7

linux下,默认Apache安装软件,其路径是随着开发软件人员的习惯而定,在开发过程中会经常不知道到所需的程序路径,因此手动安装程序对后续的使用会提供非常大的便利

 

一:准备

  1.安装 apr
  下载地址:http://apr.apache.org/download.cgi

  [root@lcoalhost:/usr/local/src]# tar zxvf apr-1.5.2.tar.gz

  [root@lcoalhost:/usr/local/src/apr-1.5.2]# ./configure --prefix=/usr/lcoal/apr

  [root@lcoalhost:/usr/local/src/apr-1.5.2]# make

  [root@lcoalhost:/usr/local/src/apr-1.5.2]# make install


  2.安装 apr-util
  下载地址:http://apr.apache.org/download.cgi
  [root@lcoalhost:/usr/local/src]# tar zxvf apr-util-1.5.4.tar.gz
  [root@lcoalhost:/usr/local/src/apr-util-1.5.4]# ./configure --prefix=/usr/lcoal/apr-util --with-apr=/usr/lcoal/apr

  [root@lcoalhost:/usr/local/src/apr-util-1.5.4]# make

  [root@lcoalhost:/usr/local/src/apr-util-1.5.4]# make install


  3.安装 pcre
  下载地址:http://pcre.org/
  [root@lcoalhost:/usr/local/src]# tar jxvf pcre-8.37.tar.gz
  [root@lcoalhost:/usr/local/src/pcre-8.37]# ./configure --prefix=/usr/lcoal/pcre

  [root@lcoalhost:/usr/local/src/pcre-8.37]# make

  [root@lcoalhost:/usr/local/src/pcre-8.37]# make install


  注意:如果在安装 pcre 时,遇到问题:configure: error: You need a C++ compiler for C++ support.
  解决方法:yum install -y gcc gcc-c++

二:安装Apache

  下载地址:http://httpd.apache.org/
  [root@lcoalhost:/usr/local/src]# tar zxvf httpd-2.4.16.tar.gz
  [root@lcoalhost:/usr/local/src/httpd-2.4.16]# ./configure --prefix=/usr/lcoal/apache --with-apr=/usr/lcoal/apr --with-apr-util=/usr/lcoal/apr-util --with-pcre=/usr/lcoal/pcre

  [root@lcoalhost:/usr/local/src/httpd-2.4.16]# make

  [root@lcoalhost:/usr/local/src/httpd-2.4.16]# make install

三:配置

  1.启动
  [root@localhost:/usr/local/apache]# ./bin/apachectl start

  2.开机启动
  打开文件:/etc/rc.local
  [root@localhost:/]# vim /etc/rc.local

  添加:/work/installed/apache/bin/apachectl start

OK啦 http://localhost OR http://ip

 技术分享

LINUX 下源码安装 Apache

标签:

原文地址:http://www.cnblogs.com/ID890/p/Apache.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!