跳转至内容

MythWeb

来自 ArchWiki

MythWeb 是 MythTV 的一个 Web 界面

安装

在安装 MythWeb 之前,请先按照 Apache HTTP ServerApache HTTP Server#PHP 中的描述设置好 Apache 和 PHP。

安装 mythplugins-mythwebAUR 包。

配置

MythTV 集成

MythWeb 会在 video_dir 目录中查找 MythTV 的录制文件。创建一个指向你的 MythTV 录制文件存储目录的链接。

# ln -s recording_dir /var/lib/mythtv/mythweb/video_dir

MythWeb

将 MythWeb 的配置文件 mythweb.conf 复制到 Apache HTTP Server 的配置文件目录。

# cp /var/lib/mythtv/mythweb/mythweb.conf.apache /etc/httpd/conf/extra/mythweb.conf

并在 /etc/httpd/conf/httpd.conf 的底部包含它

Include conf/extra/mythweb.conf

如果你想使用 MythWeb 中启用的最新默认 mythweb.conf 选项,你还需要在 httpd.conf 中取消注释以下行:

LoadModule rewrite_module modules/mod_rewrite.so
LoadModule deflate_module modules/mod_deflate.so

你还需要启用 CGI,请在 httpd.conf 中取消注释以下行:

<IfModule !mpm_prefork_module>
        LoadModule cgid_module modules/mod_cgid.so
</IfModule>
<IfModule mpm_prefork_module>
        LoadModule cgi_module modules/mod_cgi.so
</IfModule>

编辑 mythweb.conf,使其指向 mythweb 的安装目录(在文件开头附近)。

<Directory "/srv/http/mythweb/data">
<Directory "/srv/http/mythweb" >

然后检查配置是否与你的 MythTV 设置匹配。如果你更改了数据库登录名或密码,你需要更改以下部分。无论如何,请仔细检查以下行是否已取消注释:

setenv db_server        "localhost"
setenv db_name          "mythconverg"
setenv db_login         "mythtv"
setenv db_password      "mythtv"

PHP

编辑 PHP 配置文件 /etc/php/php.ini

在 _动态扩展_ 部分取消注释以下行。

extension=mysqli

确保 open_basedir 包含 /srv/http//var/lib/mythtv/mythweb,以便在 MythWeb 目录中进行文件操作。从 MythTV 0.23 开始,你还需要允许访问 /usr/share/mythtv/

open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/:/var/lib/mythtv/mythweb:/usr/share/mythtv/

为 MythWeb 的状态页面启用 allow_url_fopen 选项,使其能够正常工作。

allow_url_fopen = On
# chmod 755 -R /var/lib/mythtv/
# ln -s /var/lib/mythtv/mythweb /srv/http/

使用 MythWeb

你现在可以通过 启动 httpd.service systemd 服务来启动 Apache 守护进程。_mythbackend_ 必须已在运行。

在浏览器中打开 MythWeb。

https:///mythweb

保护 MythWeb 安全

如果你打算允许从互联网进行连接,那么为 MythWeb 设置密码保护可能是一个好主意。要启用身份验证,请取消注释身份验证部分(在文件开头附近)。

/etc/httpd/conf/extra/mythweb.conf
AuthType           Digest
AuthName           "MythTV"
AuthUserFile       /var/www/htdigest
Require            valid-user
BrowserMatch       "MSIE"      AuthDigestEnableQueryStringHack=On
Order              allow,deny
Satisfy            any

现在,我们需要修复配置以匹配 MythWeb 的设置,将 AuthUserFile 更改为:

AuthUserFile       /etc/httpd/conf/extra/httpd-passwords

如果你不想从 IE 访问 MythWeb,可以删除 BrowserMatch 行。

你可能也不希望在从本地计算机连接时输入密码,所以在这最后两行之间添加以下行:

Allow from 127. 192.168.1.

这将允许从你的本地计算机_以及_你的本地网络进行无密码访问(前提是你使用的是 192.168.1.0 255.255.255.0 子网)。

现在配置应该看起来像这样:

AuthType           Digest
AuthName           "MythTV"
AuthUserFile       /etc/httpd/conf/extra/httpd-passwords
Require            valid-user
Order              allow,deny
Allow from 127. 192.168.1.
Satisfy            any

保存文件。

接下来,我们将创建 httpd-passwords 文件:

# htdigest -c /etc/httpd/conf/extra/httpd-passwords MythTV myuser

其中 _myuser_ 是你想用来访问 MythWeb 的用户名。在提示时输入登录密码。

如果你需要更多用户,请省略 -c - 否则你将覆盖当前文件。

# htdigest /etc/httpd/conf/extra/httpd-passwords MythTV myuser2

现在我们只需要 重新启动 apache 的 httpd.service 服务,以便更改生效。

故障排除

如果你收到 403 Forbidden 错误,请重新检查 mythweb.conf 中的路径。

如果你无法启动 apache 服务,并收到类似以下的错误:

# journalctl -u httpd
...
AH00013: Pre-configuration failed
...

httpd.conf 中注释掉以下行:

LoadModule mpm_event_module modules/mod_mpm_event.so

并改用 prefork 模块:

LoadModule mpm_prefork_module modules/mod_mpm_prefork.so

参见

© . This site is unofficial and not affiliated with Arch Linux.

Content is available under GNU Free Documentation License 1.3 or later unless otherwise noted.