互联网无法通过 squid 启动

互联网无法通过 squid 启动

我安装了 squid 6.2。我从带有 ssl 的源代码构建了它。服务正常启动。有 2 个网卡。一个查看本地网络,另一个查看互联网。我使用手册从互联网上配置配置文件。执行 sudo squid -k reconfigure 和 sudo squid -k 命令后,输出如下

    2024/04/09 22:08:41| Processing Configuration File: /etc/squid/squid.conf (depth 0)
2024/04/09 22:08:41| Processing: acl localnet src 0.0.0.1-0.255.255.255 # RFC 1122 "this" network (LAN)
2024/04/09 22:08:41| Processing: acl localnet src 10.0.0.0/8            # RFC 1918 local private network (LAN)
2024/04/09 22:08:41| Processing: acl localnet src 100.64.0.0/10         # RFC 6598 shared address space (CGN)
2024/04/09 22:08:41| Processing: acl localnet src 169.254.0.0/16        # RFC 3927 link-local (directly plugged) machines
2024/04/09 22:08:41| Processing: acl localnet src 172.16.0.0/12         # RFC 1918 local private network (LAN)
2024/04/09 22:08:41| Processing: acl localnet src 192.168.0.0/24               # RFC 1918 local private network (LAN)
2024/04/09 22:08:41| Processing: acl localnet src fc00::/7              # RFC 4193 local private network range
2024/04/09 22:08:41| Processing: acl localnet src fe80::/10             # RFC 4291 link-local (directly plugged) machines
2024/04/09 22:08:41| Processing: acl SSL_ports port 443
2024/04/09 22:08:41| Processing: acl Safe_ports port 80         # http
2024/04/09 22:08:41| Processing: acl Safe_ports port 21         # ftp
2024/04/09 22:08:41| Processing: acl Safe_ports port 443                # https
2024/04/09 22:08:41| Processing: acl Safe_ports port 70         # gopher
2024/04/09 22:08:41| Processing: acl Safe_ports port 210                # wais
2024/04/09 22:08:41| Processing: acl Safe_ports port 1025-65535 # unregistered ports
2024/04/09 22:08:41| Processing: acl Safe_ports port 280                # http-mgmt
2024/04/09 22:08:41| Processing: acl Safe_ports port 488                # gss-http
2024/04/09 22:08:41| Processing: acl Safe_ports port 591                # filemaker
2024/04/09 22:08:41| Processing: acl Safe_ports port 777                # multiling http
2024/04/09 22:08:41| Processing: http_access deny !Safe_ports
2024/04/09 22:08:41| Processing: http_access deny CONNECT !SSL_ports
2024/04/09 22:08:41| Processing: http_access allow localhost manager
2024/04/09 22:08:41| Processing: http_access deny manager
2024/04/09 22:08:41| Processing: include /etc/squid/conf.d/*.conf
2024/04/09 22:08:41| Processing Configuration File: /etc/squid/conf.d/debian.conf (depth 1)
2024/04/09 22:08:41| Processing: logfile_rotate 0
2024/04/09 22:08:41| Processing: http_access allow localhost
2024/04/09 22:08:41| Processing: http_access allow localnet
2024/04/09 22:08:41| Processing: http_access allow all
2024/04/09 22:08:41| Processing: http_port 3130
2024/04/09 22:08:41| Processing: https_port 192.168.0.110:3129 intercept ssl-bump cert=/etc/squid/squidCA.pem generate-host-certificates=on dynamic_cert_mem_cache_size=4MB
2024/04/09 22:08:41| Starting Authentication on port 192.168.0.110:3129
2024/04/09 22:08:41| Disabling Authentication on port 192.168.0.110:3129 (interception enabled)
2024/04/09 22:08:41| Processing: http_port 192.168.0.110:3128 intercept
2024/04/09 22:08:41| Starting Authentication on port 192.168.0.110:3128
2024/04/09 22:08:41| Disabling Authentication on port 192.168.0.110:3128 (interception enabled)
2024/04/09 22:08:41| Processing: sslcrtd_program /usr/lib/squid/security_file_certgen -s /var/lib/squid/ssl_db -M 4MB
2024/04/09 22:08:41| Processing: acl step1 at_step SslBump1
2024/04/09 22:08:41| Processing: ssl_bump peek step1
2024/04/09 22:08:41| Processing: ssl_bump bump all
2024/04/09 22:08:41| Processing: ssl_bump splice all
2024/04/09 22:08:41| Processing: coredump_dir /var/spool/squid
2024/04/09 22:08:41| Processing: refresh_pattern ^ftp:          1440    20%    10080
2024/04/09 22:08:41| Processing: refresh_pattern ^gopher:       1440    0%     1440
2024/04/09 22:08:41| Processing: refresh_pattern -i (/cgi-bin/|\?) 0    0%     0
2024/04/09 22:08:41| Processing: refresh_pattern \/(Packages|Sources)(|\.bz2|\.gz|\.xz)$ 0 0% 0 refresh-ims
2024/04/09 22:08:41| Processing: refresh_pattern \/Release(|\.gpg)$ 0 0% 0 refresh-ims
2024/04/09 22:08:41| Processing: refresh_pattern \/InRelease$ 0 0% 0 refresh-ims
2024/04/09 22:08:41| Processing: refresh_pattern \/(Translation-.*)(|\.bz2|\.gz|\.xz)$ 0 0% 0 refresh-ims
2024/04/09 22:08:41| Processing: refresh_pattern .              0       20%    4320
2024/04/09 22:08:41| Requiring client certificates.
2024/04/09 22:08:41| Loaded signing certificate: /C=RU/ST=Moscow/L=Moscow/O=Internet Widgits Pty Ltd
2024/04/09 22:08:41| Not requiring any client certificates

命令 sudo squid -k reconfigure

2024/04/09 22:09:41| Processing Configuration File: /etc/squid/squid.conf (depth 0)
2024/04/09 22:09:41| Processing Configuration File: /etc/squid/conf.d/debian.conf (depth 1)
2024/04/09 22:09:41| Starting Authentication on port 192.168.0.110:3129
2024/04/09 22:09:41| Disabling Authentication on port 192.168.0.110:3129 (interception enabled)
2024/04/09 22:09:41| Starting Authentication on port 192.168.0.110:3128
2024/04/09 22:09:41| Disabling Authentication on port 192.168.0.110:3128 (interception enabled)
2024/04/09 22:09:41| ERROR: cannot change current directory to /var/spool/squid: (2) No such file or directory
2024/04/09 22:09:41| Current Directory is /home/nicolay
2024/04/09 22:09:41| FATAL: failed to open /var/run/squid.pid: (2) No such file or directory
    exception location: File.cc(191) open

所有证书均已生成。路径拼写正确。客户端机器上无法通过 https 访问 Internet。ping 成功。iptables 在 PREROUTING 和 INPUT 中具有端口转发规则,范围从 443 到 3129,从 80 到 3128。squid.config

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/24         # 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

http_port 3130
https_port 192.168.0.110:3129 intercept ssl-bump cert=/etc/squid/squidCA.pem generate-host-certificates=on dynamic_cert_mem_cache_size=4MB
http_port 192.168.0.110:3128 intercept

sslcrtd_program /usr/lib/squid/security_file_certgen -s /var/lib/squid/ssl_db -M 4MB

acl step1 at_step SslBump1

ssl_bump peek step1
ssl_bump bump all

ssl_bump splice all

请帮忙。我是 Linux 新手。无法读取 Squida 日志和缓存。互联网上的所有信息都不同,但都无济于事。清除缓存或手动创建 pi 文件等操作无济于事。当我安装 squid 5.7 时,我设法从存储库获取互联网,但通过 http 协议。配置相同。必须安装 squid 6.2,因为 squid 5.7 不想在我的计算机上编译。我认为这与源代码有关。机器在 ubuntu 服务器 22.04 上。我在虚拟机上使用它。

相关内容