Apache  httpd服务

1、找到后缀名是.tar.gz的安装包(要找到httpd安装包的位置)

2cd 到 桌面    (软件包安到哪里就cd到哪里,只要解压到src下就可以了)

3、解压包:tar -zxvf httpd.2.2.27.tar.gz -C /usr/src

4cd /usr/src进入到src目录下

5、找到httpd-2.2.27 并进入目录下

6cd httpd-2.2.27/

7./configure       (预配置,看看配置如何)

8make

9make install

10service httpd restart

上面的9个步骤好了之后,会发现第10步报错,接下来就要,

源代码安装阿帕奇了:

 

一、将apachectl拷贝到/etc/rc.d/init.d/httpd //如果以前有安装过则直接覆盖

cp /usr/local/apache2/bin/apachectl    /etc/rc.d/init.d/httpd

二、建立符号链接

ln -s /etc/rc.d/init.d/httpd /etc/rc.d/rc5.d/S85httpd

三、检查Linux服务器列表中有没有httpd

chkconfig  --list

四、vi  /etc/rc.d/init.d/httpd 添加以下注释信息

# chkconfig: 345 85 15

# description:Activates/Deactivates Apache Web Server

五、将httpd添加到服务器列表当中

chkconfig --add httpd

六、检查Linux服务器列表中有没有httpd

chkconfig  --list httpd

七、重启httpd服务

service httpd restart会出以下提示:

httpd: apr_sockaddr_info_get() failed for asd

httpd: Could not reliably determine the server's fully qualified domain name,

using 127.0.0.1 for ServerName出现这些提示也能启动服务

八、出现这些提示的原因是因为/etc/hosts中的主机名称与/etc/sysconfig/network中设置的主机名称不同出现的

vim /etc/hosts    //hosts下的主机名称修改成与//etc/sysconfig/network中的主机名相同

127.0.0.1 localhost.localdomain and MYHOST//  /etc/hosts 中填入自己的主机名称 MYHOST

(就是在最后的单词后面改成自己的hostname