ページ

2012年4月20日金曜日

apacheのユーザーディレクトリの設定

/opt/lampp/etc/httpd.conf を開いて設定する。

475行あたの下の行を見つけて#を外す
# User home directories
Include etc/extra/httpd-userdir.conf

/opt/lampp/etc/extra/httpd-userdir.conf を開いて修正する

# Settings for user home directories
#
# Required module: mod_userdir

#
# UserDir: The name of the directory that is appended onto a user's home
# directory if a ~user request is received.  Note that you must also set
# the default access control for these directories, as in the example below.
#
UserDir "/home/*/public_html"

#
# Control access to UserDir directories.  The following is an example
# for a site where these directories are restricted to read-only.
#
<Directory "/home/*/public_html">
    AllowOverride FileInfo AuthConfig Limit Indexes
    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>

Puppy Linuxにはユーザーとか無いみたいなので、
自分でルートの下にhomeディレクトリを作って、その中に、
ユーザーディレクトリを作ってその中にpublic_htmlディレクトリを作って、
その中にindex.hemlとかを作っておく。

アクセスするには、
http://127.0.0.1/~ユーザーディレクトリ/ と入力する。

他のPCからもアクセスできた。

0 件のコメント:

コメントを投稿