[squid-users] SQUID refuses to listen on any TCP Port

苏 格 freefallbenson at hotmail.com
Thu Mar 3 13:58:34 UTC 2022



here is the default config

#
# Recommended minimum configuration:
#

# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
acl localnet src 0.0.0.1-0.255.255.255  # RFC 1122 "this" network (LAN)
acl localnet src 10.0.0.0/8             # RFC 1918 local private network (LAN)
acl localnet src 100.64.0.0/10          # RFC 6598 shared address space (CGN)
acl localnet src 169.254.0.0/16         # RFC 3927 link-local (directly plugged) machines
acl localnet src 172.16.0.0/12          # RFC 1918 local private network (LAN)
acl localnet src 192.168.0.0/16         # RFC 1918 local private network (LAN)
acl localnet src fc00::/7               # RFC 4193 local private network range
acl localnet src fe80::/10              # RFC 4291 link-local (directly plugged) machines

acl SSL_ports port 443
acl Safe_ports port 80          # http
acl Safe_ports port 21          # ftp
acl Safe_ports port 443         # https
acl Safe_ports port 70          # gopher
acl Safe_ports port 210         # wais
acl Safe_ports port 1025-65535  # unregistered ports
acl Safe_ports port 280         # http-mgmt
acl Safe_ports port 488         # gss-http
acl Safe_ports port 591         # filemaker
acl Safe_ports port 777         # multiling http
acl CONNECT method CONNECT

#
# Recommended minimum Access Permission configuration:
#
# Deny requests to certain unsafe ports
http_access deny !Safe_ports

# Deny CONNECT to other than secure SSL ports
http_access deny CONNECT !SSL_ports

# Only allow cachemgr access from localhost
http_access allow localhost manager
http_access deny manager

# We strongly recommend the following be uncommented to protect innocent
# web applications running on the proxy server who think the only
# one who can access services on "localhost" is a local user
#http_access deny to_localhost

#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
#

# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed
http_access allow localnet
http_access allow localhost

# And finally deny all other access to this proxy
http_access deny all

# Squid normally listens to port 3128
http_port 3128

# Uncomment and adjust the following to add a disk cache directory.
#cache_dir ufs /var/cache/squid 100 16 256

# Leave coredumps in the first cache dir
coredump_dir /var/cache/squid

#
# Add any of your own refresh_pattern entries above these.
#
refresh_pattern ^ftp:           1440    20%     10080
refresh_pattern ^gopher:        1440    0%      1440
refresh_pattern -i (/cgi-bin/|\?) 0     0%      0
refresh_pattern .               0       20%     4320

Hi,

I tried using the default config. No difference

2022/03/03 21:49:17 kid1| Set Current Directory to /var/cache/squid
2022/03/03 21:49:17 kid1| Starting Squid Cache version 4.17 for x86_64-pc-linux-gnu...
2022/03/03 21:49:17 kid1| Service Name: squid
2022/03/03 21:49:17 kid1| Process ID 382776
2022/03/03 21:49:17 kid1| Process Roles: worker
2022/03/03 21:49:17 kid1| With 1024 file descriptors available
2022/03/03 21:49:17 kid1| Initializing IP Cache...
2022/03/03 21:49:17 kid1| DNS Socket created at [::], FD 5
2022/03/03 21:49:17 kid1| DNS Socket created at 0.0.0.0, FD 8
2022/03/03 21:49:17 kid1| Adding nameserver 8.8.8.8 from /etc/resolv.conf
2022/03/03 21:49:17 kid1| Logfile: opening log daemon:/var/log/access.log
2022/03/03 21:49:17 kid1| Logfile Daemon: opening log /var/log/access.log
2022/03/03 21:49:17 kid1| Local cache digest enabled; rebuild/rewrite every 3600/3600 sec
2022/03/03 21:49:17 kid1| Store logging disabled
2022/03/03 21:49:17 kid1| Swap maxSize 0 + 262144 KB, estimated 20164 objects
2022/03/03 21:49:17 kid1| Target number of buckets: 1008
2022/03/03 21:49:17 kid1| Using 8192 Store buckets
2022/03/03 21:49:17 kid1| Max Mem  size: 262144 KB
2022/03/03 21:49:17 kid1| Max Swap size: 0 KB
2022/03/03 21:49:17 kid1| Using Least Load store dir selection
2022/03/03 21:49:17 kid1| Set Current Directory to /var/cache/squid
2022/03/03 21:49:17 kid1| Finished loading MIME types and icons.
2022/03/03 21:49:17 kid1| HTCP Disabled.

netstat -tunpal shows
 netstat -tunpal | grep squid
udp        0      0 0.0.0.0:21638           0.0.0.0:*                           382776/(squid-1)
udp6       0      0 ::1:40383               ::1:50900               ESTABLISHED 382776/(squid-1)
udp6       0      0 ::1:50900               ::1:40383               ESTABLISHED 382776/(squid-1)
udp6       0      0 :::15633                :::*                                382776/(squid-1)

On 3/03/22 14:48, ben wrote:
> Hi,Alex,
>
>
> Thanks for your help. I run squid with the option d1 and its output is
> as followings
> 2022/03/03 09:17:39 kid1| Current Directory is /root
> 2022/03/03 09:17:39 kid1| Starting Squid Cache version 4.17 for
> x86_64-pc-linux-gnu...
> 2022/03/03 09:17:39 kid1| Service Name: squid
> 2022/03/03 09:17:39 kid1| Process ID 239617
> 2022/03/03 09:17:39 kid1| Process Roles: worker
> 2022/03/03 09:17:39 kid1| With 1024 file descriptors available
> 2022/03/03 09:17:39 kid1| Initializing IP Cache...
> 2022/03/03 09:17:39 kid1| DNS Socket created at [::], FD 5
> 2022/03/03 09:17:39 kid1| DNS Socket created at 0.0.0.0, FD 8
> 2022/03/03 09:17:39 kid1| Adding nameserver 8.8.8.8 from /etc/resolv.conf
> 2022/03/03 09:17:39 kid1| Logfile: opening log
> daemon:/var/log/squid/access.log
> 2022/03/03 09:17:39 kid1| Logfile Daemon: opening log
> /var/log/squid/access.log
> 2022/03/03 09:17:39 kid1| Local cache digest enabled; rebuild/rewrite
> every 3600/3600 sec
> 2022/03/03 09:17:39 kid1| Store logging disabled
> 2022/03/03 09:17:39 kid1| Swap maxSize 0 + 262144 KB, estimated 20164
> objects
> 2022/03/03 09:17:39 kid1| Target number of buckets: 1008
> 2022/03/03 09:17:39 kid1| Using 8192 Store buckets
> 2022/03/03 09:17:39 kid1| Max Mem  size: 262144 KB
> 2022/03/03 09:17:39 kid1| Max Swap size: 0 KB
> 2022/03/03 09:17:39 kid1| Using Least Load store dir selection
> 2022/03/03 09:17:39 kid1| Current Directory is /root
> 2022/03/03 09:17:39 kid1| Finished loading MIME types and icons.
> 2022/03/03 09:17:39 kid1| HTCP Disabled.
>
> the only line in squid.conf is http_port 3128


That itself could be the problem.

Please at least use the default config file shown in
<https://wiki.squid-cache.org/Squid-4>, or better use the squid.conf
file built with your custom binary.



Cheers
Amos
_______________________________________________
squid-users mailing list
squid-users at lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squid-cache.org/pipermail/squid-users/attachments/20220303/b47a2565/attachment-0001.htm>


More information about the squid-users mailing list