アプリ版:「スタンプのみでお礼する」機能のリリースについて

Centos6.5の環境で、プロキシサーバーとしてSquidを使用しています。クライアントPCにはプロキシ設定をしてIEの閲覧が自由にできる状態です。

例えば、www.facebook.comの閲覧制限をしたいため、vi /etc/squid/squid.conf 内にacl denydomain dstdomain www.facebook.com を追加して、/etc/rc.d/init.d/squid のrestartを実行しましたが、クライアントPCから普通に見れています。何がいけないのでしょうか。squid.confの記載内容は以下のとおりです。 よろしくお願いします。

#
# Recommended minimum configuration:
#
acl manager proto cache_object
acl localhost src 127.0.0.1/32 ::1
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1

# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
acl localnet src 172.16.0.0/12 # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
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 # from where browsing should be allowed
http_access allow localnet
http_access allow localhost
http_access allow lan

# And finally deny all other access to this proxy
http_access deny all
acl denydomain dstdomain www.facebook.com

# Squid normally listens to port 3128
http_port 8080

# We recommend you to use at least the following line.
hierarchy_stoplist cgi-bin ?

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

# Leave coredumps in the first cache dir
coredump_dir /var/spool/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

request_header_access Referer deny all
request_header_access X-Forwarded-For deny all
request_header_access Via deny all
request_header_access Cache-Control deny all

visible_hostname prox.hogehoge.jp
forwarded_for off

A 回答 (2件)

http_access は上から順に評価されるのでこんな感じになるのでは。



(前略)
acl denydomain dstdomain www.facebook.com
http_access deny denydomain
http_access allow localnet
http_access allow localhost
http_access allow lan
# And finally deny all other access to this proxy
http_access deny all

allow localnetとallow lanの設定の意図がよくわからないので何とも言えませんが、
こちらの方がよりいいかもです。

http_access allow localhost
http_access deny denydomain
http_access allow localnet
http_access allow lan
# And finally deny all other access to this proxy
http_access deny all
    • good
    • 0
この回答へのお礼

ご回答いただき、ありがとうございます。

ご指摘どおり入力したところ、うまく動作しました。
順番が重要だったんですね。

ありがとうございました。

お礼日時:2014/09/09 21:40

http_access deny all


acl denydomain dstdomain www.facebook.com


の部分を

acl denydomain dstdomain www.facebook.com
http_access deny denydomain
http_access deny all

にしてみてください。
    • good
    • 0
この回答へのお礼

ご回答いただき、ありがとうございます。

ご指摘どおり、smtpd.confに同じ内容を記述してsquidを再起動しましたが、閲覧できてしまいました。 squid.conf内に記述する位置が悪いのでしょうか。一応、最終行に追加したのですが。

あまり関係ないことかもしれませんが、IEの設定は「LANにプロキシの設定をする」にチェックをいれ、ローカルアドレス:192.168.1.10 ポート:8080、「ローカルアドレスにはプロキシを設定しない」にチェックを入れています。 勿論、「設定を自動検出・・・」、「自動構成スクリプト・・・」のチェックは外してあります。

お礼日時:2014/09/09 01:30

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!