{"id":209,"date":"2026-04-05T23:54:56","date_gmt":"2026-04-05T14:54:56","guid":{"rendered":"https:\/\/falcon21.space\/kazuya\/work\/?page_id=209"},"modified":"2026-04-05T23:54:56","modified_gmt":"2026-04-05T14:54:56","slug":"%e3%83%a6%e3%83%bc%e3%82%b6%e3%83%bc%e3%83%9a%e3%83%bc%e3%82%b8%e8%a1%a8%e7%a4%ba%e8%a8%ad%e5%ae%9a","status":"publish","type":"page","link":"https:\/\/falcon21.space\/kazuya\/work\/?page_id=209","title":{"rendered":"\u30e6\u30fc\u30b6\u30fc\u30da\u30fc\u30b8\u8868\u793a\u8a2d\u5b9a"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>&lt;pre>\u30e6\u30fc\u30b6\u30fc\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u8868\u793a\u8a2d\u5b9a\nroot@falcon21:~# vi \/etc\/httpd\/conf.d\/userdir.conf\n#\n# UserDir: The name of the directory that is appended onto a user's home\n# directory if a ~user request is received.\n#\n# The path to the end user account 'public_html' directory must be\n# accessible to the webserver userid.  This usually means that ~userid\n# must have permissions of 711, ~userid\/public_html must have permissions\n# of 755, and documents contained therein must be world-readable.\n# Otherwise, the client will only receive a \"403 Forbidden\" message.\n#\n&lt;IfModule mod_userdir.c>\n    #\n    # UserDir is disabled by default since it can confirm the presence\n    # of a username on the system (depending on home directory\n    # permissions).\n    #\n    #UserDir disabled\n\n    #\n    # To enable requests to \/~user\/ to serve the user's public_html\n    # directory, remove the \"UserDir disabled\" line above, and uncomment\n    # the following line instead:\n    # \n    UserDir public_html\n            AliasMatch ^\/kazuya(.*) \/home\/xxxxxx\/public_html\/$1\n            AliasMatch ^\/hayato(.*) \/home\/yyyyyy\/public_html\/$1\n            AliasMatch ^\/anjii(.*) \/home\/zzzzzz\/public_html\/$1\n            AliasMatch ^\/userdir\/(&#91;^\/]+)\/(.*) \/home\/$1\/public_html\/$2\n\n&lt;\/IfModule>\n\n#\n# Control access to UserDir directories.  The following is an example\n# for a site where these directories are restricted to read-only.\n#\n&lt;Directory \"\/home\/*\/public_html\">\n    #AllowOverride FileInfo AuthConfig Limit Indexes\n    #Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec\n        Require method GET POST OPTIONS\n        AllowOverride All\n        Options +ExecCGI\n        AddHandler cgi-script .pl .cgi\n&lt;\/Directory>\n\n\n\n\n\u30e6\u30fc\u30b6\u30fc\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210\n\n\u30e6\u30fc\u30b6\u30fc\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u4e00\u62ec\u4f5c\u6210\u30b9\u30af\u30ea\u30d7\u30c8\u4f5c\u6210\n&#91;root@falcon21 ~]# vi userdirmake\u3000\n#!\/bin\/bash\n\nfor user in `ls \/home`\ndo\n    id $user > \/dev\/null 2>&amp;1\n    if &#91; $? -eq 0 ] &amp;&amp; &#91; ! -d \/home\/$user\/public_html ]; then\n        mkdir -p \/home\/$user\/public_html\n        chown $user. \/home\/$user\/public_html\n        chmod 711 \/home\/$user\n        echo $user\n    fi\ndone\n\n\n\n----------------------\n\n\u30e6\u30fc\u30b6\u30fc\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u4e00\u62ec\u4f5c\u6210\u30b9\u30af\u30ea\u30d7\u30c8\u5b9f\u884c\n&#91;root@falcon21 ~]# bash userdirmake\n\n\u78ba\u8a8d\n&#91;root@falcon21 ~]# ll \/home\n\u5408\u8a08 0\ndrwx--x--x. 4 xxxxxx  xxxxxx   97 11\u6708 12 15:13 xxxxxx\ndrwx--x--x. 5 yyyyyy yyyyyy 133 11\u6708 12 15:13 yyyyyy\ndrwx--x--x. 4 zzzzzz zzzzzz  97 11\u6708 12 15:13 zzzzzz\n\n\n\n----------------------\n\n\u30e6\u30fc\u30b6\u30fc\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u4e00\u62ec\u4f5c\u6210\u30b9\u30af\u30ea\u30d7\u30c8\u524a\u9664\n&#91;root@falcon21 ~]# rm -f userdirmake\u3000\u3000\n\n\n\u65b0\u898f\u30e6\u30fc\u30b6\u30fc\u8ffd\u52a0\u6642\u306b\u30e6\u30fc\u30b6\u30fc\u30c7\u30a3\u30ec\u30af\u30c8\u30ea(~\/public_html\u30c7\u30a3\u30ec\u30af\u30c8\u30ea)\u304c\u81ea\u52d5\u3067\u4f5c\u6210\u3055\u308c\u308b\u3088\u3046\u306b\u3059\u308b \n\n\u30e6\u30fc\u30b6\u30fc\u8ffd\u52a0\u6642\u306b~\/public_html\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u304c\u81ea\u52d5\u3067\u4f5c\u6210\u3055\u308c\u308b\u3088\u3046\u306b\u3059\u308b\n&#91;root@falcon21 ~]# mkdir \/etc\/skel\/public_html\n\u3000\n\n\u30e6\u30fc\u30b6\u30fc\u30a6\u30a7\u30d6\u30c6\u30b9\u30c8\u30da\u30fc\u30b8\u4f5c\u6210\n\n\n\/home\/xxxxxx\/public_html \u306b\u3001\u30c6\u30b9\u30c8\u30da\u30fc\u30b8\u4f5c\u6210\u30fb\u8868\u793a\u78ba\u8a8d\nxxxxxx@falcon21:~$vi public_html\/index.html\u3000\u3000\u3000\u3000\n&lt;html>\n&lt;body>\n&lt;h1 style=\"width: 100%; font-size: 40px; text-align: center;\">\nhayato_Dir Test Page\n&lt;\/h1>\n&lt;\/body>\n&lt;\/html>\n\n\u30a6\u30a7\u30d6\u30da\u30fc\u30b8\u8868\u793a\u78ba\u8a8d\nhttp:&#47;&#47;192.168.10.3\/xxxxxx\/\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000xxxxxx_Dir Test Page\n\n\u30b5\u30fc\u30d0\u30fc\u30c7\u30b9\u30af\u30c8\u30c3\u30d7\u30fbfirefox \u3067\u8868\u793a\u3000\n\n***********************************************************************\n\n\n\u30a2\u30af\u30bb\u30b9\u5236\u9650\u30da\u30fc\u30b8\u8a2d\u5b9a\u3000htpasswd\nhtpasswd \u8a2d\u5b9a\nroot@falcon21:~# htpasswd -c \/etc\/httpd\/conf\/.htpasswd xxxxxx\nNew password:\nRe-type new password:\nAdding password for user xxxxxx\n\n\nhtpasswd\u3000\u306b\u30e6\u30fc\u30b6\u30fc\u3092\u8ffd\u52a0 \u8a2d\u5b9a\u3000-c \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u5916\u3059\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000# htpasswd \/etc\/httpd\/conf\/.htpasswd \u30e6\u30fc\u30b6\u30fc\u540d\nroot@falcon21:~# htpasswd \/etc\/httpd\/conf\/.htpasswd yyyyyyy\nNew password:\nRe-type new password:\nAdding password for user yyyyyy\n\nroot@falcon21:~# htpasswd \/etc\/httpd\/conf\/.htpasswd zzzzzz\nNew password:\nRe-type new password:\nAdding password for user zzzzzz\n\n\n\u78ba\u8a8d\n&#91;root@falcon21 ~]# cat \/etc\/httpd\/conf\/.htpasswd\n\n\n----------------\n.htaccess \u30d5\u30a1\u30a4\u30eb\u306e\u4f5c\u6210\n\u3000\u3000\u3000\/home \/user \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u30fc\u3054\u3068\u306b\u4f5c\u6210\u3057\u3066\u3001\u5fc5\u8981\u6642\u306e\u307f\u305d\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u30fc\u306b\u30b3\u30d4\u30fc\u3057\u3066\u3001\u5229\u7528\n\n&#91;root@falcon21 ~]# su - xxxxxx\n\u6700\u7d42\u30ed\u30b0\u30a4\u30f3: 2025\/11\/12 (\u6c34) 16:45:20 JST \u7aef\u672b:pts\/1\n\n&#91;xxxxxx@falcon21 ~]$ vi .htaccess\n\nAuthUserFile \/etc\/httpd\/conf\/.htpasswd\nAuthGroupFile \/dev\/null\nAuthName \"secret page\"\nAuthType Basic\nrequire valid-user\n\n&#91;xxxxxx@falcon21 ~]$ cp -f .htaccess public_html\/\n\n----------------\n\u30a2\u30af\u30bb\u30b9\u5236\u9650\u30da\u30fc\u30b8\u8868\u793a\u78ba\u8a8d\nhttp:\/\/192.168.10.3\/xxxxxx\/\n\n\n----------------\n\n\u30a2\u30af\u30bb\u30b9\u5236\u9650\u7528\u30da\u30fc\u30b8\u3092\u3000shtml\u3067\u4f5c\u6210\n&#91;root@falcon21 ~]# su - xxxxxx\n\u6700\u7d42\u30ed\u30b0\u30a4\u30f3: 2025\/11\/12 (\u6c34) 16:33:14 JST \u7aef\u672b:pts\/1\n\n&#91;xxxxxx@falcon21 ~]$ vi public_html\/index.shtml\n&lt;html>\n&lt;head>\n&lt;meta http-equiv=\"Content-Type\" content=\"text\/html; charset=UTF-8\">\n&lt;title>\u30c6\u30b9\u30c8&lt;\/title>\n&lt;body>\n&lt;p>.htaccess\u306b\u30a2\u30af\u30bb\u30b9\u5236\u9650\u30da\u30fc\u30b8&lt;\/p>\n\u3053\u306e\u30da\u30fc\u30b8\u306f\u3001index.shtml \u4f7f\u7528\u3000&lt;!--#echo var=\"DOCUMENT_NAME\" -->\n&lt;\/body>\n&lt;\/html>\n~\n----------------\n\n\u540c\u3058\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u30fc\u306b\u3001index.html \u304c\u3042\u308b\u5834\u5408\u306f\u3001\u3053\u3061\u3089\u304c\u512a\u5148\u3055\u308c\u308b\u3002\n\n.htaccess\u30d5\u30a1\u30a4\u30eb\u3092 \/home\/yyyyyy\/public_html \u306b\u30b3\u30d4\u30fc\u3057\u3066\u3001\u30c6\u30b9\u30c8\n&#91;root@falcon21 ~]# cp \/home\/.htaccess \/home\/yyyyyy\/public_html\/\n\n\/home\/yyyyyy\/public_html \u306b\u30c6\u30b9\u30c8\u30da\u30fc\u30b8\u4f5c\u6210\n&#91;root@falcon21 ~]# echo test >> \/home\/yyyyyy\/public_html\/index.html\n\n\u3000\u3000\u3000\u3000\u3000192.168.10.3\/yyyyyy\/ \u3000\u30fb\u30fb\u30fb\u305d\u306e\u307e\u307e\u8868\u793a\u3001\u30d1\u30b9\u30ef\u30fc\u30c9\u8981\u6c42\u304c\u51fa\u306a\u3044\u3002\n.htaccess\u304c\u6709\u52b9\u306b\u306a\u3089\u306a\u3044\u3002\n&lt;\/pre><\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-209","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/falcon21.space\/kazuya\/work\/index.php?rest_route=\/wp\/v2\/pages\/209","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/falcon21.space\/kazuya\/work\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/falcon21.space\/kazuya\/work\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/falcon21.space\/kazuya\/work\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/falcon21.space\/kazuya\/work\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=209"}],"version-history":[{"count":1,"href":"https:\/\/falcon21.space\/kazuya\/work\/index.php?rest_route=\/wp\/v2\/pages\/209\/revisions"}],"predecessor-version":[{"id":212,"href":"https:\/\/falcon21.space\/kazuya\/work\/index.php?rest_route=\/wp\/v2\/pages\/209\/revisions\/212"}],"wp:attachment":[{"href":"https:\/\/falcon21.space\/kazuya\/work\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=209"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}