我试图使用Squid作为一个简单的Web代理,但是,升级我的服务器到Ubuntu 17.04后,这已停止工作。
我禁用了ufw,所以防火墙不是问题。 我可以telnet其他端口,并通过ssh连接,所以我可以清楚地与服务器通信。 除此之外,一个telnet localhost 3128工作得很好,但外部的一个被丢弃。
我的squid.conf :
acl SSL_ports port 443 acl CONNECT method CONNECT cache_peer {redacted company filtering server} parent 80 0 no-query default never_direct allow all http_access allow all #http_access deny !Safe_ports http_access deny CONNECT !SSL_ports http_access allow localnet localhost manager http_access deny manager http_access allow localhost http_access deny all http_port 127.0.0.1:3128 coredump_dir /var/spool/squid refresh_pattern ^ftp: 1440 20% 10080 refresh_pattern ^gopher: 1440 0% 1440 refresh_pattern -i (/cgi-bin/|\?) 0 0% 0 refresh_pattern (Release|Packages(.gz)*)$ 0 20% 2880 refresh_pattern . 0 20% 4320
netstat -plnt的结果:
Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 2222/sshd tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1108/cupsd tcp 0 0 0.0.0.0:445 0.0.0.0:* LISTEN 1307/smbd tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 2061/mysqld tcp 0 0 0.0.0.0:5355 0.0.0.0:* LISTEN 1627/systemd-resolv tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN 1307/smbd tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1699/nginx: master tcp6 0 0 :::22 :::* LISTEN 2222/sshd tcp6 0 0 ::1:631 :::* LISTEN 1108/cupsd tcp6 0 0 :::3000 :::* LISTEN 2204/gitea tcp6 0 0 :::445 :::* LISTEN 1307/smbd tcp6 0 0 :::5355 :::* LISTEN 1627/systemd-resolv tcp6 0 0 :::139 :::* LISTEN 1307/smbd tcp6 0 0 :::80 :::* LISTEN 1699/nginx: master
telnet localhost 3128结果:
seeng@GITServ:~$ telnet localhost 3128 Trying ::1... Trying 127.0.0.1... Connected to localhost. Escape character is '^]'.
来自远程机器的telnet {hostIP} 3128结果:
PS C:\Users\James.Hughes> telnet {hostIP} 3128 Connecting To 10.230.48.93...Could not open connection to the host, on port 3128: Connect failed
该服务器只能从公司networking内访问,但是,通过cache peer访问互联网。 所以基本上我想要任何可以连接到这个服务器的计算机被代理到升级之前工作的caching对等体(然后把它发送到WWW),不用担心安全或访问问题。
有任何想法吗?
我可以在您的post中看到两个问题。 首先,从netstat的输出可以看出,squid似乎没有运行或者正在监听3128端口。 3128端口没有监听进程。
另一个问题是你的squidconfiguration定义http_port为:
http_port 127.0.0.1:3128
这意味着它只会侦听回送接口,所以没有任何连接来自本地主机以外的任何主机。
问题是使用127.0.0.1:3128作为http_port指令的一部分。
如果我改变只是3128它工作得很好。 我想这只是监听本地端口上的连接。