アプリ版:「スタンプのみでお礼する」機能のリリースについて

こんにちは。

Fedora8でApache2を動かしています。
セキュリティではSELinexを使用しています。
Apache2でhttp://localhost/ のページはきちんと表示できるのですが、
ユーザーページ(http://localhost/~user/)が表示されません。
httpd.confのユーザーの設定はしてあります。
(モージュールも確認しました。)
また、ユーザーページを指定しているフォルダ(/home/*/pubilc_html)も
/home/user/pubilc_htmlを作ってあり、
pubilc_htmlの中に、index.htmlを配置してあります。
それなのに、ユーザーページにアクセスすると、404エラーが表示されてしまいます。
ファイルはあるのに、web上では無いよと言われます。
セキュリティの面が関連しているのかと思い、
動作を停止させてみましたが症状はかわりませんでした。

どのように対処すれば、ユーザーページを表示できるようになりますでしょうか?
よろしくお願いします。

A 回答 (4件)

http://localhost/~user/index.html

って入力しても表示されませんか?

この回答への補足

index.htmlを付けてみましたが、
表示されませんでした。
何故か、404エラーになります。

補足日時:2008/02/13 17:09
    • good
    • 0

httpd.confの、



<Directory /home/*/public_html>
</Directory>

の間の記述はどうなっていますか?

DirectoryIndex
UserDir disable

のあたりもチェックして下さい。
ファイル、ディレクトリのパーミッションもついでに。

この回答への補足

httpd.confのユーザー関連とDirectoryIndexの記述内容です。

#
# UserDir: The name of the directory that is appended onto a user's home
# directory if a ~user request is received.
#
# The path to the end user account 'public_html' directory must be
# accessible to the webserver userid. This usually means that ~userid
# must have permissions of 711, ~userid/public_html must have permissions
# of 755, and documents contained therein must be world-readable.
# Otherwise, the client will only receive a "403 Forbidden" message.
#
# See also: http://httpd.apache.org/docs/misc/FAQ.html#forbi …
#
<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

</IfModule>

#
# Control access to UserDir directories. The following is an example
# for a site where these directories are restricted to read-only.
#
<Directory /home/*/pubilc_html>
AllowOverride All
Options ExecCGI MultiViews 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>

#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
# The index.html.var file (a type-map) is used to deliver content-
# negotiated documents. The MultiViews Option can be used for the
# same purpose, but it is much slower.
#
DirectoryIndex index.html index.html.var index.htm


ディレクトリのパーミッションは、
chmod コマンドで、711 755 などを試してみましたがだめでした。
ファイルのパーミッションは、
.htmlなので、644 にしてみましたが、こちらもだめでした。

補足日時:2008/02/13 18:06
    • good
    • 0

見落としがちなのが、ホームディレクトリのパーミションです。


public_htmlに降りてくるために、otherにxが立っている必要があります。

# chmod o+x user

あ、でも、404だと、これが原因ではないか。
httpd.confの設定は間違ってなさそうだし、何が原因なのでしょうね?

# service httpd reload はやってるんですよね?

この回答への補足

>>見落としがちなのが、ホームディレクトリのパーミションです。
public_htmlに降りてくるために、otherにxが立っている必要があります。
この部分は試していませんでした。
o+xのあとがよくわからなかったのですが、
chmod o+x /home
chmod o+x /home/user
でしてみましたが症状は変わりませんでした。
違っていたらすみません。

httpd.conf の設定を変えた時は反映するために、
Apache の再起動のコマンドに、
service httpd reload または、
service httpd restart をしています。
どちらのコマンドも、OK がでるので、
httpd.conf 内の記述ミスはないと思います。

補足日時:2008/02/14 06:29
    • good
    • 0

httpd.confも問題ないようですね。



確認ですが、「user」というアカウントはちゃんとログインできますよね?

この回答への補足

下記のように記述しましたら、
ユーザーのindex.htmlページが表示できるようになりました。
ただ、今度は、ユーザーのエラーページがすべて、
403エラーになってしまいます。
パーミッションは変えたはずなのですが・・・。
(SELinuxはきってあります。)
/home/user/ と /home/user/pubilc_html/ を 711 、
または、755 にしています。
chmod o+x /home/user もしています。
どのように対処すればよろしいでしょうか?
よろしくお願いします。


表示された時の変更点は、
UserDir pubilc_html を、
UserDir home/*/pubilc_html に変えたら表示できました。

補足日時:2008/02/14 11:52
    • good
    • 0
この回答へのお礼

解決しました。
お答えしていただき、ありがとうございました。

お礼日時:2008/02/14 14:33

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