MythWeb on Lighttpd

MythWeb provides a frontend for scheduling and managing recordings on your MythBox from a web browser located on any machine. In addition, it allows for changing key bindings and other settings.

This guide will provide you with a way to run MythWeb on Lighttpd rather then apache. Lighttpd has the benefit of faster page loading times for MythWeb, but comes at the expense of a longer setup time (which should be helped by this guide).

Installing

Before we get anywhere we need to install the programs needed for this. Use your package manager or compile from source.

PHP

Gentoo would use the following USE Flags:
cgi cli discard-path force-cgi-redirect mysql ssl pcre

Lighttpd

A default compile should pull everything needed in and the USE Flags for Gentoo would be: fastcgi mysql pcre php ssl

MythWeb

You need to copy the MythWeb files over to your web server's path. On some systems, that is /var/www/localhost/htdocs/
I also put MythWeb into a directory called mythweb and the rest of the guide will follow the layout of the path being /var/www/localhost/htdocs/mythweb/ and the address being http://localhost/mythweb, change to suit your needs.

Configuring

With everything installed we next need to configure our software for use.

PHP

Only one option here needs changing else you will be seeing the following error quite alot:

Error at /var/www/localhost/htdocs/modules/weather/handler.php, line 96:
file() [function.file]: URL file-access is disabled in the server configuration

You need to open your php.ini which in Gentoo's case is /etc/php/cgi-php5/php.ini and change the following:

allow_url_fopen = On

The above command allows URLs to be treated as files.

Lighttpd

There are many options in here that need changing to allow MythWeb to work.

fastcgi.server

MythWeb needs a php in cgi mode so we need to enable the module mod_fastcgi in the lighttpd.conf file as so:

server.modules = (
mod_fastcgi
)

We need to configure fastcgi for PHP use so open the config file for it and leaving the parts which are already there as it may break you install we need to add the following line:

The above code needs to go into mythtv/include/objects/Database.php around line 90 which is just under the following section:

/**
* Legacy constructor to catch things that the abstract classification won't
/**/
function Database() {
trigger_error('The Database class should never be created as an object. Use Database::connect() instead.', E_USER_ERROR);
}

After saving you should notice the error has gone from all the pages and now MythWeb fully works as it would with Apache.

If Mythweb doesn't display correctly

Symptom:

Page loads without error and just shows two "MythTV" links to ~/mythweb/root_url.

Secure MythWeb on Lighttpd

You sometimes hear stories of people gaining access to other peoples MythTV setup via the Internet so lets look into ways of securing MythWeb but still leaving access to MythWeb from the outside in case we ever need to access it from work or from a friends (or show off :D).

Auth (Password)

Nice and simple, lets put an username and password on the directory so then only we can access it.