[root@centos ~]# vi /etc/httpd/conf/httpd.conf ← httpd設定ファイル編集
<IfModule mod_userdir.c>
#
# UserDir is disabled by default since it can confirm the presence
# of a username on the system (depending on home directory
# permissions).
#
UserDir disable
↓
#UserDir disable ← #を追加(コメントアウト)
#
# To enable requests to /~user/ to serve the user's public_html
# directory, remove the "UserDir disable" line above, and uncomment
# the following line instead:
#
#UserDir public_html
↓
UserDir public_html ← 行頭の#を削除(コメント解除)
AliasMatch ^/centos(.*) /home/centos/public_html/$1
← centosユーザーのみhttp://wakuwakustation.com/centos/のように~(チルダ)なしでアクセスできるようにする
AliasMatch ^/userdir/([^/]+)/(.*) /home/$1/public_html/$2
← 全てのユーザーでhttp://wakuwakustation.com/userdir/ユーザー名/でアクセスできるようにする
</IfModule>
#<Directory /home/*/public_html>
# AllowOverride FileInfo AuthConfig Limit
# Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
# <Limit GET POST OPTIONS>
# Order allow,deny
# Allow from all
# </Limit>
# <LimitExcept GET POST OPTIONS>
# Order deny,allow
# Deny from all
# </LimitExcept>
#</Directory>
以下の全行追加
<Directory /home/*/public_html>
AllowOverride All ← .htaccessの許可
Options IncludesNoExec ExecCGI FollowSymLinks ← CGI,SSI(Exec命令以外)の許可
<Limit GET POST OPTIONS>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>
|
|