« MythDoraのインストール後の設定(PART4) | メイン | サビーヌ兄弟 »

2008年04月20日

●MythDoraのMythWeb設定(PART1)

やっぱりブラウザから録画予約とか色々出来たほうが便利な訳です。
もちろん、MythTVにはMythWebというものがあり、MythDoraではデフォルトでインストールされて
なおかつ最初から使用可能です。(最初から設定すると、結構大変だったりします。)
で、初期の状態だとhttp://localhost/mythwebでアクセス可能になっていると思います。
私の場合、諸事情により上記のURLでアクセスするのは不可能なため、特定のユーザを作成して
そこのホームディレクトリの下で動作させるようにしてみました。


■mythwebディレクトリのバックアップ

MythDoraでは、/var/www/html/mythwebでMythWebが動作するようになっています。
ですので、まずバックアップをとります。

[root@kororin html]# cd /var/www/html
[root@kororin html]# pwd
/var/www/html
[root@kororin html]# ls -la
合計 36
drwxr-xr-x 4 root root 4096 2月 17 17:58 .
drwxr-xr-x 6 root root 4096 2月 17 09:42 ..
-rw-r--r-- 1 root root 39 4月 10 2007 index.php
drwxrwxr-x 11 apache apache 4096 2月 17 09:54 mythweb

バックアップします。
[root@kororin html]# tar cvf mythweb.tar mythweb/
[root@kororin html]# gzip mythweb.tar

[root@kororin html]# mv index.php index.php.org
[root@kororin html]# view index.php.org

index.phpは私の場合は不要でしたので削除してしまいました。
[root@kororin html]# rm index.php.org
rm: remove 通常ファイル `index.php.org'? yes


■ユーザの作成

適当なユーザを作成します。説明上「hoge」とします。
ユーザの作成はここでは説明しませんので適当に行ってください。
ユーザ作成後は以下の設定をします。
[root@kororin home]# cd /home
[root@kororin home]# chmod 711 hoge


■Apacheの設定変更

[root@kororin html]# cp -p /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.org
[root@kororin html]# vi /etc/httpd/conf/httpd.conf
セキュリティ上あまり詳しくは書けませんが以下のあたりを編集してください。

# UserDir: The name of the directory that is appended onto a user's home
# directory if a ~user request is received.

・UserDir disableの部分とUserDir public_htmlの部分
・以下の部分




・以下の部分
# Don't give away too much information about all the subcomponents
# we are running. Comment out this line if you don't mind remote sites
# finding out what major optional modules you are running
ServerTokens

・以下の部分
# This should be changed to whatever you set DocumentRoot to.
#

設定変更後はApacheの再起動を忘れずに行ってください。
[root@kororin html]# /etc/rc.d/init.d/httpd stop
[root@kororin html]# /etc/rc.d/init.d/httpd start


■ファイルの展開と設定

さきほどバックアップしたmythweb.tar.gzを展開します。
まずは、hogeのディレクトリに移動します。
[root@kororin html]# mv /var/www/html/mythweb.tar.gz /home/hoge/

ユーザをhogeに変更します。
[root@kororin html]# su - hoge
[hoge@kororin ~]$ mkdir public_html
[hoge@kororin ~]$ mv mythweb.tar.gz /home/hoge/public_html/
[hoge@kororin ~]$ cd public_html/
[hoge@kororin ~]$ tar zxvf mythweb.tar.gz
[hoge@kororin mythweb]$ cd mythweb
[hoge@kororin mythweb]$ vi .htaccess

RewriteBaseの部分を以下の様に編集します。

# If MythWeb is installed outside of the document root (eg. using Alias) then
# you will need to set this directive to the base URL that MythWeb is visible
# from externally. If you do not, the web server will return 'not found'. eg.
# RewriteBase /mythweb

RewriteBase /~hoge/mythweb

お疲れ様でした。
これで、準備はOKです。
http://localhost/~hoge/mythwebにアクセスしてみましょう。
ページは表示出来ましたか!?
実はまだこれだけでは問題があるのですが、続きは次回に。

トラックバックURL

このエントリーのトラックバックURL:
http://kororin.com/cgi-bin/mt32/mt-tb.cgi/383

コメントする

(初めてのコメントの時は、コメントが表示されるためにこのブログのオーナーの承認が必要になることがあります。承認されるまでコメントは表示されませんのでしばらくお待ちください)