【お題】王手、そして

現在fedora core4 -Apache- でサーバー構築を勉強中なのですが、どうしても解決できない問題が出ました。それはユーザーディレクトリを生成した後、そのディレクトリにアクセスできないという問題です。
ユーザー[testuser]を追加し、/home/testuser/public_htmlを作成後
/home/testuser/public_html/index.htmlを作成、
httpd.confの設定を
<IfModule mod_userdir.c>

#UserDir disable


UserDir /home/*/public_html/
</IfModule>

#
# 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
# Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Directory /home/*/public_html>
AllowOverride All
Options IncludesNoExec ExecCGI FollowSymLinks
<Limit GET POST OPTIONS>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>
とし、ttp://www.testsrv.net/~testuserにアクセスしたところ、
You don't have permission to access /~user1 on this server.
アクセス権が無いとはじかれました。
この場合、アクセスできるようにするにはどのようにすれば良いのでしょうか?

A 回答 (2件)

まず、UserDir の記述ですが、


 UserDir public_html
だけでOKです。

次に、ディレクトリ・ファイルの権限ですが、所有者(testuser)以外、つまり、
Apacheプロセスの所有者に、チェンジディレクトリの許可、ファイル読み込みの許可が
振られていますか?


Apacheプロセスがチェンジディレクトリするためには、自分以外の所有者権にxが必要です。
Apacheプロセスがファイルを読むためには、自分以外の所有者権にrが必要です。

[/home/hoge/public_html/index.html]

drwxr-xr-x  4 root root 1024 2月 19 17:09 home/

drwxr-xr-x 15 hoge hoge 1024 3月  9 22:13 hoge/

drwxr-xr-x  2 hoge hoge 1024 3月  9 22:13 public_html/

-rw-r--r--  1 hoge hoge  85 3月  9 22:13 index.html


>とし、​www.testsrv.net/~testuser​にアクセスしたところ、
>You don't have permission to access /~user1 on this server.
>アクセス権が無いとはじかれました

ところで、testuser を作成したのに、user1 でアクセスしてるんですか?
何がしたいのでしょう?

この回答への補足

申し訳ありません。
記入ミスでした。正しくは、
ou don't have permission to access /~testuser on this server.
でした。

補足日時:2006/03/10 02:27
    • good
    • 0
この回答へのお礼

補足:
xid様のご指摘どおり
drwxr-xr-x  4 root root 1024 2月 19 22:00 home

drwxr-xr-x 8 testuser testuser 1024 3月  9 22:00 testuser

drwxr-xr-x  2 testuser testuser 1024 3月  9 22:00 public_html

-rw-r--r--  1 testuser testuser  85 3月  9 22:00 index.html

としましたが、状況は変わりませんでした。
どうすれば良いのでしょうか?

お礼日時:2006/03/10 02:45

エラーログにはなんて書いてありますか?

この回答への補足

error_logには

(13)Permission denied: a ccess to /~testuser denied

となっています。

補足日時:2006/03/10 02:30
    • good
    • 0

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!


おすすめ情報