「squid」の設定、起動をします。
(1)「squid」の設定をする。
[root@example ~]# cd /etc/squid/ [root@example squid]# cp squid.conf squid.conf.ori [root@example squid]# vi squid.conf acl localnet src 192.168.0.0/16 # RFC1918 possible internal network ↓ # 変更 or 追加(環境に合わせて設定してください) acl localnet src 192.168.1.0/16 # RFC1918 possible internal network http_port 3128 ↓ # 変更(squidの待ち受けポート) http_port 8080 #--一番最後の行にでも追加--# # X-Forwarded-For(外部に内部LANのIPアドレス情報を載せない) forwarded_for off # hostname(proxyサーバのホスト名) visible_hostname example.local
ここでは、簡単な設定しかしていません。
詳しい設定は下記アドレスに記載されており参考になります。
squidの設定について
http://www.squid-cache.org/Doc/config/
http://squid.robata.org/
(2)「squid」を起動する。
[root@example ~]# /etc/rc.d/init.d/squid start squid を起動中: . [ OK ] [root@example ~]# ps aux | grep squid root 1895 0.0 0.2 68440 2856 ? Ss 17:00 0:00 squid -f /etc/squid/squid.conf squid 1898 0.3 0.9 71424 9828 ? S 17:00 0:00 (squid) -f /etc/squid/squid.conf squid 1900 0.0 0.1 19992 1060 ? S 17:00 0:00 (unlinkd) root 1903 0.0 0.0 107364 920 pts/0 S+ 17:00 0:00 grep squid [root@example ~]# lsof -i:8080 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME squid 1898 squid 10u IPv6 14516 0t0 TCP *:webcache (LISTEN)
※「squid」が起動して8080ポートで待ち受けていること