欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

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

 更新時(shí)間:2019年03月15日 10:27:49   作者:小菜鳥(niǎo)有大夢(mèng)想  
這篇文章主要介紹了Centos7.4服務(wù)器安裝apache及安裝過(guò)程出現(xiàn)的問(wèn)題解決方法,結(jié)合實(shí)例形式分析了Centos7.4服務(wù)器安裝apache相關(guān)命令、配置操作及端口占用等常見(jiàn)問(wèn)題解決方法,需要的朋友可以參考下

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

一、安裝httpd

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

#rpm -qa | grep httpd

2. 使用yum安裝(自動(dòng)安裝依賴(lài)包),簡(jiǎn)單方便

#yum -y install httpd

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

#find / -name "httpd.conf"

4. 將找到的源配置文件備份一份,防止錯(cuò)誤后無(wú)法恢復(fù)

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

5. 啟動(dòng)Apache服務(wù)

#systemctl start httpd.service

6. 開(kāi)機(jī)自動(dòng)啟動(dòng)Apache服務(wù)

#systemctl enable httpd.service 開(kāi)機(jī)自啟httpd
#systemctl disable httpd.service 開(kāi)機(jī)不啟動(dòng)httpd

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

#systemctl status httpd.service

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

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

執(zhí)行命令,查看報(bào)錯(cuò)提示

#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.

問(wèn)題是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端口的進(jìn)程

② .kill -9 846

③ .若是前兩個(gè)方法不行的話(huà),則重啟后再啟動(dòng)httpd服務(wù)

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

① .進(jìn)入apache的配置文件

vi /etc/httpd/conf/httpd.conf

② ./ServerName 查找ServerName

#ServerName www.example.com:80

將其前面的#去掉

:wq保存并退出

③ .重啟服務(wù)

systemctl restart httpd.service

希望本文所述對(duì)大家CentOS服務(wù)器配置有所幫助。

相關(guān)文章

  • Centos 7.4服務(wù)器時(shí)間同步配置方法【基于NTP服務(wù)】

    Centos 7.4服務(wù)器時(shí)間同步配置方法【基于NTP服務(wù)】

    這篇文章主要介紹了Centos 7.4服務(wù)器時(shí)間同步配置方法,結(jié)合實(shí)例形式分析了NTP服務(wù)器安裝、啟動(dòng)、設(shè)置時(shí)間同步等相關(guān)命令及問(wèn)題解決方法,需要的朋友可以參考下
    2019-03-03
  • Linux下對(duì)各種壓縮文件的處理方法

    Linux下對(duì)各種壓縮文件的處理方法

    下面小編就為大家?guī)?lái)一篇Linux下對(duì)各種壓縮文件的處理方法。小編覺(jué)得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧,祝大家游戲愉快哦
    2016-12-12
  • centos8 安裝 nginx的詳細(xì)教程(圖文)

    centos8 安裝 nginx的詳細(xì)教程(圖文)

    Nginx是一個(gè)web服務(wù)器也可以用來(lái)做負(fù)載均衡及反向代理使用,目前使用最多的就是負(fù)載均衡,這篇文章主要介紹了centos8 安裝 nginx ,需要的朋友可以參考下
    2019-11-11
  • 通過(guò)yum升級(jí)CentOS/RHEL最小化安裝的方法

    通過(guò)yum升級(jí)CentOS/RHEL最小化安裝的方法

    下面小編就為大家?guī)?lái)一篇通過(guò)yum升級(jí)CentOS/RHEL最小化安裝的方法。小編覺(jué)得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧
    2016-12-12
  • 詳解Xampp和wordpress在Centos7上的搭建與使用

    詳解Xampp和wordpress在Centos7上的搭建與使用

    通過(guò)實(shí)例給大家詳細(xì)分析了Xampp和wordpress在Centos7上的搭建與使用,對(duì)此有需要的朋友可以學(xué)習(xí)下。
    2018-02-02
  • 將寶塔面板linux版裝在/www以外的目錄的方法

    將寶塔面板linux版裝在/www以外的目錄的方法

    很多云VPS系統(tǒng)盤(pán),也就是根目錄(系統(tǒng)盤(pán))都是10個(gè)G,寶塔安裝完整環(huán)境基本5個(gè)G沒(méi)有了,用了不到幾個(gè)月,隨著日志文件等亂七八糟的東西增加,面板就提示根目錄低于1個(gè)G,隨后mysql就莫名其妙掛掉,這里就為大家分享一下將面板安裝到別的目錄的方法
    2018-05-05
  • linux軟鏈接的創(chuàng)建、刪除和更新方式

    linux軟鏈接的創(chuàng)建、刪除和更新方式

    這篇文章主要介紹了linux軟鏈接的創(chuàng)建、刪除和更新方式,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2024-03-03
  • apache和mysql重啟命令

    apache和mysql重啟命令

    修改linux服務(wù)器的http配置之后,必須重啟Apache服務(wù)。
    2009-11-11
  • linux系統(tǒng)中rsync+inotify實(shí)現(xiàn)服務(wù)器之間文件實(shí)時(shí)同步

    linux系統(tǒng)中rsync+inotify實(shí)現(xiàn)服務(wù)器之間文件實(shí)時(shí)同步

    這篇文章主要介紹了rsync+inotify實(shí)現(xiàn)服務(wù)器之間文件實(shí)時(shí)同步,需要的朋友可以參考下
    2014-11-11
  • Linux用戶(hù)管理與常見(jiàn)權(quán)限命令

    Linux用戶(hù)管理與常見(jiàn)權(quán)限命令

    在Linux系統(tǒng)中,用戶(hù)和組是管理權(quán)限和資源訪(fǎng)問(wèn)的基本單元,用戶(hù)可以屬于一個(gè)或多個(gè)組,組用于集中管理一組用戶(hù)的權(quán)限,文件權(quán)限決定了用戶(hù)或組對(duì)文件的訪(fǎng)問(wèn)級(jí)別,每個(gè)文件或目錄都有三個(gè)權(quán)限集,分別適用于文件所有者(User)、所屬組(Group)和其他用戶(hù)(Others)
    2024-08-08

最新評(píng)論