Tuesday, November 15, 2016

Fixing MythTV's mythexport Web Interface on Ubuntu Server 16.04

In the current versions of Ubuntu mythexport installs to /var/www, however the new home for the www-data user is /var/www/html. mythexport still creates a symlink /var/www/mythexport which points to /usr/share/mythtv/mythexport. The perl mythtv bindings look in the www-data home directory for the .mythtv folder, which according to /etc/passwd is /var/www. So make sure there is a .mythtv folder and .mythtv/config.xml file symlinked to /etc/mythtv/config.xml. Move the mythexport symlink from /var/www/mythexport to /var/www/html/mythexport:
mv /var/www/mythexport /var/www/html/mythexport
Next since mythexport uses some hardcoded paths in the source code, we need to find all instances of /var/www and replace them with /var/www/html. To do this use grep:
pushd /usr/share/mythtv/mythexport grep -E "\/var\/www" *.cgi
Looks like we need to change two files:
mythexportRSS.cgi: my $file_len = -s "/var/www/mythexport/video/$rss_file"; save_system_setup.cgi:sudo mkdir -p $location && sudo chmod 775 $location && sudo chown mythtv:mythtv $location && sudo ln -s -f $location /var/www/mythexport/video


vi mythexportRSS.cgi
Search and replace vim command: %s/\/var\/www/\/var\/www\/html/g
Then edit save_system_setup.cgi with the same vim command.
I also notice the mythexport apache configurations file was in sites-available and not in sites-enabled. So I ran the commands:
a2ensite mythexport service apache2 restart /etc/init.d/mythexport restart
You should now be able to browse to http://mythtv_ip/mythexport and setup your configuration.

No comments:

Post a Comment