【CentOS7の場合】
[root@centos ~]# vi /etc/httpd/conf.d/userdir.conf ← userdir設定ファイル編集
<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 ← #を追加(コメントアウト)
#
# 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 ← 行頭の#を削除(コメント解除)
AliasMatch ^/centos(.*) /home/centos/public_html/$1
← centosユーザーのみhttp://centossrv.com/centos/のように~(チルダ)なしでアクセスできるようにする
AliasMatch ^/userdir/([^/]+)/(.*) /home/$1/public_html/$2
← 全てのユーザーでhttp://centossrv.com/userdir/ユーザー名/でアクセスできるようにする
</IfModule>
<Directory "/home/*/public_html">
AllowOverride All ← .htaccessの許可
Options IncludesNoExec ExecCGI FollowSymLinks ← CGI,SSI(Exec命令以外)の許可
Require method GET POST OPTIONS
</Directory>
|
|