Squid は「sudo」で実行した場合にのみ機能します。

Squid は「sudo」で実行した場合にのみ機能します。

squid可能なプロキシインスタンスを実行したいです。ただし、squidがsudoで始まっている場合にのみ接続できます。イカの構成には次のものがあります。

access_log none
cache_store_log none
cache_log /dev/null
$ squid -n squida -f /tmp/squid_80fm8klt.conf                                                                                                              
$ curl --proxy http://localhost:3129  https://httpbin.org/ip                                                                                                   
curl: (7) Failed to connect to localhost port 3129: Connection refused
$ sudo squid -n squida -f /tmp/squid_80fm8klt.conf                                                                                                         
WARNING: Cannot write log file: none
none: Permission denied
         messages will be sent to 'stderr'.
$ curl --proxy http://localhost:3129  https://httpbin.org/ip                                                                                                     
{
  "origin": "92.119.18.XX"
}

私はFedora 32システムを使用しています。

全体構成:

http_access allow all

coredump_dir /var/spool/squid3

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

access_log none
cache_store_log none
cache_log /dev/null

never_direct allow all
cache_peer zzz.nordvpn.com parent 89 3130 tls login=xXx:yYy
http_port 3129

ベストアンサー1

@muruが述べたように走るsquid -N -d 1イカショー

2021/07/27 03:20:12| FATAL: failed to open /run/squid.pid: (13) Permission denied
    exception location: File.cc(190) open

解決策は、pidfileを別のディレクトリに入れたり作成したりしないことです。http://www.squid-cache.org/Doc/config/pid_filename/ これを設定に入れます。

pid_filename none

おすすめ記事