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
No.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
ご回答いただき、ありがとうございます。
ご指摘どおり入力したところ、うまく動作しました。
順番が重要だったんですね。
ありがとうございました。
No.1
- 回答日時:
http_access deny all
acl denydomain dstdomain www.facebook.com
の部分を
acl denydomain dstdomain www.facebook.com
http_access deny denydomain
http_access deny all
にしてみてください。
ご回答いただき、ありがとうございます。
ご指摘どおり、smtpd.confに同じ内容を記述してsquidを再起動しましたが、閲覧できてしまいました。 squid.conf内に記述する位置が悪いのでしょうか。一応、最終行に追加したのですが。
あまり関係ないことかもしれませんが、IEの設定は「LANにプロキシの設定をする」にチェックをいれ、ローカルアドレス:192.168.1.10 ポート:8080、「ローカルアドレスにはプロキシを設定しない」にチェックを入れています。 勿論、「設定を自動検出・・・」、「自動構成スクリプト・・・」のチェックは外してあります。
お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!
似たような質問が見つかりました
- その他(SNS・コミュニケーションサービス) 自分のpcがハッキングされたようなメールが来たのですがどうすればいいですか? 4 2022/10/02 16:14
- MySQL 参考書に従って入力したつもりでしたが、最後はエラーがでました。 1 2022/09/28 03:45
- X(旧Twitter) Hello, We received your appeal regarding your acco 1 2022/09/12 03:57
- オープンソース Flaskでサーバー立ち上げに関して 1 2023/08/12 21:02
- その他(プログラミング・Web制作) mariadbでのエラー 1 2022/11/15 12:31
- UNIX・Linux postfix smtpサーバーリレーがTLSハンドシェーク失敗 1 2022/08/15 15:45
- Google 翻訳 【大至急】Hellotalk公式からメール 2 2022/04/17 17:24
- 英語 The Twilight Zone1959に関するCBSの回答について 1 2023/03/02 15:13
- YouTube youtubeからの著作権メールについて 2 2023/02/14 16:12
- 公的扶助・生活保護 保証人? 1 2022/05/17 22:42
関連するカテゴリからQ&Aを探す
おすすめ情報
デイリーランキングこのカテゴリの人気デイリーQ&Aランキング
-
ciscoのASA機のアクセスリスト...
-
access SQLビューの文字の大き...
-
Googleドライブで全く知らない...
-
現在Macプロを使用しているので...
-
outlookでadobepdfファイルが送...
-
社内の方に飲み会の複数動画を...
-
パワポの共同編集がしたいので...
-
大人数の作業においてエクセル...
-
iosでapk!?
-
Outlookの添付ファイル欄を広げ...
-
outlookのフォルダの順番の並べ...
-
jpeg画像をより小さく圧縮する...
-
写真に番号をふる
-
office - 添付ファイルを添付し...
-
Lotus Notes 6.5 メールのエク...
-
Cドライブ直下のフォルダが再起...
-
見覚えの無いフォルダが勝手に...
-
WindowsLiveMailの添付が開けない
-
NotesのビューをEXCELシートに...
-
ISO-2022-JPという名の添付ファ...
マンスリーランキングこのカテゴリの人気マンスリーQ&Aランキング
-
ポート指定でプロキシ(squid)...
-
ciscoのASA機のアクセスリスト...
-
startxうまいくいかない。
-
MIBの取得ができません
-
インストールされているのに「...
-
Hello, We received your appea...
-
Apache 逆引きできないホストか...
-
squid ある特定のドメインから...
-
グランディ21のアクセス
-
北翔大学から大麻駅まで徒歩で...
-
cisco アクセスリストの設定に...
-
イベントビューアのエラーについて
-
CiscoスイッチのVLANにFTPとNTP...
-
サーバーが落ちてしまう原因に...
-
Linuxについて質問です。 acces...
-
広告を見ているのですが意味が...
-
京都駅近くのロールアイスって...
-
アクセスのセル(列)の並び替え
-
Postfix で Relay access denied
-
Googleドライブで全く知らない...
おすすめ情報