Squid
在server上面安装squid的过程很简单。
yum install squid
然后启动squid:
service squid start
再查看是否运行:
$ service squid status
Redirecting to /bin/systemctl status squid.service
● squid.service - Squid caching proxy
Loaded: loaded (/usr/lib/systemd/system/squid.service; disabled; vendor preset: disabled)
Active: active (running) since Tue 2022-01-04 14:26:36 CST; 5s ago
Process: 10368 ExecStart=/usr/sbin/squid $SQUID_OPTS -f $SQUID_CONF (code=exited, status=0/SUCCESS)
Process: 10362 ExecStartPre=/usr/libexec/squid/cache_swap.sh (code=exited, status=0/SUCCESS)
Main PID: 10371 (squid)
Tasks: 3
Memory: 13.5M
CGroup: /system.slice/squid.service
├─10371 /usr/sbin/squid -f /etc/squid/squid.conf
├─10373 (squid-1) -f /etc/squid/squid.conf
└─10374 (logfile-daemon) /var/log/squid/access.log
Jan 04 14:26:36 iZj6c45po7f4v416r8l94nZ systemd[1]: Starting Squid caching proxy...
Jan 04 14:26:36 iZj6c45po7f4v416r8l94nZ squid[10371]: Squid Parent: will start 1 kids
Jan 04 14:26:36 iZj6c45po7f4v416r8l94nZ squid[10371]: Squid Parent: (squid-1) process 10373 started
Jan 04 14:26:36 iZj6c45po7f4v416r8l94nZ systemd[1]: Started Squid caching proxy.
再查看port是否在监听中:
$ netstat -lntpo | grep 312
tcp6 0 0 :::3128 :::* LISTEN 9016/(squid-1) off (0.00/0/0)
发现只有IPV6,没有IPV4的监听。这可怎么办?在网上搜索,发现需要修改squid的配置文件:
vim /etc/squid/squid.conf
找到http_port行,将http_port 3128改为如下:
# Squid normally listens to por