一叶知秋.

业精于勤,荒于嬉;行成于思,毁于随。

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)    
posted @ 2020-09-08 21:37  ccku  阅读(1323)  评论(0编辑  收藏  举报