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

linux下安装apache

时间:2014-11-14 22:24:03      阅读:255      评论:0      收藏:0      [点我收藏+]

标签:style   http   io   color   ar   sp   for   文件   div   


1:Apache 官方网http://httpd.apache.org/下载所需安装包 httpd-2.4.10.tar.gz
   
2: 上传到服务器  目录自行决定  tar -zxvf 3:mv httpd-2.4.10 apache
    cd apache
    设置安装参数,命令如下:
   ./configure --prefix=/usr/local/apache --enable-module=so 


4:可能会出现以下错误 
   checking for APR... no configure: error: APR not found . Please read the documentation.
 则需要安装apr-1.4.2.tar.gz 
5:下载apr-1.4.2.tar.gz 
   a):上传到服务器,tar -zxvf apr-1.4.2.tar.gz  
     b): cd apr-1.4.2
     c):  ./configure 
   d):make , make install


6:再次检查编译环境出现  ,可能会出现以下错误 


       checking for APR-util... no configure: error: APR-util not found . Please read the documentation.


7:下载apr-util-1.3.9.tar.gz
   a):上传到服务器,tar -zxvf apr-util-1.3.9.tar.gz
     b): cd apr-util-1.3.9
     c):  ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
   d):make , make install
      
8再次检查编译环境出现  可能./configure仍提示APR-util not found,增加--with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util后出现
 
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/


9:下载pcre-8.10.zip


   a):上传到服务器,unzip -o pcre-8.10.zip
     b): cd pcre-8.10
     c): ./configure --prefix=/usr/local/pcre
   d):make , make install


10继续安装Apache/httpd
./configure  --with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pare
make
make install 


11:进入到/usr/local/apache  修改PATH环境变量,       在登录用户的home目录打开.bash_profile,在文件中添加一行       PATH=$PATH:/usr/local/apache/bin
12: apachectl start  启动  默认端口:80
13:http://ip:80  出现it works!表示正常配置。

14:说明:文档中出现的路径都是我自己服务器路径,并且注意安装版本,其他可能存在不兼容问题,
http://download.csdn.net/detail/tangyuanshark/7713369 
这里的几个安装文件我已经测试,正常安装。



linux下安装apache

标签:style   http   io   color   ar   sp   for   文件   div   

原文地址:http://www.cnblogs.com/supertang/p/4097011.html

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