{"id":69,"date":"2008-05-16T21:27:00","date_gmt":"2008-05-16T12:27:00","guid":{"rendered":"http:\/\/yokensaka.com\/fedora\/?p=69"},"modified":"2008-05-16T21:27:00","modified_gmt":"2008-05-16T12:27:00","slug":"web%e3%82%b5%e3%83%bc%e3%83%90apache","status":"publish","type":"post","link":"http:\/\/yokensaka.com\/fedora\/?p=69","title":{"rendered":"Web\u30b5\u30fc\u30d0(Apache)"},"content":{"rendered":"<p><b>\u25a0\u3000FC2\uff5eFC6 \/ Fedora7 \/ Fedora8 \/ Fedora9<\/b><br \/>\nApache \u306f\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u3067\u6700\u3082\u666e\u53ca\u3057\u3066\u3044\u308b\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u306e Web \u30b5\u30fc\u30d0\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u30fc\u3067\u3059\u3002Apache \u306f\u6a19\u6e96\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u307e\u3059\u306e\u3067\u30b5\u30fc\u30d0\u30fc\u306e\u8a2d\u5b9a\u306b\u79fb\u308a\u307e\u3059\u3002<br \/>\n<b>\u25a0Apache \u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u308b\u304b\u3069\u3046\u304b\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/b><\/p>\n<pre>[root@server ~]# rpm -q httpd\nhttpd-2.2.8-3.i386\u3000\u3000\u2190\u3000\u30d1\u30c3\u30b1\u30fc\u30b8\u60c5\u5831\u304c\u8868\u793a\u3055\u308c\u305f\n\u30d1\u30c3\u30b1\u30fc\u30b8\u60c5\u5831\u304c\u8868\u793a\u3055\u308c\u306a\u3051\u308c\u3070\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002\n[root@linux ~]# yum -y install httpd <\/pre>\n<p><b>\u25a0PHP\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/b><\/p>\n<pre>[root@linux ~]# yum -y install php<\/pre>\n<p><b>\u25a0Apache\u306e\u8a2d\u5b9a<\/b><\/p>\n<pre>Apache\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306e\u7de8\u96c6\n[root@linux root]# vi \/etc\/httpd\/conf\/httpd.conf\n\u30a8\u30e9\u30fc\u30da\u30fc\u30b8\u7b49\u3067OS\u540d\u3092\u8868\u793a\u3057\u306a\u3044\u3088\u3046\u306b\u3059\u308b\nServerTokens OS\n\u2193\nServerTokens Prod\n\u30a8\u30e9\u30fc\u30da\u30fc\u30b8\u7b49\u3067Apache\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u8868\u793a\u3057\u306a\u3044\u3088\u3046\u306b\u3059\u308b\nServerSignature On\n\u2193\nServerSignature Off\n\u7ba1\u7406\u8005\u306e\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u8a2d\u5b9a\u3059\u308b\nServerAdmin root@localhost\n\u2193\nServerAdmin webmaster@yokensaka.com\u3000\u2190\u3000\u72ec\u81ea\u30c9\u30e1\u30a4\u30f3\u306b\u5909\u66f4\n\u30b5\u30fc\u30d0\u30fc\u540d\u3092\u6307\u5b9a\n#ServerName www.example.com:80\n\u2193\nServerName yokensaka.com:80\u3000\u2190\u3000#\u3092\u306f\u305a\u3057\u3066\u72ec\u81ea\u30c9\u30e1\u30a4\u30f3\u306b\u5909\u66f4\nCGI\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3067\u304d\u308b\u69d8\u306b\u3059\u308b\n#AddHandler cgi-script .cgi\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u2193\nAddHandler cgi-script .cgi .pl\u3000\u2190\u3000#\u3092\u306f\u305a\u3057\u3066.pl\u3092\u8ffd\u52a0\n\u30c7\u30d5\u30a9\u30eb\u30c8\u30ad\u30e3\u30e9\u30bb\u30c3\u30c8\u3092\u7121\u52b9\u306b\u3059\u308b\nAddDefaultCharset UTF-8\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u2193\n#AddDefaultCharset UTF-8\u3000\u2190\u3000#\u3092\u4ed8\u3051\u308b\nCGI\u306e\u8a31\u53ef\u3001SSI\u306e\u8a31\u53ef\u3001\u30b7\u30f3\u30dc\u30ea\u30c3\u30af\u30ea\u30f3\u30af\u8a31\u53ef\n# http:\/\/httpd.apache.org\/docs-2.0\/mod\/core.html#options\n# for more information.\n#\nOptions Indexes FollowSymLinks\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u2193\nOptions Includes ExecCGI FollowSymLinks\n.htaccess\u306e\u8a31\u53ef\n# It can be &quot;All&quot;, &quot;None&quot;, or any combination of the keywords:\n#   Options FileInfo AuthConfig Limit\n#\nAllowOverride None\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u2193\nAllowOverride All\n\u9577\u3059\u304e\u308bURI\uff08414 Error\uff09\u306f\u30ed\u30b0\u306b\u8a18\u9332\u3057\u306a\u3044\n# The following directives define some format nicknames for use with\n# a CustomLog directive (see below).\n#\nLogFormat &quot;%h %l %u %t \\&quot;%r\\&quot; %&gt;s %b \\&quot;%{Referer}i\\&quot; \\&quot;%{User-Agent}i\\&quot;&quot; combined\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u2193\nLogFormat &quot;%h %l %u %t \\&quot;%!414r\\&quot; %&gt;s %b \\&quot;%{Referer}i\\&quot; \\&quot;%{User-Agent}i\\&quot;&quot; combined\n\u30ed\u30b0\u306e\u8a18\u9332\u5185\u5bb9\u5909\u66f4\n# logged therein and *not* in this file.\n#\n#CustomLog logs\/access_log common\n\u3053\u306e\u4e0b\u306b\u4ee5\u4e0b\u3092\u8ffd\u52a0\nSetEnvIf Request_URI &quot;default\\.ida&quot; no_log\nSetEnvIf Request_URI &quot;cmd\\.exe&quot; no_log\nSetEnvIf Request_URI &quot;root\\.exe&quot; no_log\nSetEnvIf Request_URI &quot;Admin\\.dll&quot; no_log\nSetEnvIf Request_URI &quot;NULL\\.IDA&quot; no_log\nSetEnvIf Request_URI &quot;\\.(gif)|(jpg)|(png)|(ico)|(css)$&quot; no_log\nSetEnvIf Remote_Addr 192.168. no_log\nCustomLog logs\/access_log combined env=!no_log\n<\/pre>\n<p><b>\u25a0Perl\u306e\u30d1\u30b9\u304c\/usr\/local\/bin\/perl\u3067\u3082CGI\u3092\u5b9f\u884c\u51fa\u6765\u308b\u3088\u3046\u306b\u3059\u308b\u3002<\/b><\/p>\n<pre>\u73fe\u5728\u306ePerl\u306e\u4f4d\u7f6e\n[root@linux ~]# which perl\n\/usr\/bin\/perl\n\u30b7\u30f3\u30dc\u30ea\u30c3\u30af\u30ea\u30f3\u30af\u8a2d\u5b9a\uff08\/usr\/local\/bin\/perl\u304b\u3089\/usr\/bin\/perl\u3078\u30ea\u30f3\u30af\u3092\u306f\u308b\uff09\n[root@linux ~]# ln -s \/usr\/bin\/perl \/usr\/local\/bin\/perl\n\u5909\u66f4\u5f8c\u306ePerl\u306e\u4f4d\u7f6e\n[root@linux ~]# which perl\n\/usr\/local\/bin\/perl<\/pre>\n<p><b>\u25a0\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u30eb\u30fc\u30c8\u306e\u6240\u6709\u8005\u5909\u66f4<\/b><\/p>\n<pre>[root@linux ~]# chown higo:higo \/var\/www\/html\/\u3000\u2190\u3000\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u30eb\u30fc\u30c8\u6240\u6709\u8005\u5909\u66f4\n[root@linux ~]# ll \/var\/www\/\u3000\u2190\u3000\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u30eb\u30fc\u30c8\u6240\u6709\u8005\u5909\u66f4\u78ba\u8a8d\n\u5408\u8a08 32\ndrwxr-xr-x 2 root root 4096 2007-05-09 19:28 cgi-bin\ndrwxr-xr-x 3 root root 4096 2007-06-10 23:53 error\ndrwxr-xr-x 2 higo higo 4096 2007-05-09 19:28 html\ndrwxr-xr-x 3 root root 4096 2007-06-10 20:26 icons<\/pre>\n<p><b>\u25a0Apache\u306e\u8d77\u52d5<\/b><\/p>\n<pre>Apache(httpd)\u3092\u8d77\u52d5\u3059\u308b\n[root@linux ~]# \/etc\/rc.d\/init.d\/httpd start\nhttpd \u3092\u8d77\u52d5\u4e2d:                                            [  OK  ]<\/pre>\n<p><b>\u25a0Apache\u306e\u81ea\u52d5\u8d77\u52d5\u8a2d\u5b9a<\/b><\/p>\n<pre>[root@linux ~]# chkconfig httpd on\n[root@linux ~]# chkconfig --list httpd\nhttpd           0:off   1:off   2:on    3:on    4:on    5:on    6:off\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u30e9\u30f3\u30ec\u30d9\u30eb2\uff5e5\u304c\u30aa\u30f3\u306e\u72b6\u614b\u3067\u3042\u308b\u3053\u3068\u3092\u78ba\u8a8d<\/pre>\n<p><b>\u25a0Apache\u306e\u52d5\u4f5c\u78ba\u8a8d<\/b><br \/>\n\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3088\u308a http:\/\/192.168.1.2\/ \u3067\u30a2\u30af\u30bb\u30b9\u3057\u3066\u300cFedora Core Test Page\u300d\u753b\u9762\u304c\u8868\u793a\u3055\u308c\u308c\u3070OK\u3067\u3059\u3002<br \/>\n<b>\u25a0\u5404\u6a5f\u80fd\u306e\u52d5\u4f5c\u78ba\u8a8d<\/b><br \/>\n<b>1.\u30c6\u30b9\u30c8\u7528\u306eHTML\u306e\u8868\u793a\u78ba\u8a8d\u3092\u884c\u3046\u3002<\/b><\/p>\n<pre>\u30c6\u30b9\u30c8\u7528\u306ehtml\u3092\u4f5c\u6210\n[root@linux ~]# vi \/var\/www\/html\/index.html\n&lt;html&gt;\n&lt;head&gt;\n&lt;meta http-equiv=\"Content-Type\" content=\"text\/html; charset=euc-jp\"&gt;\n&lt;title&gt;\u30c6\u30b9\u30c8\u30da\u30fc\u30b8&lt;\/title&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n\u30c6\u30b9\u30c8\u30da\u30fc\u30b8\n&lt;\/body&gt;\n&lt;\/html&gt;<\/pre>\n<p>\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3088\u308a http:\/\/192.168.1.2\/index.html \u3067\u30a2\u30af\u30bb\u30b9\u3057\u3066\u3001\u300c\u30c6\u30b9\u30c8\u30da\u30fc\u30b8\u300d\u3068\u8868\u793a\u3055\u308c\u308c\u3070OK\u3067\u3059\u3002<br \/>\n<b>2.SSI\u306e\u52d5\u4f5c\u78ba\u8a8d\u3092\u884c\u306a\u3046\u3002<\/b><\/p>\n<pre>\u30c6\u30b9\u30c8\u7528\u306eshtml\u3092\u4f5c\u6210\n[root@linux ~]# vi \/var\/www\/html\/index.shtml\n&lt;html&gt;\n&lt;head&gt;\n&lt;meta http-equiv=\"Content-Type\" content=\"text\/html; charset=euc-jp\"&gt;\n&lt;title&gt;\u30c6\u30b9\u30c8&lt;\/title&gt;\n&lt;body&gt;\nSSI\u30c6\u30b9\u30c8\n&lt;!--#config timefmt=\"%Y\/%m\/%d %H:%M:%S\" --&gt;\n&lt;!--#echo var=\"DATE_LOCAL\" --&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/pre>\n<p>\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3088\u308a http:\/\/192.168.1.2\/index.shtml \u3067\u30a2\u30af\u30bb\u30b9\u3057\u3066\u3001\u73fe\u5728\u306e\u65e5\u4ed8\u304c\u8868\u793a\u3055\u308c\u308c\u3070OK\u3067\u3059\u3002<br \/>\n<b>3.CGI\u306e\u52d5\u4f5c\u78ba\u8a8d\u3092\u884c\u306a\u3046\u3002<\/b><\/p>\n<pre>\u30c6\u30b9\u30c8\u7528\u306ecgi\u3092\u4f5c\u6210\n[root@linux ~]# vi \/var\/www\/html\/test.cgi\n#!\/usr\/local\/bin\/perl\nprint \"Content-type: text\/html\\n\\n\";\nprint \"&lt;html&gt;\\n\";\nprint \"&lt;head&gt;\\n\";\nprint \"&lt;meta http-equiv=\\\"Content-Type\\\" content=\\\"text\/html; charset=euc-jp\\\"&gt;\";\nprint \"&lt;title&gt;\u30c6\u30b9\u30c8\u30da\u30fc\u30b8&lt;\/title&gt;\\n\";\nprint \"&lt;\/head&gt;\\n\";\nprint \"&lt;body&gt;\\n\";\nprint \"CGI\u30c6\u30b9\u30c8\\n\";\nprint \"&lt;\/body&gt;\\n\";\nprint \"&lt;\/html&gt;\\n\";\ncgi\u306e\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u5909\u66f4\n[root@linux ~]# chmod 755 \/var\/www\/html\/test.cgi<\/pre>\n<p>\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3088\u308a http:\/\/192.168.1.2\/test.cgi \u3067\u30a2\u30af\u30bb\u30b9\u3057\u3066\u3001\u300cCGI\u30c6\u30b9\u30c8\u300d\u3068\u8868\u793a\u3055\u308c\u308c\u3070OK\u3067\u3059\u3002<br \/>\n<b>4.PHP\u306e\u52d5\u4f5c\u78ba\u8a8d\u3092\u884c\u306a\u3046\u3002<\/b><\/p>\n<pre>\u30c6\u30b9\u30c8\u7528\u306ephp\u3092\u4f5c\u6210\n[root@linux ~]# vi \/var\/www\/html\/test.php\n&lt;?php\nphpinfo();\n?&gt;<\/pre>\n<p>\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3088\u308a http:\/\/192.168.1.2\/test.php \u3067\u30a2\u30af\u30bb\u30b9\u3057\u3066\u3001PHP\u30a4\u30f3\u30d5\u30a9\u30e1\u30fc\u30b7\u30e7\u30f3\u753b\u9762\u304c\u8868\u793a\u3055\u308c\u308c\u3070OK\u3067\u3059\u3002<br \/>\n<b>\u25a0\u516c\u958b\u524d\u306e\u6e96\u5099<\/b><br \/>\n\u30db\u30fc\u30e0\u30da\u30fc\u30b8\u3092\u5916\u90e8\u306b\u516c\u958b\u3059\u308b\u306b\u5f53\u305f\u3063\u3066\u3001\u30eb\u30fc\u30bf\u306e\u8a2d\u5b9a\u304c\u5fc5\u8981\u3067\u3059\u3002<br \/>\n\u30eb\u30fc\u30bf\u306e\u8a2d\u5b9a\u3067<b>\u30dd\u30fc\u30c8\u756a\u53f780\u756a<\/b>\u3092\u958b\u3051\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<div align=right><a href=\"#\">\u25b2 \u30da\u30fc\u30b8\u30c8\u30c3\u30d7\u3078<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u25a0\u3000FC2\uff5eFC6 \/ Fedora7 \/ Fedora8 \/ Fedora9 Apache \u306f\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u3067\u6700\u3082\u666e\u53ca\u3057\u3066\u3044\u308b\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u306e Web \u30b5\u30fc\u30d0\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u30fc\u3067\u3059\u3002Apache \u306f\u6a19\u6e96\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[],"class_list":["post-69","post","type-post","status-publish","format-standard","hentry","category-14-webapache"],"_links":{"self":[{"href":"http:\/\/yokensaka.com\/fedora\/index.php?rest_route=\/wp\/v2\/posts\/69","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/yokensaka.com\/fedora\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/yokensaka.com\/fedora\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/yokensaka.com\/fedora\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/yokensaka.com\/fedora\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=69"}],"version-history":[{"count":0,"href":"http:\/\/yokensaka.com\/fedora\/index.php?rest_route=\/wp\/v2\/posts\/69\/revisions"}],"wp:attachment":[{"href":"http:\/\/yokensaka.com\/fedora\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=69"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/yokensaka.com\/fedora\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=69"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/yokensaka.com\/fedora\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=69"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}