欧美成人午夜免费全部完,亚洲午夜福利精品久久,а√最新版在线天堂,另类亚洲综合区图片小说区,亚洲欧美日韩精品色xxx

扣丁學(xué)堂Linux培訓(xùn)之Centos7.4服務(wù)器安裝apache及安裝過(guò)程出現(xiàn)的問(wèn)題解決方法

2019-04-30 14:16:14 2492瀏覽

今天扣丁學(xué)堂Linux培訓(xùn)老師給大家分享一篇關(guān)于Centos7.4服務(wù)器安裝apache及安裝過(guò)程出現(xiàn)的問(wèn)題解決方法,結(jié)合實(shí)例形式分析了Centos7.4服務(wù)器安裝apache相關(guān)命令、配置操作及端口占用等常見(jiàn)問(wèn)題解決方法,分享給大家供大家參考,具體如下:



一、安裝httpd

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

#rpm -qa | grep httpd

2.使用yum安裝(自動(dòng)安裝依賴包),簡(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)失敗,Jobforhttpd.servicefailedbecausethecontrolprocessexitedwitherrorcode.See“systemctlstatushttpd.service”and“journalctl-xe”fordetails

執(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|grep80

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-9846

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

2.Apache啟動(dòng)失敗,httpd:httpd:Couldnotreliablydeterminetheserver'sfullyqualifieddomainname,usinglocalhost.localdomainforServerName

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

vi /etc/httpd/conf/httpd.conf

②./ServerName查找ServerName

#ServerName www.example.com:80

將其前面的#去掉

:wq保存并退出

③.重啟服務(wù)

systemctl restart httpd.service

以上就是關(guān)于扣丁學(xué)堂Linux培訓(xùn)之Centos7.4服務(wù)器安裝apache及安裝過(guò)程出現(xiàn)的問(wèn)題解決方法的詳細(xì)介紹,想要了解更多關(guān)于Linux開(kāi)發(fā)方面內(nèi)容的小伙伴,請(qǐng)關(guān)注扣丁學(xué)堂Linux培訓(xùn)官網(wǎng)、微信等平臺(tái),扣丁學(xué)堂IT職業(yè)在線學(xué)習(xí)教育有專業(yè)的Linux講師為您指導(dǎo),此外扣丁學(xué)堂老師精心推出的Linux視頻教程定能讓你快速掌握Linux從入門(mén)到精通開(kāi)發(fā)實(shí)戰(zhàn)技能??鄱W(xué)堂Linux技術(shù)交流群:422345477。


                          【掃碼進(jìn)入HTML5VIP免費(fèi)公開(kāi)課】  


     【關(guān)注微信公眾號(hào)獲取更多學(xué)習(xí)資料】        【掃碼進(jìn)入HTML5前端開(kāi)發(fā)VIP免費(fèi)公開(kāi)課】



查看更多關(guān)于“Linux培訓(xùn)資訊”的相關(guān)文章>>

標(biāo)簽: Linux培訓(xùn) Linux視頻教程 紅帽Linux視頻 Linux學(xué)習(xí)視頻 Linux入門(mén)視頻

熱門(mén)專區(qū)

暫無(wú)熱門(mén)資訊

課程推薦

微信
微博
15311698296

全國(guó)免費(fèi)咨詢熱線

郵箱:codingke@1000phone.com

官方群:148715490

北京千鋒互聯(lián)科技有限公司版權(quán)所有   北京市海淀區(qū)寶盛北里西區(qū)28號(hào)中關(guān)村智誠(chéng)科創(chuàng)大廈4層
京ICP備2021002079號(hào)-2   Copyright ? 2017 - 2022
返回頂部 返回頂部