{"id":161,"date":"2016-07-02T21:23:28","date_gmt":"2016-07-02T12:23:28","guid":{"rendered":"http:\/\/www.kwonline.org\/memo2\/?p=161"},"modified":"2016-07-02T21:23:28","modified_gmt":"2016-07-02T12:23:28","slug":"fedora%e3%81%absquid%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab","status":"publish","type":"post","link":"https:\/\/www.kwonline.org\/memo2\/2016\/07\/02\/fedora%e3%81%absquid%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab\/","title":{"rendered":"Fedora\u306bSquid\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb"},"content":{"rendered":"<p>\t\t\t\t\u5916\u90e8\u304b\u3089\u63a5\u7d9a\u3067\u304d\u308b\u30d7\u30ed\u30ad\u30b7\u30b5\u30fc\u30d0\u30fc\u3092Squid\u3067\u69cb\u7bc9\u3057\u305f\u3002<br \/>\n\u56fa\u5b9aIP\u306eVPS\u30b5\u30fc\u30d3\u30b9\u4e0a\u3067\u3001\u5e38\u306b\u540c\u3058IP\u30a2\u30c9\u30ec\u30b9\u304b\u3089Web\u30d6\u30e9\u30a6\u30b8\u30f3\u30b0\u3059\u308b\u305f\u3081\u306e\u30d7\u30ed\u30ad\u30b7\u306a\u306e\u3067\u3001\u30ad\u30e3\u30c3\u30b7\u30e5\u306f\u306a\u304f\u3066\u3001\u30d5\u30a9\u30ef\u30fc\u30c9\u306e\u307f\u3002<br \/>\n\u30ce\u30fc\u30ac\u30fc\u30c9\u3059\u304e\u308b\u306e\u3082\u3042\u308c\u306a\u306e\u3067\u3001BASIC\u8a8d\u8a3c\u3092\u304b\u3051\u3066\u304a\u304f\u3002<\/p>\n<p>OS\u306fFedora 22<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">$ dnf -y install squid<\/pre>\n<p>BASIC\u8a8d\u8a3c\u3092\u4f7f\u3046\u306e\u3067\u3001httpd-tools\u3082\u5165\u308c\u308b\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">$ dnf -y install httpd-tools<\/pre>\n<p>\u305d\u308c\u304b\u3089 \/etc\/squid\/squid.conf \u3092\u7de8\u96c6\u3059\u308b\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">$ cd \/etc\/squid\n$ vi squid.conf<\/pre>\n<p>\u307b\u307c\u30c7\u30d5\u30a9\u30eb\u30c8\u306a\u3093\u3060\u3051\u3069\u3001\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u304b\u3089\u306e\u30a2\u30af\u30bb\u30b9\u3092\u5168\u90e8\u8a31\u53ef\u3059\u308b\u306e\u3068\u3001BASIC\u8a8d\u8a3c\u306e\u8a2d\u5b9a\u3092\u8ffd\u52a0<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">#\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u304b\u3089\u306e\u30a2\u30af\u30bb\u30b9\u3092\u5b9a\u7fa9\nacl allnet src 0.0.0.0\/0.0.0.0\n\n#BASIC\u8a8d\u8a3c\u306e\u8a2d\u5b9a\nauth_param basic program \/usr\/lib64\/squid\/basic_ncsa_auth \/etc\/squid\/.htpasswd\nauth_param basic children 5\nauth_param basic realm Squid Basic Authentication\nauth_param basic credentialsttl 5 hours\nacl password proxy_auth REQUIRED\nhttp_access allow password\n\n#\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u304b\u3089\u306e\u30a2\u30af\u30bb\u30b9\u3092\u8a31\u53ef\nhttp_access allow allnet\n\n#Forwarded_for\u30d8\u30c3\u30c0\u306e\u9001\u51fa\u3092\u30aa\u30d5\nforwarded_for off\n\n#\u30db\u30b9\u30c8\u540d\u3092\u8ffd\u52a0\nvisible_hostname hoge.kwonline.org\n\n#deny all \u3092\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\n#http_access deny all<\/pre>\n<p>BASIC\u8a8d\u8a3c\u306b\u4f7f\u3046\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u4f5c\u6210\u3059\u308b\u3002<br \/>\norenomemo\u3068\u3044\u3046\u30e6\u30fc\u30b6\u30fc\u540d\u3092\u8ffd\u52a0\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">$ htpasswd -c \/etc\/squid\/.htpasswd orenomemo<\/pre>\n<p>\u30d1\u30b9\u30ef\u30fc\u30c9\u30922\u56de\u5165\u529b\u3057\u305f\u3089\u8a2d\u5b9a\u306f\u4ee5\u4e0a\u3001\u3067\u3001Squid\u3092\u8d77\u52d5\u3059\u308b\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">$ systemctl start squid\n$ systemctl enable squid\n<\/pre>\n<p>\u3042\u308c\uff1f\u30fb\u30fb\u30fb\u30a8\u30e9\u30fc\u304c\u51fa\u3066\u8d77\u52d5\u3057\u306a\u3044\u3002<br \/>\nsystemctl\u306e\u30ed\u30b0\u3092\u78ba\u8a8d\u3057\u3066\u307f\u308b\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">$ systemctl status squid.service -l<\/pre>\n<blockquote><p>\/usr\/sbin\/squid: error while loading shared libraries: cannot restore segment prot after reloc: Permission denied<\/p><\/blockquote>\n<p>SELinux\u304c\u6709\u52b9\u306b\u306a\u3063\u3066\u308b\u306e\u304c\u539f\u56e0\u306a\u306e\u3067\u3001\u3068\u308a\u3042\u3048\u305a\u8a2d\u5b9a\u3092\u5909\u3048\u3066\u304a\u304f\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">$ \/usr\/sbin\/setenforce 0<\/pre>\n<p>\u305f\u3060\u3053\u308c\u3060\u3068\u518d\u8d77\u52d5\u6642\u306b\u307e\u305fSELinux\u306e\u8a2d\u5b9a\u304c\u623b\u3063\u3066\u3057\u307e\u3046\u306e\u3067\u3001<br \/>\n\/etc\/selinux\/config\u3092\u7de8\u96c6\u3057\u3066\u3001SELINUX=permissive\u306b\u5909\u3048\u308b\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">$ vi \/etc\/selinux\/config<\/pre>\n<blockquote><p>SELINUX=permissive<\/p><\/blockquote>\n<p>\u3067\u3001\u7121\u4e8b\u8d77\u52d5\u3002<br \/>\n\u305d\u3057\u3066\u30d6\u30e9\u30a6\u30b6\u304b\u3089\u30d7\u30ed\u30ad\u30b7\u8a2d\u5b9a\u3092\u8ffd\u52a0\u3057\u3066\u307f\u305f\u304c\u3001\u63a5\u7d9a\u51fa\u6765\u307e\u305b\u3093\u306e\u30a8\u30e9\u30fc\u3002<br \/>\nfirewalld\u304c\u539f\u56e0\u3060\u3063\u305f\u3002<br \/>\n\u3068\u3044\u3046\u308f\u3051\u3067\u8a2d\u5b9a\u3092\u898b\u76f4\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">$ firewall-cmd --permanent --add-service=squid\n$ firewall-cmd --reload<\/pre>\n<p>\u3053\u308c\u30673128\u30dd\u30fc\u30c8\u3067Squid\u30d7\u30ed\u30ad\u30b7\u304c\u52d5\u3044\u305f\u3002\t\t<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5916\u90e8\u304b\u3089\u63a5\u7d9a\u3067\u304d\u308b\u30d7\u30ed\u30ad\u30b7\u30b5\u30fc\u30d0\u30fc\u3092Squid\u3067\u69cb\u7bc9\u3057\u305f\u3002 \u56fa\u5b9aIP\u306eVPS\u30b5\u30fc\u30d3\u30b9\u4e0a\u3067\u3001\u5e38\u306b\u540c\u3058IP\u30a2\u30c9\u30ec\u30b9\u304b\u3089Web\u30d6\u30e9\u30a6\u30b8\u30f3\u30b0\u3059\u308b\u305f\u3081\u306e\u30d7\u30ed\u30ad\u30b7\u306a\u306e\u3067\u3001\u30ad\u30e3\u30c3\u30b7\u30e5\u306f\u306a\u304f\u3066\u3001\u30d5\u30a9\u30ef\u30fc\u30c9\u306e\u307f\u3002 \u30ce\u30fc\u30ac\u30fc\u30c9\u3059\u304e\u308b\u306e\u3082\u3042\u308c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,11],"tags":[],"class_list":["post-161","post","type-post","status-publish","format-standard","hentry","category-linux","category-unix"],"_links":{"self":[{"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/posts\/161","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/comments?post=161"}],"version-history":[{"count":0,"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/posts\/161\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/media?parent=161"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/categories?post=161"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/tags?post=161"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}