ユーザーディレクトリ一括作成スクリプト作成
publichtmlではなく、html を作成
[root@falcon21 ~]# vi userdirmake
#!/bin/bash

for user in `ls /home`
do
id $user > /dev/null 2>&1
if [ $? -eq 0 ] && [ ! -d /home/$user/html ]; then
mkdir -p /home/$user/html
chown $user. /home/$user/html
chmod 711 /home/$user
echo $user
fi
done
----------------

[root@falcon21 ~]# sh userdirmake

***********************************

ユーザーディレクトリ一設定
[root@falcon21 ~]# vi /etc/httpd/conf.d/userdir.conf

<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 disabled

 

#
# To enable requests to /~user/ to serve the user's public_html
# directory, remove the "UserDir disabled" line above, and uncomment
# the following line instead:
#
UserDir html
AliasMatch ^/anpachi(.*) /home/anpachi/html/$1 // publichtmlではなく、html ~も無しで、
AliasMatch ^/hayato(.*) /home/hayato/html/$1
AliasMatch ^/kazuya(.*) /home/kazuya/html/$1
AliasMatch ^/blender(.*) /home/blender/html/$1
AliasMatch ^/anthy(.*) /home/anthy/html/$1
#AliasMatch ^/userdir/([^/]+)/(.*) /home/$1/html/$2

</IfModule>

#
# Control access to UserDir directories. The following is an example
# for a site where these directories are restricted to read-only.
#
<Directory "/home/*/html">

AllowOverride All
Options IncludesNoExec ExecCGI FollowSymLinks
Require method GET POST OPTIONS

# AllowOverride FileInfo AuthConfig Limit Indexes
# Options ExecCGI MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
# Require method GET POST OPTIONS
# Options IncludesNoExec ExecCGI FollowSymLinks
</Directory>

*************************************************

投票数:2 平均点:10.00

 
Back to Top