apache的配置

一、軟件環境
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的配置

關於在運行時出問題:
[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 把這一行追加到結尾。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章