質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Squid

Squidは、TCP/IPネットワークでのユーザーとサーバの通信を中継するオープンソースのプロキシサーバソフト。リバースプロキシやキャッシュサーバとして使用することも可能です。

Linux

Linuxは、Unixをベースにして開発されたオペレーティングシステムです。日本では「リナックス」と呼ばれています。 主にWebサーバやDNSサーバ、イントラネットなどのサーバ用OSとして利用されています。 上位500のスーパーコンピュータの90%以上はLinuxを使用しています。 携帯端末用のプラットフォームAndroidは、Linuxカーネル上に構築されています。

Amazon EC2

Amazon EC2は“Amazon Elastic Compute Cloud”の略称です。Amazon Web Services(AWS)の一部であり、仮想化されたWebサーバーのコンピュータリソースをレンタルできるサービスです。

AWS(Amazon Web Services)

Amazon Web Services (AWS)は、仮想空間を機軸とした、クラスター状のコンピュータ・ネットワーク・データベース・ストーレッジ・サポートツールをAWSというインフラから提供する商用サービスです。

Q&A

0回答

3202閲覧

プロキシサーバー「squid」でのエラーについて

m8354825717

総合スコア20

Squid

Squidは、TCP/IPネットワークでのユーザーとサーバの通信を中継するオープンソースのプロキシサーバソフト。リバースプロキシやキャッシュサーバとして使用することも可能です。

Linux

Linuxは、Unixをベースにして開発されたオペレーティングシステムです。日本では「リナックス」と呼ばれています。 主にWebサーバやDNSサーバ、イントラネットなどのサーバ用OSとして利用されています。 上位500のスーパーコンピュータの90%以上はLinuxを使用しています。 携帯端末用のプラットフォームAndroidは、Linuxカーネル上に構築されています。

Amazon EC2

Amazon EC2は“Amazon Elastic Compute Cloud”の略称です。Amazon Web Services(AWS)の一部であり、仮想化されたWebサーバーのコンピュータリソースをレンタルできるサービスです。

AWS(Amazon Web Services)

Amazon Web Services (AWS)は、仮想空間を機軸とした、クラスター状のコンピュータ・ネットワーク・データベース・ストーレッジ・サポートツールをAWSというインフラから提供する商用サービスです。

0グッド

0クリップ

投稿2020/10/06 06:47

前提・実現したいこと

amazon linuxでのsquidを使用してプロキシサーバーの構築を行いたい。

発生している問題・エラーメッセージ

ERROR The requested URL could not be retrieved The following error was encountered while trying to retrieve the URL: / Invalid URL Some aspect of the requested URL is incorrect. Some possible problems are: Missing or incorrect access protocol (should be http:// or similar) Missing hostname Illegal double-escape in the URL-Path Illegal character in hostname; underscores are not allowed. Your cache administrator is root.

該当のソースコード (/etc/squid/squid.conf)

# # Recommended minimum configuration: # # 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 # http-mgmt acl Safe_ports port 488 # gss-http acl Safe_ports port 591 # filemaker acl Safe_ports port 777 # multiling http acl CONNECT method CONNECT # # Recommended minimum Access Permission configuration: # # Deny requests to certain unsafe ports http_access deny !Safe_ports # Deny CONNECT to other than secure SSL ports http_access deny CONNECT !SSL_ports # Only allow cachemgr access from localhost http_access allow localhost manager http_access deny manager # We strongly recommend the following be uncommented to protect innocent # web applications running on the proxy server who think the only # one who can access services on "localhost" is a local user #http_access deny to_localhost # # INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS # # Example rule allowing access from your local networks. # Adapt localnet in the ACL section to list your (internal) IP networks # from where browsing should be allowed http_access allow localnet http_access allow localhost # And finally deny all other access to this proxy #http_access deny all # Squid normally listens to port 3128 #http_port 3128 # 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 http_access allow all client_persistent_connections off server_persistent_connections off acl balance random 1/3 balance_on_multiple_ip on http_port 4578 visible_hostname unknown forwarded_for off request_header_access X-Forwarded-For deny all request_header_access Via deny all request_header_access Cache-Control deny all reply_header_access X-Forwarded-For deny all reply_header_access Via deny all reply_header_access Cache-Control deny all max_filedesc 65535 tcp_outgoing_address XXX.XX.XX.XXX balance tcp_outgoing_address XXX.XX.XX.XXX balance tcp_outgoing_address XXX.XX.XX.XXX balance

変更、追記箇所

acl balance random 1/3 balance_on_multiple_ip on http_port 4578 visible_hostname unknown forwarded_for off request_header_access X-Forwarded-For deny all request_header_access Via deny all request_header_access Cache-Control deny all reply_header_access X-Forwarded-For deny all reply_header_access Via deny all reply_header_access Cache-Control deny all max_filedesc 65535 tcp_outgoing_address XXX.XX.XX.XXX balance tcp_outgoing_address XXX.XX.XX.XXX balance tcp_outgoing_address XXX.XX.XX.XXX balance

SG

eth0
ポートプロトコルソース
4578tcp0.0.0.0/0(暫定)
22tcpmy_ip
eth1
ポートプロトコルソース
22tcpmy_ip

ip address show

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9001 qdisc pfifo_fast state UP group default qlen 1000 link/ether 06:e4:f2:06:3f:34 brd ff:ff:ff:ff:ff:ff inet XXX.XX.XX.XXX/20 brd XXX.XX.XX.XXX scope global dynamic eth0 valid_lft 2828sec preferred_lft 2828sec inet6 fe80::4e4:f2ff:fe06:3f34/64 scope link valid_lft forever preferred_lft forever 3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9001 qdisc pfifo_fast state UP group default qlen 1000 link/ether 06:05:b0:1d:e4:ce brd ff:ff:ff:ff:ff:ff inet XXX.XXX.XX.XXX/20 brd XXX.XXX.XX.XXX scope global dynamic eth1 valid_lft 2064sec preferred_lft 2064sec inet XXX.XXX.XX.XXX/20 brd XXX.XXX.XX.XXX scope global secondary eth1 valid_lft forever preferred_lft forever inet XXX.XXX.XX.XXX/20 brd XXX.XXX.XX.XXX scope global secondary eth1 valid_lft forever preferred_lft forever inet XXX.XXX.XX.XXX/20 brd XXX.XXX.XX.XXX scope global secondary eth1 valid_lft forever preferred_lft forever inet6 fe80::405:b0ff:fe1d:e4ce/64 scope link valid_lft forever preferred_lft forever

試したこと

tcp_outgoing_address にはEC2のセカンダリプライベートIPを記述しています。 http_portにはeth0で許可したポートを記述しています。

ネットで情報を探しているのですが情報が出てこなく困っています。ご教授お願いいたします。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

hana_yama_san

2020/10/06 13:46

Illegal character in hostname; だそうですが、 visible_hostname unknownとか 危なさそうに思えますが、どうでしょう? うちもかつてsqid運用してましたが、 こんなことはわざわざ書いた覚えが無いです。
yu_1985

2020/10/07 06:59

> The following error was encountered while trying to retrieve the URL: / URLのところに何も入っていませんが、どのようにアクセスしたんでしょうか? 何をしたらこのエラーが発生したのかをなるべく具体的に書いてください。 あと、squidのログファイルにはなにか出ていませんか?
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問