Memo

メモ > サーバ > 各論: エトセトラ > Apacheでユーザディレクトリ

■Apacheでユーザディレクトリ
http://example.com/~refirio/ のようなURLを使えるようにする
# vi /etc/httpd/conf/httpd.conf … httpdの設定ファイルを編集
<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 UserDir enabled … enabledに変更 (Apache再起動時に「UserDir "enable" keyword requires」のエラーなるようなら、コメントアウトする) # # 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 public_html UserDir "/home/*/public_html" … ユーザディレクトリの場所を設定 </IfModule>
# service httpd configtest … 設定ファイルの構文をチェック # service httpd restart … Apacheを再起動 httpd を停止中: [ OK ] httpd を起動中: [ OK ]
上の場合、/home/refirio/public_html/index.html には /~refirio/ でアクセスできるようになる ApacheでUserDir公開の、メモ書き http://qiita.com/ms2sato/items/299278b2492c96cb80ae

Advertisement