Linux下编译、安装并启动apache

安装步骤如下:

1.  首先去http://httpd.apache.org/download.cgi上下载需要的apache源码,然后存放至/usr/local/src下【此源码存放路径可任意指定

2.  切换至/usr/local/src下,解压apache源码,并切换至解压后的apache目录下

3.  ./configure --prefix=/usr/local/httpd

4.  make

5.  make install

6.  cd /usr/local/httpd

7.  ./bin/apachectl start    

【启动apache,

 此阶段可能会出现以下问题:

  a.   ‘httpd: apr_sockaddr_info_get() failed for 主机名’---------解决办法是:在 /etc/hosts 中填入自己的主机名称 ,如下:127.0.0.1 主机名称

  b.  'httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName'-----------解决办法是:可以设定httpd.conf文件中的 ServerName,如下:ServerName localhost:80 

8.  ./bin/apachectl restart   【重启apache】

9.  ./bin/apachectl stop       【停止apache】

至此,apache已成功安装完成!

 

posted on 2017-02-23 10:08  eaglezb  阅读(643)  评论(0编辑  收藏  举报

导航