{"id":750,"date":"2020-09-18T21:58:37","date_gmt":"2020-09-18T12:58:37","guid":{"rendered":"https:\/\/medicalfields.jp\/blog\/?p=750"},"modified":"2020-09-18T21:58:38","modified_gmt":"2020-09-18T12:58:38","slug":"centos%e3%81%absquidproxy%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%97%e3%81%a6proxy%e7%b5%8c%e7%94%b1%e3%81%a7%e6%97%a5%e6%9c%ac%e5%9b%bd%e5%86%85%e5%b0%82%e7%94%a8","status":"publish","type":"post","link":"https:\/\/medicalfields.jp\/blog\/centos\/centos%e3%81%absquidproxy%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%97%e3%81%a6proxy%e7%b5%8c%e7%94%b1%e3%81%a7%e6%97%a5%e6%9c%ac%e5%9b%bd%e5%86%85%e5%b0%82%e7%94%a8\/","title":{"rendered":"CentOS\u306bSquid(Proxy)\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066Proxy\u7d4c\u7531\u3067\u65e5\u672c\u56fd\u5185\u5c02\u7528\u30b5\u30fc\u30d3\u30b9\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"\n<p>\u65e5\u672c\u56fd\u5185\u3060\u3051\u306eHP\u3084\u30b5\u30fc\u30d3\u30b9\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u6642\u306f\u666e\u901a\u306fVPN\u3092\u4f7f\u3063\u305f\u307b\u3046\u304c\u3044\u3044\u3093\u3060\u3051\u3069\u3001\u305d\u308c\u304c\u4f7f\u3048\u306a\u3044\u30b1\u30fc\u30b9\u3082\u3042\u308b(\u79c1\u306e\u5834\u5408\u306fappetize.io)<\/p>\n<p>\u00a0<\/p>\n<p>\u3067\u304d\u308b\u3060\u3051\u5b89\u5168\u306b\u904b\u7528\u3059\u308b\u305f\u3081\u306e\u624b\u9806\u3067\u3059<\/p>\n<p>\u30a4\u30e1\u30fc\u30b8<\/p>\n<p>\u4e16\u754c\u2192My\u30b5\u30fc\u30d0\u30fc\uff08squid\uff09\u2192\u56fd\u5185\u5c02\u7528HP<\/p>\n<p>Basic\u8a8d\u8a3c\u3067\u306a\u304a\u304b\u3064\u30db\u30ef\u30a4\u30c8\u30ea\u30b9\u30c8\u65b9\u5f0f\uff08\u8a31\u53ef\u3057\u305f\u30c9\u30e1\u30a4\u30f3\u3060\u3051\u306e\u30a2\u30af\u30bb\u30b9\u8a31\u53ef\uff09\u306b\u3057\u307e\u3059<\/p>\n<p>\u00a0<\/p>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\uff1a<\/p>\n<p>yum -y install squid<\/p>\n<p>firewall-cmd &#8211;zone=public &#8211;add-port=3128\/tcp &#8211;permanent<br \/>systemctl start squid.service<br \/>systemctl enable squid.service<\/p>\n<p>yum install httpd-tools<\/p>\n<p>htpasswd -c \/etc\/squid\/passwords user<\/p>\n<p>password\uff03\u3053\u308c\u306fBasic\u8a8d\u8a3c\u306e\u305f\u3081\u306b<\/p>\n<p><br \/>vi \/etc\/squid\/squid.conf<\/p>\n<p>\u00a0<\/p>\n<p>\u00a0<\/p>\n<p>\/etc\/squid\/squid.conf\u306e\u4e2d\u8eab<br \/>#<br \/># Recommended minimum configuration:<br \/>#<\/p>\n<p># Example rule allowing access from your local networks.<br \/># Adapt to list your (internal) IP networks from where browsing<br \/># should be allowed<\/p>\n<p>auth_param basic program \/usr\/lib64\/squid\/basic_ncsa_auth \/etc\/squid\/passwords<br \/>auth_param basic realm proxy<br \/>auth_param basic children 10<\/p>\n<p>acl authenticated proxy_auth REQUIRED<br \/>http_access deny !authenticated #\u3053\u306eDeny!\u306b\u3057\u306a\u3044\u3068\u3001DNS\u306e\u30db\u30ef\u30a4\u30c8\u30ea\u30b9\u30c8\u65b9\u5f0f\u304c\u53d6\u308c\u306a\u3044<\/p>\n<p>acl localnet src 10.0.0.0\/8 # RFC1918 possible internal network<br \/>acl localnet src 172.16.0.0\/12 # RFC1918 possible internal network<br \/>acl localnet src 192.168.0.0\/16 # RFC1918 possible internal network<br \/>acl localnet src fc00::\/7 # RFC 4193 local private network range<br \/>acl localnet src fe80::\/10 # RFC 4291 link-local (directly plugged) machines<\/p>\n<p>acl mysite dstdomain www.yahoo.co.jp<br \/>acl mysite dstdomain www.google.co.jp<br \/>acl mysite dstdomain .google.com<br \/>acl mysite dstdomain fonts.googleapis.com<br \/>acl mysite dstdomain ajax.googleapis.com<br \/>acl mysite dstdomain cdn.jsdelivr.net<br \/>#acl mysite dstdomain .googleapis.com<br \/>#acl mysite dstdomain .jsdelivr.net<br \/>acl mysite dstdomain youtu.be<br \/>acl mysite dstdomain .youtube.com<br \/>acl mysite dstdomain appetize.io<br \/>acl mysite dstdomain .medicalfields.jp<br \/>acl mysite dstdomain 157.7.94.189<br \/>acl mysite dstdomain www.ugtop.com #To Check Ip<br \/>acl SSL_ports port 443<br \/>acl Safe_ports port 80 # http<br \/>#acl Safe_ports port 21 # ftp<br \/>acl Safe_ports port 443 # https<br \/>#acl Safe_ports port 70 # gopher<br \/>#acl Safe_ports port 210 # wais<br \/>#acl Safe_ports port 1025-65535 # unregistered ports<br \/>#acl Safe_ports port 280 # http-mgmt<br \/>#acl Safe_ports port 488 # gss-http<br \/>#acl Safe_ports port 591 # filemaker<br \/>#acl Safe_ports port 777 # multiling http<br \/>acl CONNECT method CONNECT<\/p>\n<p>#<br \/># Recommended minimum Access Permission configuration:<br \/>#<br \/># Deny requests to certain unsafe ports<br \/>http_access deny !Safe_ports<\/p>\n<p># Deny CONNECT to other than secure SSL ports<br \/>http_access deny CONNECT !SSL_ports<\/p>\n<p># Only allow cachemgr access from localhost<br \/>http_access deny manager<\/p>\n<p># We strongly recommend the following be uncommented to protect innocent<br \/># web applications running on the proxy server who think the only<br \/># one who can access services on &#8220;localhost&#8221; is a local user<br \/>#http_access deny to_localhost<\/p>\n<p>#<br \/># INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS<br \/>#<\/p>\n<p># Example rule allowing access from your local networks.<br \/># Adapt localnet in the ACL section to list your (internal) IP networks<br \/># from where browsing should be allowed<br \/>#http_access allow localnet<br \/>#http_access allow localhost<br \/>http_access allow mysite<br \/>http_access deny !mysite<\/p>\n<p># And finally deny all other access to this proxy<br \/>http_access deny all<\/p>\n<p># Squid normally listens to port 3128<br \/>http_port 3128<\/p>\n<p># Uncomment and adjust the following to add a disk cache directory.<br \/>#cache_dir ufs \/var\/spool\/squid 100 16 256<\/p>\n<p># Leave coredumps in the first cache dir<br \/>coredump_dir \/var\/spool\/squid<\/p>\n<p>#<br \/># Add any of your own refresh_pattern entries above these.<br \/>#<br \/>refresh_pattern ^ftp: 1440 20% 10080<br \/>refresh_pattern ^gopher: 1440 0% 1440<br \/>refresh_pattern -i (\/cgi-bin\/|\\?) 0 0% 0<br \/>refresh_pattern . 0 20% 4320<\/p>\n<p>dns_v4_first on #\u3053\u3046\u3057\u306a\u3044\u3068Google\u306b\u5165\u308c\u306a\u304b\u3063\u305f<\/p>\n<p>dns_nameservers 8.8.8.8 208.67.222.222<\/p>\n<p>\u00a0<\/p>\n<p>\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u65e5\u672c\u56fd\u5185\u3060\u3051\u306eHP\u3084\u30b5\u30fc\u30d3\u30b9\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u6642\u306f\u666e\u901a\u306fVPN\u3092\u4f7f\u3063\u305f\u307b\u3046\u304c\u3044\u3044\u3093\u3060\u3051\u3069\u3001\u305d\u308c\u304c\u4f7f\u3048\u306a\u3044\u30b1\u30fc\u30b9\u3082\u3042\u308b(\u79c1\u306e\u5834\u5408\u306fappetize.io) \u00a0 \u3067\u304d\u308b\u3060\u3051\u5b89\u5168\u306b\u904b\u7528\u3059\u308b\u305f\u3081\u306e\u624b\u9806\u3067\u3059 \u30a4\u30e1\u30fc\u30b8 \u4e16\u754c\u2192My\u30b5\u30fc\u30d0 &hellip; <a href=\"https:\/\/medicalfields.jp\/blog\/centos\/centos%e3%81%absquidproxy%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%97%e3%81%a6proxy%e7%b5%8c%e7%94%b1%e3%81%a7%e6%97%a5%e6%9c%ac%e5%9b%bd%e5%86%85%e5%b0%82%e7%94%a8\/\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">CentOS\u306bSquid(Proxy)\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066Proxy\u7d4c\u7531\u3067\u65e5\u672c\u56fd\u5185\u5c02\u7528\u30b5\u30fc\u30d3\u30b9\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u65b9\u6cd5<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false},"categories":[17],"tags":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p6kJO0-c6","_links":{"self":[{"href":"https:\/\/medicalfields.jp\/blog\/wp-json\/wp\/v2\/posts\/750"}],"collection":[{"href":"https:\/\/medicalfields.jp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/medicalfields.jp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/medicalfields.jp\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/medicalfields.jp\/blog\/wp-json\/wp\/v2\/comments?post=750"}],"version-history":[{"count":2,"href":"https:\/\/medicalfields.jp\/blog\/wp-json\/wp\/v2\/posts\/750\/revisions"}],"predecessor-version":[{"id":752,"href":"https:\/\/medicalfields.jp\/blog\/wp-json\/wp\/v2\/posts\/750\/revisions\/752"}],"wp:attachment":[{"href":"https:\/\/medicalfields.jp\/blog\/wp-json\/wp\/v2\/media?parent=750"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/medicalfields.jp\/blog\/wp-json\/wp\/v2\/categories?post=750"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/medicalfields.jp\/blog\/wp-json\/wp\/v2\/tags?post=750"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}