濮阳杆衣贸易有限公司

主頁 > 知識庫 > Centos7.4服務器安裝apache及安裝過程出現(xiàn)的問題解決方法

Centos7.4服務器安裝apache及安裝過程出現(xiàn)的問題解決方法

熱門標簽:物超所值的400電話申請 coreldraw地圖標注 百應電銷機器人靠譜嗎 申請400電話號碼多少錢 遼寧電銷平臺外呼系統(tǒng)軟件 菏澤crm外呼系統(tǒng)價格 如何在各種地圖標注自己的地址 信陽銷售外呼系統(tǒng)招商 營銷電銷機器人招商

本文實例講述了Centos7.4服務器安裝apache及安裝過程出現(xiàn)的問題解決方法。分享給大家供大家參考,具體如下:

一、安裝httpd

1. 安裝之前,先查看系統(tǒng)中是否存在已經(jīng)安裝了的httpd.rpm包,如果,沒有就是沒安裝,有的話rpm -e 對應的rpm包名進行刪除

#rpm -qa | grep httpd

2. 使用yum安裝(自動安裝依賴包),簡單方便

#yum -y install httpd

3. 安裝成功后,httpd-v 查看安裝的apache版本,查找apache的配置文件位置

#find / -name "httpd.conf"

4. 將找到的源配置文件備份一份,防止錯誤后無法恢復

#cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.bak

5. 啟動Apache服務

#systemctl start httpd.service

6. 開機自動啟動Apache服務

#systemctl enable httpd.service 開機自啟httpd
#systemctl disable httpd.service 開機不啟動httpd

7. 查看httpd的狀態(tài)

#systemctl status httpd.service

二、安裝過程出現(xiàn)的問題

1. Apache啟動失敗,Job for httpd.service failed because the control process exited with error code. See “systemctl status httpd.service” and “journalctl -xe” for details

執(zhí)行命令,查看報錯提示

#systemctl status httpd.service

[root@cloud1 bin]# systemctl status httpd.service
  httpd.service - The Apache HTTP Server
  Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
  Active: failed (Result: exit-code) since 五 2018-11-26 11:13:09 CST; 6min ago
   Docs: man:httpd(8)
      man:apachectl(8)
 Process: 9915 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
 Process: 9913 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
 Main PID: 9913 (code=exited, status=1/FAILURE)
11月 26 11:13:09 cloud1.localdomain httpd[9913]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
11月 26 11:13:09 cloud1.localdomain httpd[9913]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
11月 26 11:13:09 cloud1.localdomain httpd[9913]: no listening sockets available, shutting down
11月 26 11:13:09 cloud1.localdomain httpd[9913]: AH00015: Unable to open logs
11月 26 11:13:09 cloud1.localdomain systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
11月 26 11:13:09 cloud1.localdomain kill[9915]: kill: cannot find process ""
11月 26 11:13:09 cloud1.localdomain systemd[1]: httpd.service: control process exited, code=exited status=1
11月 26 11:13:09 cloud1.localdomain systemd[1]: Failed to start The Apache HTTP Server.
11月 26 11:13:09 cloud1.localdomain systemd[1]: Unit httpd.service entered failed state.
11月 26 11:13:09 cloud1.localdomain systemd[1]: httpd.service failed.

問題是80端口被占用

解決辦法:

查看80端口的使用情況

① .netstat -lnp|grep 80

tcp        0      0 192.168.180.68:61027        0.0.0.0:*                   LISTEN      6289/oproxyd
tcp        0      0 :::80                       :::*                        LISTEN      846/httpd
tcp        0      0 ::ffff:192.168.180.68:7001 :::*                        LISTEN      32015/java

殺掉占用80端口的進程

② .kill -9 846

③ .若是前兩個方法不行的話,則重啟后再啟動httpd服務

2.Apache啟動失敗,httpd:httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName

① .進入apache的配置文件

vi /etc/httpd/conf/httpd.conf

② ./ServerName 查找ServerName

#ServerName www.example.com:80

將其前面的#去掉

:wq保存并退出

③ .重啟服務

systemctl restart httpd.service

希望本文所述對大家CentOS服務器配置有所幫助。

標簽:瀘州 江西 廈門 玉樹 內(nèi)江 泰安 湖北 江門

巨人網(wǎng)絡通訊聲明:本文標題《Centos7.4服務器安裝apache及安裝過程出現(xiàn)的問題解決方法》,本文關鍵詞  Centos7.4,服務器,安裝,apache,;如發(fā)現(xiàn)本文內(nèi)容存在版權問題,煩請?zhí)峁┫嚓P信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《Centos7.4服務器安裝apache及安裝過程出現(xiàn)的問題解決方法》相關的同類信息!
  • 本頁收集關于Centos7.4服務器安裝apache及安裝過程出現(xiàn)的問題解決方法的相關信息資訊供網(wǎng)民參考!
  • 推薦文章
    大邑县| 垫江县| 巴彦县| 晋江市| 泉州市| 巴中市| 楚雄市| 观塘区| 桂林市| 绿春县| 科尔| 通海县| 天全县| 汾西县| 利川市| 霸州市| 临颍县| 博客| 天津市| 芜湖市| 岳普湖县| 吉安市| 松滋市| 兴山县| 达日县| 长寿区| 泾阳县| 龙口市| 苍山县| 青岛市| 于都县| 泗水县| 杭锦后旗| 棋牌| 武胜县| 平顶山市| 扎鲁特旗| 改则县| 曲松县| 周宁县| 丹凤县|