一、软件环境
1、系统:CentOS release 6.5 (Final)
2、apache:httpd-2.2.34.tar.gz
3、防火墙是关闭的
二、安装过程
[root@rsync ~]#wget http://mirrors.shuosc.org/apache/httpd/httpd-2.2.34.tar.gz
[root@rsync ~]#tar xf httpd-2.2.34.tar.gz
[root@rsync ~]#cd httpd-2.2.34
[root@rsync httpd-2.2.34]#./configure --prefix=/usr/local/apache
[root@rsync httpd-2.2.34]#make &&make install
[root@rsync httpd-2.2.34]#ln -s /usr/local/apache/ /application/tools/

以上基本安装完成。
三,启动apache
[root@rsync httpd-2.2.34]# /application/tools/apache/bin/apachectl -t
Syntax OK
[root@rsync tools]# /application/tools/apache/bin/apachectl start
httpd (pid 25138) already running

三、测试apache安装是否成功
[root@rsync apache]# wget 10.10.10.23
--2017-12-18 23:32:42-- http://10.10.10.23/
Connecting to 10.10.10.23:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 44 [text/html]
Saving to: “index.html”

100%[========================================================================================>] 44 --.-K/s in 0s

2017-12-18 23:32:42 (11.2 MB/s) - “index.html” saved [44/44]
测试连接成功。
在页中输入 IP地址和端口:
apache的配置_第1张图片

关于在运行时出问题:
[root@rsync bin]# ./apachectl restart
httpd: apr_sockaddr_info_get() failed for rsync
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
解决办法:
[root@rsync]# vi /etc/hosts #在后面追加这下面这一行
10.10.10.23 localhost.localdomain localhost rsync #rsync 这个是主机名
[root@rsync conf]# vi /usr/local/apache/conf/ httpd.conf
ServerName localhost:80 把这一行追加到结尾。