現在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.
アクセス権が無いとはじかれました。
この場合、アクセスできるようにするにはどのようにすれば良いのでしょうか?
No.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.
でした。
補足:
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
としましたが、状況は変わりませんでした。
どうすれば良いのでしょうか?
お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!
おすすめ情報
- ・漫画をレンタルでお得に読める!
- ・街中で見かけて「グッときた人」の思い出
- ・「一気に最後まで読んだ」本、教えて下さい!
- ・幼稚園時代「何組」でしたか?
- ・激凹みから立ち直る方法
- ・1つだけ過去を変えられるとしたら?
- ・【あるあるbot連動企画】あるあるbotに投稿したけど採用されなかったあるある募集
- ・【あるあるbot連動企画】フォロワー20万人のアカウントであなたのあるあるを披露してみませんか?
- ・映画のエンドロール観る派?観ない派?
- ・海外旅行から帰ってきたら、まず何を食べる?
- ・誕生日にもらった意外なもの
- ・天使と悪魔選手権
- ・ちょっと先の未来クイズ第2問
- ・【大喜利】【投稿~9/7】 ロボットの住む世界で流行ってる罰ゲームとは?
- ・推しミネラルウォーターはありますか?
- ・都道府県穴埋めゲーム
- ・この人頭いいなと思ったエピソード
- ・準・究極の選択
- ・ゆるやかでぃべーと タイムマシンを破壊すべきか。
- ・歩いた自慢大会
- ・許せない心理テスト
- ・字面がカッコいい英単語
- ・これ何て呼びますか Part2
- ・人生で一番思い出に残ってる靴
- ・ゆるやかでぃべーと すべての高校生はアルバイトをするべきだ。
- ・初めて自分の家と他人の家が違う、と意識した時
- ・単二電池
- ・チョコミントアイス
デイリーランキングこのカテゴリの人気デイリーQ&Aランキング
-
延長コードについて 延長コード...
-
Dell Inspiron 14 5415 をコン...
-
内蔵BDドライブを、外付けで使...
-
usb転送:充電ケーブル端子部分の色
-
USBハブの故障?寿命?について
-
自分のパソコンのデバイスマネ...
-
au光回線について
-
USB3.0ケーブルは売っているか
-
ダイハツミライースの車にUSB接...
-
USBケーブルが、充電専用ケーブ...
-
外付けハードディスクをUSB接続...
-
画面が割れてタッチセンサが壊...
-
会社用のPCから私物のUSBにデー...
-
パソコンで購入したデーターが...
-
ウェブカメラのコードが短いの...
-
Steam裏では起動してるんだけど...
-
ディズニープラスの繋ぎ方
-
物理サーバーと仮想サーバーっ...
-
オーディオインターフェースの...
-
USB-C DCケーブルを探していま...
マンスリーランキングこのカテゴリの人気マンスリーQ&Aランキング
-
スプレッド ヘッダの文字の折...
-
ユーザディレクトリの意味を表...
-
写真集のサーバーを作りたいと...
-
パーパーフェクトPHP[技術評論...
-
apache2:インディックスページ...
-
ローカルwebサーバーをたてたが...
-
.htaccessの反映
-
redmineをapacheで起動したいの...
-
サイトリニューアル時のリダイ...
-
「DNSサーバーを自動的に取得す...
-
パスワード設定していないユー...
-
同一のホスト名で何か問題があ...
-
DNSサーバを設定したのですがns...
-
エラーメールで"too many hops"...
-
リモートデスクトップ接続でパ...
-
”Tortoise SVN” と ”Subversio...
-
Mailの送信済みメールボックス...
-
循環参照にならない方法があっ...
-
同じ独自ドメインを2つのサーバ...
-
エクセルで#N/Aを含めた平均値...
おすすめ情報