service squid start啟動失敗:Starting squid: .................... [FAILED]


問題描述:
squid配置反向代理模式后,啟動報錯:

[root@019 squid]# service squid start
Starting squid: ....................                       [FAILED]

檢查配置文件:

http_access allow all

# Squid normally listens to port 3128
http_port 20.20.20.19:80 vhost
visible_hostname 019
cache_peer 10.10.10.18 parent 80 0 originserver round-robin
cache_peer 10.10.10.20 parent 80 0 originserver round-robin

查看服務和監聽的端口信息

[root@019 squid]# netstat -anpt
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name   
tcp        0      0 0.0.0.0:5901                0.0.0.0:*                   LISTEN      2007/Xvnc           
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN      1665/rpcbind        
tcp        0      0 0.0.0.0:54192               0.0.0.0:*                   LISTEN      1708/rpc.statd      
tcp        0      0 0.0.0.0:6001                0.0.0.0:*                   LISTEN      2007/Xvnc           
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      1905/sshd           
tcp        0      0 127.0.0.1:631               0.0.0.0:*                   LISTEN      1743/cupsd          
tcp        0      0 127.0.0.1:6010              0.0.0.0:*                   LISTEN      2387/sshd           
tcp        0      0 127.0.0.1:6011              0.0.0.0:*                   LISTEN      2387/sshd           
tcp        0     64 10.10.10.19:22              10.10.10.1:57572            ESTABLISHED 2387/sshd           
tcp        0      0 :::111                      :::*                        LISTEN      1665/rpcbind        
tcp        0      0 :::80                       :::*                        LISTEN      2925/httpd    

發現80端口被httpd服務占用

解決辦法:
關閉httpd服務,並禁止httpd服務開機自啟

[root@019 squid]# service httpd stop
Stopping httpd:                                            [  OK  ]
[root@019 squid]# chkconfig httpd off

啟動squid服務驗證:

[root@019 squid]# service squid start
Starting squid: .                                          [  OK  ]
[root@019 squid]# netstat -anpt |grep squid
tcp        0      0 20.20.20.19:80              0.0.0.0:*                   LISTEN      3054/(squid)    


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM