Difference between revisions of "MythWeb"

From MythTV Official Wiki
Jump to: navigation, search
(Time Stamp is off by an hour)
m (Mythweb and PHP 8.0)
 
(100 intermediate revisions by 35 users not shown)
Line 1: Line 1:
== MythWeb ==
+
{{Warning box|MythWeb is no longer being actively developed.  Although not a full replacement, see [[WebFrontend]].}}
 +
{{Note box|MythWeb updates released 13th December 2021 to allow master to work with PHP8. V31 was updated 15 December 2021.}}
 +
{{Cleanup}}
  
MythWeb provides a frontend for scheduling and managing recordings on your MythBox from a web browser located on another machine. Provided the security is set up correctly on your MythBox you can access your machine from anywhere on the internet, or even your mobile phone as long as you have a compatible browser. Of course it is just as useful to browse your myth content from your laptop while your partner is watching their favorite programme. 
+
[[Image:MythWebList.png|thumb|MythWeb TV listings]]
 +
[[Image:MythWebRecorded.png|thumb|MythWeb recorded items]]
 +
MythWeb provides a frontend for scheduling and managing recordings on your MythBox from a web browser located on another machine. Provided the security is set up correctly on your MythBox you can access your machine from anywhere on the internet, or even your mobile phone as long as you have a compatible browser.  
  
Mythweb also has some unique capabilities that are only available through the web interface such as allowing for the change of key bindings and other settings.
+
Mythweb also has some unique capabilities that are only available through the web interface such as allowing for the change of key bindings and other settings. Indeed, many functions you might want to perform on your [[MythBox]] are faster or easier through MythWeb.  Don't confuse this with [[MythBrowser]] which is a web page browser that is accessible through MythFrontend.
 
 
Indeed, many functions you might want to perform on your [[MythBox]] are faster or easier through MythWeb.  (How much this is true, of course, depends to some degree on what version you're running.)
 
 
 
See  [http://svn.mythtv.org/trac/browser/branches/release-0-21-fixes/mythplugins/mythweb/INSTALL MythWeb INSTALL] for details on how to install. (Note this is hard linked to the 0.21-fixes version of this docuemnt)
 
 
 
MythWeb is currently being rewritten to support streaming of content via Flash
 
 
 
One contributed favicon is [[Image:favicon.jpg]] (it's really a .ico file; see the page).
 
 
 
Here is another [http://muchtall.com/content/mythtv/favicon.ico favicon].
 
  
 
== Key Features ==
 
== Key Features ==
 
+
[[Image:MythWebUpcoming.png|thumb|MythWeb upcoming recordings]]
 +
[[Image:MythWebDetails.png|thumb|MythWeb details of a programme]]
 
===TV===
 
===TV===
 
 
Programme Listing
 
Programme Listing
  
Line 34: Line 28:
  
 
===Music===
 
===Music===
Browse your Music Collection and download to your local machine for direct playback
+
Browse your Music Collection and download to your local machine for direct playback.
 +
 
 +
The interface allows you to search and browse the playlists you have set up in [[MythMusic]].
 +
You can also put together new playlists in the web interface.
 +
 
 +
The interface also provides buttons that when pressed will stream the music in the playlist over HTTP to your browser (via a .m3u file). Your browser needs to know what to do with the file - e.g. start up a music player. Not all players seem to cope well with the file that is sent; VLC seems to work ok.
  
 
===Video===
 
===Video===
Line 40: Line 39:
  
 
===Weather===
 
===Weather===
Get weather reports as per MythWeather.
+
[[Image:MythWebWeather.png|thumb|MythWeb weather]]
 +
Get weather reports as per [[MythWeather]].
  
 
===Status===
 
===Status===
Line 49: Line 49:
  
 
===Logs===
 
===Logs===
Show the Server Logs
+
Show the Server Logs
 +
 
 +
In 0.27 database logging is disabled by default, and only enabled via the [[Mythbackend]] command line.
 +
In this case the Server Logs cannot be displayed and an error message is displayed.
  
 
===Settings===
 
===Settings===
  
Configure MythWeb and some of the MythTV settings.
+
Configure MythWeb and some of the MythTV settings such as:
 +
 
 +
* MythWeb session settings
 +
* MythTV global defaults
 +
* MythTV channel info
 +
* MythTV key bindings
 +
* MythTV settings table
  
MythWeb session settings
+
== Installation ==
  
MythTV global defaults
+
For a general installation guide see [[Build from Source]] and navigate to the '''Install MythWeb''' section, otherwise see the distribution specific pages.
  
MythTV channel info
+
== Usage ==
  
MythTV key bindings
+
Once MythWeb is installed, you can simply access MythWeb from any web browser.
  
MythTV settings table
+
URL for accessing mythweb from browser on same machine as MythTV use
 +
      http://localhost:80/mythweb
 +
      or
 +
      http://127.0.0.1:80/mythweb
  
==Gallery==
+
URL for remote access to MythTV from home network use
 +
      http://192.168.0.100:80/mythweb (replace 192.168.0.100 with your local IP address)
 +
      or
 +
      http://mythtv-hostname:80/mythweb (you can use the computername you assigned to the MythTV PC)
  
<gallery>
+
URL for remote access to MythTV from Internet use
Image:MythWebWeather.png
+
      http://45.45.45.45:80/mythweb (45.45.45.45 is your WAN IP.)
Image:MythWebDetails.png
+
      (If you don't know your WAN IP, use www.whatismyip.com to figure this out)
Image:MythWebList.png
+
 
Image:MythWebRecorded.png
+
However, you will not be able to remotely access your MythTV machine until you open the port to your PC. You need to enter your home router and enable port forwarding. You need to manually change some settings in your router that let it know that you want traffic from outside the home network to enter your home network. And you want that outside traffic to be sent directly to 192.168.0.100 (the IP address of the MythTV backend) on port number 80 (which is the default port for the apache HTTP server).
Image:MythWebUpcoming.png
+
 
</gallery>
+
Also note that your ISP may block all traffic on port 80 because they do not want residential customers to be running HTTP servers. So you may need to change the default port 80 to some other number (e.g. 8080). Don't forget to change your router's settings to forward port the incoming port 8080 to the internal network's port 80.
 +
 
 +
Importantly most users have dynamically assigned IP addresses from their ISP. This means that your ISP can change your WAN IP at any time and if this occurred while your away from your home, you would not know what the new IP address is and therefore you would not be able to access your MythTV  remotely.  The way to prevent this from happening is to use dynamic DNS. There are many free choices which will allow you to map any changes that your ISP makes to your home IP address. This will allow you to maintain a connection to your home computer regardless if any changes to your IP address were made.
  
==Grease Monkey Scripts==
+
Lastly, don't forget that you still need to modify your home computer's configuration to grant your remote computer access. This means that you may need to change a few files. Notably, if you're accessing a linux systems (ubuntu/kubuntu/etc), change these files: /etc/hosts.allow and /etc/hosts.deny.
  
To enhance your MythWeb experience:
 
* Removes Duplicates from search results - http://userscripts.org/scripts/show/29459
 
  
  
== Securing Mythweb ==
+
=== Favicons For Your Server ===
If your web server is accessible from the internet it is important that you secure MythWeb with some kind of authentication. This guide will take you through setting up simple password authentication. Please see the Apache [http://httpd.apache.org/docs-2.0/howto/auth.html] for more specifics or more secure methods.
 
  
There are several ways to secure [[MythWeb]]:
+
Here is a [https://www.muchtall.com/content/mythtv/favicon.ico favicon].
* Modify the [[#MythWeb_.htaccess|MythWeb .htaccess]] file to require password authentication
 
* Modify the [[#Apache_Configuration|Apache configuration]] to require password authentication
 
* Setup an [[MythWeb ssh tunnel howto|SSH tunnel]] for remote access to MythWeb (assuming that you do not open your MythWeb server to the internet except for port-forwarding SSH from your router/firewall)
 
  
These instructions assume Fedora Core, with Myth Web installed in the default path /var/www/html/mythweb
+
== Securing Mythweb ==
 +
:''Main article: [[Securing MythWeb]]''
  
=== MythWeb .htaccess ===
+
If your web server is accessible from the internet it is '''important''' that you secure MythWeb with some kind of authentication. See the main article for further details for your distribution.
The simplest option is to edit /var/www/html/mythweb/.htaccess and read the comments there about what to uncomment to secure MythWeb. This option does not require Apache to be restarted, but is ''slightly'' less efficient than adding the options to the Apache config.  
 
  
You may use either ''AuthType Basic'' or ''AuthType digest'' -- "Basic" is more compatible, "Digest" is more secure. If  you use "Basic", you must use ''htpasswd'' to create users. If you use "Digest", you must use ''htdigest'' to create users.  
+
== Alternative Skins ==
 +
MythWeb uses the concept of skins to give the user the power to edit/change the look and feel. The skins are based on CSS files that can be customized.
  
==== openSUSE 10.2 ====
+
Following list of available skins can be install additionally to the default one:
[[Image:Geeko_head48.png|25px]]
 
  
 +
* [http://www.hettich.org.uk/jerome/MythTV/haze.html Haze Skin] for MythTV 0.20
 +
* [http://svn.mythtv.org/trac/ticket/5620 Elkin Skin] for MythTV 0.21
 +
* [https://github.com/JoeD84/cleandark Clean Dark] for MythTV 0.24
  
 +
To install the skins, extract them to the mythweb/skins/ directory.
  
These steps are for [[Opensuse_10.2|openSUSE 10.2]]  The instructions are written using "htpasswd2" instead of "htdigest2" because that is what I got to work.  I'm sure you could use "htdigest2", I'm just now sure how.  These steps should work fine though.
+
<gallery>
 +
Image:Elkin-mythweb-theme.png|Elkin skin
 +
Image:welcome_dark.png|Haze skin
 +
Image:clean_dark.png|Clean Dark skin
 +
</gallery>
  
You will need to install Apache2, PHP5.1 (or preferrably PHP5.2), Mythweb
+
== Troubleshooting ==
 +
===Browser only showing a directory listing===
 +
If your web browser is only showing a directory listing when you point it to mythweb, check that your mythweb configuration file is set properly for Apache. This file (mythweb.conf) can typically be found in the /etc/apache2/modules.d directory, but if it does not exist, you can easily make a symlink:
 +
ln -s /var/www/localhost/htdocs/mythweb/mythweb.conf.apache /etc/apache2/modules.d/mythweb.conf
 +
or alternately (depending on your configuration)
 +
ln -s /usr/share/webapps/mythweb/0.26.0/conf/apache-mythweb.conf /etc/apache2/modules.d/mythweb.conf
  
MythTV openSUSE RPMS will install the mythweb files into /srv/www/htdocs/mythweb
+
Once you have verified that the file location/symlink is correct, edit the file and check that the paths inside it are correct.
  
  
'''Configure Apache2'''
+
===Apache won't start: "Invalid command 'php_value'"===
+
If Apache fails to start after installing MythWeb, giving the error:
 +
Syntax error on line 113 of /etc/apache2/modules.d/mythweb.conf:
 +
Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration
 +
Double check that the PHP5 module is being loaded.
  
In YasT under Network Services->HTTP Server.
+
/etc/conf.d/apache2:
 +
APACHE2_OPTS= "..." (add "-D PHP5" to the list)
  
Under "Server Modules" make sure you have "env" and "rewrite" modules enabled
 
  
Under "Main Hosts" select "Directory  /srv/www/htdocs "
+
===Browser says "Not Found"===
 +
If you receive an error message such as the following:
 +
"Not Found - The requested URL /mythweb.php/mythweb/ was not found on this server."
 +
then double-check your mythweb.conf configuration file to ensure that the directories are correct. 
  
Change Options to FollowSymLinks
+
In my case, I had to change:
 +
<Directory "/var/www/localhost/htdocs/mythweb/data">
 +
    Options -All +FollowSymLinks +IncludesNoExec
 +
</Directory>
 +
<Directory "/var/www/localhost/htdocs" >
 +
to:
 +
<Directory "/var/www/localhost/htdocs/mythweb/data">
 +
    Options -All +FollowSymLinks +IncludesNoExec
 +
</Directory>
 +
<Directory "/var/www/localhost/htdocs/mythweb" >
  
Change AllowOveride to All
 
  
save and exit
+
===Incompatible protocol version===
 +
After updating mythtv and mythplugins you may find that mythweb gives an error like
 +
Error at /var/www/localhost/htdocs/mythweb/includes/mythbackend.php, line 172:
 +
    Incompatible protocol  version (mythweb=40, backend=41)
 +
 +
Fatal Error at /var/www/localhost/htdocs/mythweb/includes/mythbackend.php, line 39:
 +
  Unable to connect to mythbackend, is it running?
  
 +
The version numbers may be different, but the point is that they don't match between mythtv and mythweb.  The problem is that even if you build and install the latest mythplugins, this does not install mythweb.  You must copy the latest mythweb code to the directory from which it is served by the web server.  For example:
 +
cp -r mythplugins/mythweb/* /var/www/html/
  
'''Start Apache2 Web Server'''
 
  
 +
=== Failure to detect wap/wml devices when secured ===
 +
If MythWeb is secured it will use the logged in username to record the mythweb settings including the template/skin. This is great if you are browsing mythweb from different PCs but will bypass the detection of mobile (wap/wml) devices. A simple workaround is to ensure you setup a different userid to authenticate with from your phone. --[[User:Lwoggardner|Lwoggardner]] 12:08, 14 October 2006 (UTC)
  
YasT->System->System Services
+
The user settings are stored in the table <b>mythweb_sessions</b>. To reset the stored session information for a particular user, simply delete the record for that user:<br>
  
Select apache2 and enable
+
DELETE FROM mythweb_sessions WHERE id = 'user:<username>'
  
save and exit
+
In a contribution to the mythtv-users list on 4 December 2008, Michael T. Dean suggested that the following may also fix the issue:
  
== Setup Security ==
+
http://<hostname>/mythtv/?RESET_TMPL=true
 +
[[User:JanCeuleers|JanCeuleers]] 19:41, 4 December 2008 (UTC)
  
  
'''1.''' create a new password file with htpasswd2
+
=== Database connection issues ===
  
'''WARNING:''' the "-c" will wipe out the file if it already exists
+
If you have edited your .htaccess db values to match your mysql.txt file and still cannot connect to database you may have mysql database problems.  Try:<br>
  /usr/bin/htpasswd2 -c /etc/apache2/conf.d/httpd-passwords ''userid''
+
  GRANT ALL ON mythconverg.* TO mythtv@localhost IDENTIFIED BY 'mythtv'<br>
You will be prompted to put in a password for the ''userid''
+
WITH GRANT OPTION<br>
 +
FLUSH PRIVILEGES;<br>
  
'''2.''' create any additional user IDs (no "-c")
 
/usr/bin/htpasswd2 /etc/apache2/conf.d/httpd-passwords ''another_userid''
 
'''3.''' Find the user:group that apache2 is running as
 
cat /etc/apache2/uid.conf
 
The file will probably look similar to this:
 
User wwwrun
 
Group www
 
'''4.''' Change the ownership of the password file (change "wwwrun:www" to match the "User:Group" from the previous step)
 
chown wwwrun:www /etc/apache2/conf.d/httpd-passwords
 
'''5.''' If the .htaccess exists, which it probably does if you have mythweb installed, back it up.  This is just in case you mess it up and it need to start over.
 
cd /srv/www/htdocs/mythweb/
 
cp ./.htaccess ./.htaccess.orig
 
'''6.''' Open .htaccess for modification with vi - or whatever floats your boat
 
vi ./.htaccess
 
'''7.''' The following lines should be present but commented. Remove the "#" from the start of each line, modify them to fit your setup, and save the file. Changes are immediate. Pay special attention to the bolded lines
 
'''AuthType          Basic'''
 
AuthName          "MythTV"
 
'''AuthUserFile      /etc/apache2/conf.d/httpd-passwords'''
 
Require            valid-user
 
BrowserMatch      "MSIE"      AuthDigestEnableQueryStringHack=On
 
  
Save the file and authentication should begin immediately.
+
=== Cannot play back recordings from index ===
  
'''8.''' If you don't want to bother with authentication when you are on the same network, add the following lines and authentication will be bypassed (assuming 192.168.1.0 is your local network).
+
If you can browse the recording index but cannot play back a recording then check if your /etc/mythtv/config.xml is valid.  
Allow from 192.168.1.
 
Satisfy any
 
If you aren't sure what your network is, if you are using a router purchased from a store, you could probably get away with specifying "Allow from 192.168.".  This would also cover you if you move your box from one location to another using a different third octet in the IP. With this in place, though, you should not be prompted now for authentication while on the local network.
 
  
'''UPDATE:'''  I'm not 100% sure that this last step works. I tested from a remote site and was able to access MythWeb without being prompted for a password. The remote site also used the 192.168.1 network range.  After removing the last two entries above, it prompted right away.
+
c/o http://www.mythtv.org/pipermail/mythtv-users/2012-July/336637.html :
 +
<pre>
 +
Hi - for the archive.
  
'''NOTE:'''  I had the same problem with the last step not working, but after a lot of digging it turned out that there were conflicting authentication configurations in the main '''apache''' config file and in the '''sites-enabled/default''' files. These are the settings which worked for me.
+
Symptom: Mythweb movie artwork does not show.
<Directory>
+
Symptom: In /var/log/apache/error.log there are a bunch of errors like:
  AuthType Basic
 
  AuthName "MythTV"
 
  AuthUserFile /etc/apache2/conf.d/httpd-passwords
 
  Require valid-user
 
  Order deny,allow
 
  Deny from all
 
  Allow from 192.168.0 127
 
  Satisfy Any
 
</Directory>
 
  
----
+
[Mon Jul 09 11:51:57 2012] [error] [client 192.168.1.44] Cannot connect to database: , referer: http://192.168.1.20/mythweb/video
 +
[Mon Jul 09 11:51:57 2012] [error] [client 192.168.1.44] , referer: http://192.168.1.20/mythweb/video
 +
[Mon Jul 09 11:51:57 2012] [error] [client 192.168.1.44] Compilation failed in require at /var/www/mythweb/mythweb.pl line 61., referer: http://192.168.1.20/mythweb/video
 +
[Mon Jul 09 11:51:57 2012] [error] [client 192.168.1.44] Premature end of script headers: mythweb.pl, referer: http://192.168.1.20/mythweb/video
 +
[Mon Jul 09 11:51:57 2012] [error] [client 192.168.1.44] DBI connect('database=mythconverg:host=localhost;port=3306','mythtv',...)
 +
failed: Access denied for user 'mythtv'@'localhost' (using password: YES) at /usr/share/perl5/MythTV.pm line 351, referer: http://192.168.1.20/mythweb/video
  
Possible Problems:
+
(obviously the 192.168.1.20 is the address of my mythtv box, yours might be different)
  
/var/log/apache2/error_log show "RewriteEngine" messages
+
I'm not sure what the root cause of the problem is, but I think mythweb is
 +
using /etc/mythtv/config.xml by default.  On my fresh installation of
 +
Mythbuntu 12.04 this is an empty file.  I removed the 0 byte file, and
 +
symlinked to the real config.xml in my configured user directory
  
[Mon Jul 23 21:35:19 2007] [alert] [client 192.168.0.187] /srv/www/htdocs/mythweb/.htaccess:\
+
e.g.:
Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server\ 
+
        cd /etc/mythtv
configuration
+
        sudo rm config.xml
 +
        sudo ln -sf /home/<your-user-name>/.mythtv/config.xml config.xml
  
Install the apache2 rewrite module
 
  
  # a2enmod rewrite
+
Having this empty config.xml causes mythweb not to be able to connect to the
# /etc/init.d/apache2 force-reload
+
database for the artwork. It does seem to be able to connect for other
 +
things, so I'm not 100% sure what the matter is.
  
----
 
  
==== Other Linux Flavors ====
+
hope this helps someone,
===== Create a Password File =====
 
You will need to create an htdigest password file -- a suggested location is /etc/httpd/conf, but it should be a location that gets backed up regularly.
 
  
<pre><nowiki>
+
cheers,
htdigest -c /etc/httpd/conf/httpd-passwords MythTV MYUSER1
+
-kt
</nowiki></pre>
+
</pre>
  
Create additional users as needed:
 
<pre><nowiki>
 
htdigest /etc/httpd/conf/httpd-passwords MythTV MYUSER2
 
</nowiki></pre>
 
Please make sure you DO NOT use the -c after the initial user, as this will overwrite the file and start from scratch.
 
  
Modify ownership of the file to match the user and group Apache is running as -- try
+
=== Streaming Music via Mythweb ===
<pre>grep -A 2 ^User /etc/httpd/conf/httpd.conf </pre>
+
If Streaming Music over Mythweb is not working check to confirm that there is a link to your music directory in ''mythweb/data''. If your music is stored in ''/mythtv/music'' and your web directory is /var/www/html/mythweb then you would need to add a link like.
<pre><nowiki>
+
ln -s /mythtv/Music /var/www/html/mythweb/data/music
chown apache.apache /etc/httpd/conf/httpd-passwords
+
Then confirm that it worked
chmod 640 /etc/httpd/conf/httpd-passwords
+
ll /var/www/html/mythweb/data
</nowiki></pre>
 
  
===== Modify .htaccess =====
 
<pre><nowiki>
 
nano /var/www/html/mythweb/.htaccess
 
</nowiki></pre>
 
  
The following lines should be present but commented. Remove the "#" from the start of each line, modify them to fit your setup, and save the file. Changes are immediate.  
+
=== MythVideo error on Mythweb ===
 +
Error:
 +
Could not create a symlink to /content/dvd, the local MythVideo directory for this hostname (hostname).
 +
Please create a symlink to your MythVideo directory at data/video in order to use the video portions of MythWeb.
  
<pre><nowiki>
+
I could fix this by deleting the symlink /var/www/html/mythweb/data/video with this command "rm /var/www/html/mythweb/data/video". This would allow mythweb to pull up the video page without the artwork, but when I would refresh it I would get the error.
    AuthType          Digest
+
Notes:
    AuthName          "MythTV"
+
My Video Directory: /content/dvd
    AuthUserFile      /etc/httpd/conf/httpd-passwords
+
This is related to permissions in the /content folder. So I did this
    Require            valid-user
+
chown -R mythtv:apache /content
    BrowserMatch      "MSIE"      AuthDigestEnableQueryStringHack=On
+
chmod -R 755 /content
</nowiki></pre>
 
  
Adding the following optional lines will enforce authentication from anywhere outside your local network (assuming 192.168.1.0 is your local network):
 
<pre><nowiki>
 
    Allow from 192.168.1.
 
    Satisfy any
 
</nowiki></pre>
 
  
Authentication should begin working immediately.
 
  
=== Apache Configuration ===
+
I had the same problem and found out that the symlink was not created properly.  If you create a new symlink in the mythweb data folder (www/mythweb/data) to your video folder and video cover folder everything works fine.  The error should tell you which file to link to using the following command
This method is ''slightly'' more efficient than the .htaccess method, but is complicated by the fact that you must restart Apache and mis-configuring the Apache configuration file will keep Apache from restarting.  
+
ln -s ''target_file'' video
 +
ln -s ''target_file'' video_covers
 +
where target file is the location of your video and video_cover folders respectively.
  
==== Apache password file ====
 
We will start with creating an Apache password file. I put this in /etc/httpd/conf, as I back up this directory every night to one of my other systems.
 
  
<pre><nowiki>
+
=== Time Stamp is off by an hour ===
htpasswd -c /etc/httpd/conf/httpd-passwords MYUSER1
+
Arizona does not follow daylight savings time.  PHP can't read the system timezone causing the Mythweb time to be an hour fast.  The following needs to be set in php.ini:<br>
</nowiki></pre>
+
[Date] ; Defines the default timezone used by the date functions <br>
 +
date.timezone = America/Phoenix
  
Create additional users as needed:
+
If your timezone has daylight saving which moves from year to year, you might experience this problem. This is because PHP does not use the system timezone information but has its own timezone database built in. System timezone information is easily updated (e.g. yum update tzdata) and if your system clock is wrong you probably should. The compiled-in data of PHP is not easily updated and reflects what the developers of PHP thought was correct when it was coded at some time in the past. The times in the MythTV database may be correct even though they show incorrectly in MythWeb. This happened in timezone Australia/Sydney in March/April 2008 when the daylight saving change was moved back by one week - MythWeb times were one hour out for the week and then corrected themselves.
<pre><nowiki>
 
htpasswd /etc/httpd/conf/httpd-passwords MYUSER2
 
</nowiki></pre>
 
Please make sure you DO NOT use the -c after the initial user, as this will overwrite the file and start from scratch.
 
  
Modify ownership of the file as follows:
+
To resolve future issues with daylight savings timezones being altered it may be neccessary to update or install the php timezone database. The following process was used successfully to install the php timezonedb with Ubuntu 7.10 (Gutsy).
<pre><nowiki>
 
chown apache.apache /etc/httpd/conf/httpd-passwords
 
chmod 640 /etc/httpd/conf/httpd-passwords
 
</nowiki></pre>
 
  
==== Editing Apache Config ====
+
sudo apt-get install php-pear
Now edit '''/etc/httpd/conf/httpd.conf''', and add the following section:
+
sudo pecl install timezonedb
  
<pre><nowiki>
 
<Directory "/var/www/html/mythweb">
 
    Options Indexes FollowSymLinks
 
    AuthType Basic
 
    AuthName "MythTV"
 
    AuthUserFile /etc/httpd/conf/httpd-passwords
 
    require user MYUSER1 MYUSER2 MYUSER3
 
    Order allow,deny
 
    Allow from all
 
</Directory>
 
</nowiki></pre>
 
  
Modify the password file location and required users per your needs.
+
=== Thumbnails are not generated ===
 +
Check this [http://svn.mythtv.org/trac/ticket/3217#comment:5 fix] and make sure that
 +
allow_url_fopen = On
 +
in your php.ini.
  
If you have created a link from your music storage area to /var/www/html/mythweb/music, you can add the following to separately secure web access to this:
 
<pre><nowiki>
 
#MythWeb music configuration
 
<Directory "/var/www/html/mythweb/music">
 
    Options Indexes FollowSymLinks
 
    AuthType Basic
 
    AuthName "MythTV-Music"
 
    AuthUserFile /etc/httpd/conf/httpd-passwords
 
    Require user MYUSER4 MYUSER5
 
    Order allow,deny
 
    Allow from all
 
</Directory>
 
</nowiki></pre>
 
  
Again, tailor your password file and users to your needs. You can even use separate password files if you wish!
+
=== Errors showing Backend Status page ===
 +
If you receive errors such as:
 +
Error at /var/www/localhost/htdocs/mythweb/modules/status/handler.php, line 29:
 +
file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration
 +
when you open the "Backend Status" page, then you need to enable/install the curl plugin for php.  
  
==== Securing only the "settings" section ====
+
For Ubuntu/Debian:
 +
sudo apt-get install php5-curl
  
It is also possible to improve security on MythWeb without requiring every user to enter a username and password. Standard users will still be able to do things such as delete recordings, edit video metadata, etc, but you can at least restrict their access to dangerous pages such as the settings section. This is done on Apache by using the "LocationMatch" directive:
+
For Fedora/Redhat:
 +
yum install curl curl-devel
  
<pre><nowiki>
+
The error should be resolved after a restart of the web server.
<LocationMatch .*/settings>
 
        AuthType        Digest
 
        AuthName        "MythTV"
 
        AuthUserFile    /etc/mythtv/mythweb-digest
 
        Require        valid-user
 
        BrowserMatch    "MSIE"  AuthDigestEnableQueryStringHack=On
 
        Order          Allow,Deny
 
        Satisfy        Any
 
</LocationMatch>
 
</nowiki></pre>
 
  
It should also be possible to restrict any individual action on Mythweb using the right regular expression in the LocationMatch.
+
Alternatively you can enable fopen in your php configuration file, but this is not recommended due to potential security issues with fopen.
  
==== Restart Apache ====
+
To do this, find the following line:
 +
allow_url_fopen = Off
 +
and change it to:
 +
allow_url_fopen = On
  
Now restart Apache, and you're done:
 
<pre><nowiki>
 
service httpd restart
 
</nowiki></pre>
 
(this may be different on your distro)
 
  
==== Other options ====
+
=== Channel Icons are not appearing ===
You can do a lot more with these configuration sections, such as secure by ip address, and more. Please see the Apache docs[http://httpd.apache.org/docs-2.0/howto/auth.html].
+
If you do not see channel icons in the listings page, there are three possible problems:
 +
:1) The option is not enabled
 +
:* Click the "Settings" button (a picture of a key & wrench), click the "MythWeb" button on the left, click the "MythWeb Defaults" tab, and verify that there is a check in the box for "Show the channel icons"
 +
:2) The channel icons have not been retrieved
 +
:* Run mythtv-setup, select "Channel Editor", select "Icon Download", and then select "Download all icons" from the list. Further information on channel icons is available in the [[Channel_icons]] page.
 +
:3) Icons have not been converted to the latest standard
 +
:* For version 0.27 and above, see [[Channel_icons#Universal_Location]]
  
Questions: email me at johanreinalda at yahoo dot com. Preferred is an email to Myth Users list, however.
 
Here's the configuration I used to allow users on my LAN to access [[MythWeb]] without a password, and require outside users to authenticate via pw
 
<pre><nowiki>
 
<Directory "/var/www/html/mythweb">
 
  Options Indexes FollowSymLinks
 
  AuthType Basic
 
  AuthName "MythTV"
 
  AuthUserFile /etc/httpd/conf/httpd-passwords
 
  Require valid-user
 
  Order allow,deny
 
  Allow from 192.168.1.
 
  Satisfy any
 
</Directory>
 
</nowiki></pre>
 
  
''NOTE: I have found that "Allow from 192.168.1." does not work correctly when your webserver is behind a router, as any traffic forwarded over the router will appear to originate from 192.168.1.1 (or whatever your router's IP is). This will cause ANY outside traffic to satisfy the "Any" requirement.'' -- craftyguy
+
=== SELinux issues ===
 +
If you get an error something like:
  
== Troubleshooting ==
+
                        Error
 +
 +
Unable to connect to the master backend at 127.0.0.1:6543.
 +
Is it running?
  
=== If you install or upgrade MythWeb and your web browser gives you garbage instead of a pretty page ===
+
you are sure the backend ''is'' running, and you are running Fedora or some other distribution which uses selinux, this may be the problem - selinux does not allow apache to talk to mysql in the default policy.  Try
Find the apache/htdocs/mythweb/.htaccess file and comment out (with a # sign) the three lines which begin ''php_value zlib.''.  (This note doesn't actually belong here, but I didn't want it to get lost, since I had to rummage in the mailing list to find it again. --[[User:Baylink|Baylink]] 22:10, 7 October 2006 (UTC))
+
setsebool httpd_can_network_connect=1
 +
to test this theory, and to make it permanent:
 +
  setsebool -P httpd_can_network_connect=1
  
=== Mythweb fails to detect wap/wml devices when secured ===
+
If that doesn't work, try:
If MythWeb is secured it will use the logged in username to record the mythweb settings including the template/skin. This is great if you are browsing mythweb from different PCs but will bypass the detection of mobile (wap/wml) devices. A simple workaround is to ensure you setup a different userid to authenticate with from your phone. --[[User:Lwoggardner|Lwoggardner]] 12:08, 14 October 2006 (UTC)
+
setenforce permissive
 +
to test this theory, and make the change permanent, if you wish, via /etc/sysconfig/selinux:
  
The user settings are stored in the table <b>mythweb_sessions</b>. To reset the stored session information for a particular user, simply delete the record for that user:<br>
+
SELINUX=permissive
 +
# or SELINUX=disabled
  
DELETE FROM mythweb_sessions WHERE id = 'user:<username>'
 
  
=== Database connection issues ===
+
===Internal Server Error when attempting to stream a program ===
 +
If you receive an "Internal Server Error" page when you click either the 'stream' or the 'download' icons next to a recorded program, the issue will likely be described in the Apache error log file.  If the error is the following:
 +
[error] (13)Permission denied: exec of '/var/www/localhost/htdocs/mythweb/mythweb.pl' failed
 +
then check the permissions on the mythweb.pl file to make sure that it has execute permissions enabled.
  
If you have edited your .htaccess db values to match your mysql.txt file and still cannot connect to database you may have mysql database problems. Try:<br>
+
===404 error when attempting to stream a program===
GRANT ALL ON mythconverg.* TO mythtv@localhost IDENTIFIED BY 'mythtv'<br>
+
If you receive a message like this:
WITH GRANT OPTION<br>
+
The requested URL /mythweb/mythweb.pl/pl/stream/3006/1357002000.asx was not found on this server.
FLUSH PRIVILEGES;<br>
+
then there is some problem with the Apache2 CGI setup.
  
=== Streaming Music via Mythweb ===
+
One thing to try if /etc/apache2/mods-enabled/cgi.load does not exist:
If Streaming Music over Mythweb is not working check to confirm that there is a link to your music directory in ''mythweb/data''. If your music is stored in ''/mythtv/music'' and your web directory is /var/www/html/mythweb then you would need to add a link like.
+
  cd /etc/apache2/mods-enabled/
  ln -s /mythtv/Music /var/www/html/mythweb/data/music
+
  sudo ln -s ../mods-available/cgi.load
Then confirm that it worked
 
  ll /var/www/html/mythweb/data
 
  
=== MythVideo error on Mythweb ===
+
=== Listing schedules show ‘No Data’ ===
Error:
+
'''Symptoms:'''
Could not create a symlink to /content/dvd, the local MythVideo directory for this hostname (hostname).
 
Please create a symlink to your MythVideo directory at data/video in order to use the video portions of MythWeb.
 
  
I could fix this by deliting the symlink /var/www/html/mythweb/data/video with this command "rm /var/www/html/mythweb/data/video". This would allow mythweb to pull up the video page without the artwork. but when i would refreshed it i would get the error.
+
After the source of listing data is changed, Mythweb shows listing data initially but it shows ‘No data’ after a week or soMythtv frontend shows listing data correctly.
Notes:
 
  My Video Directory: /content/dvd
 
This is related to permissions in the /content folder. So i did this
 
chown -R mythtv:apache /content
 
chmod -R 755 /content
 
  
 +
'''An example:'''
  
 +
Recordings and the database from mature system with Hauppauge PCI/USB tuners are copied to a new system but with HD-Homerun networked tuners.  EIT off-air listings are used in both scenarios.  The Mythtv frontend shows the scheduling data from the HDHR tuners once it has been acquired and continues to do so.  Initially Mythweb shows scheduling data but the data is that imported by the database restore which becomes stale after a week leaving ‘No Data’.  Backend setup shows that there are two sources, each with an entry for each channel – one in the Hauppauge source, one in the HDHomerun source.
  
I had the same problem and found out that the symlink was not created properly.  If you create a new symlink in the mythweb data folder (www/mythweb/data) to your video folder and video cover folder everything works fineThe error should tell you which file to link to using the following command
+
Whilst this scenario used EIT off-air data from DVB-T tuners in the UK, there will almost certainly be similar situations with other grabber mechanisms.   
ln -s ''target_file'' video
 
ln -s ''target_file'' video_covers
 
where target file is the location of your video and video_cover folders respectively.
 
  
=== Time Stamp is off by an hour ===
+
'''The fix:'''
Arizona does not follow daylight savings time.  PHP can't read the system timezone causing the Mythweb time to be an hour fast.  The following needs to be set in php.ini:<br>
 
[Date] ; Defines the default timezone used by the date functions <br>
 
date.timezone = America/Phoenix
 
  
If your timezone has daylight saving which moves from year to year, you might experience this problem. This is because PHP does not use the system timezone information but has its own timezone database built in. System timezone information is easily updated (e.g. yum update tzdata) and if your system clock is wrong you probably should. The compiled-in data of PHP is not easily updated and reflects what the developers of PHP thought was correct when it was coded at some time in the past. The times in the MythTV database may be correct even though they show incorrectly in MythWeb. This happened in timezone Australia/Sydney in March/April 2008 when the daylight saving change was moved back by one week - MythWeb times were one hour out for the week and then corrected themselves.
+
Update Mythweb to the latest version. It is not automatically updated with Mythtv. With Ubuntu use:
 +
    sudo add-apt-repository ppa:mythbuntu/31
 +
    sudo apt-get update
 +
    sudo apt-get upgrade
 +
   
 +
Then:
  
To resolve future issues with daylight savings timezones being altered it may be neccessary to update the php timezone database. The following process was used successfully with Ubuntu 7.10 (Gutsy).
+
a)  Delete the old (Hauppauge) source in backend setup  --OR--
  
#Install pecl via php-pear
+
b)  Hide all old Hauppauge channels  --OR--
sudo apt-get install php-pear
 
#Update php timezones.
 
sudo pecl install timezonedb
 
  
=== Thumbnails are not generated ===
+
c)  Delete all old Hauppauge channels, either by a ‘clean sweep’ of all channel data and a retune or with an editor.
Check this [http://svn.mythtv.org/trac/ticket/3217#comment:5 fix] and make sure that
 
allow_url_fopen = On
 
in your php.ini.
 
  
== Alternative Skins ==
+
Hiding or deleting channels in bulk can be achieved with the API channel editor.  Mythtv-setup has a button for deleting all channels of a video source.  See:
MythWeb uses the concept of skins to give the user the power to edit/change the look and feel. The skins are based on CSS files that can be customized.
+
    https://www.mythtv.org/wiki/Channel_Editor
 +
    https://www.mythtv.org/wiki/Channel_Scanning#Delete
 +
  
Following list of available skins can be install additionally to the default one:
+
'''BEWARE''' that deleting channels under old versions of Mythtv will cause a loss of the name of the channel shown with your recorded programs which can only be recovered by a database restore.  This problem was seen with 31.20200101 of Mythtv and earlier versions.  Deleting channels with 31.20211108 did not cause this problem.  Versions in between are unknown.
  
* [http://www.hettich.org.uk/jerome/MythTV/haze.html Haze Skin] for MythTV 0.20
+
This section was included following forum dialogue: https://forum.mythtv.org/viewtopic.php?f=36&t=4681
* [http://svn.mythtv.org/trac/ticket/5620 Elkin Skin] for MythTV 0.21
 
  
To install the skins, extract them to the mythweb/skins/ directory.
+
=== Mythweb and PHP 8.0 ===
 +
Some distributions may distribute old code incompatible with PHP 8.0.
 +
The Ubuntu mythweb package (31.0+fixes.20200323) is broken with regards to
 +
PHP 8+. For Ubuntu and derivative distributions the mythweb package should be installed so
 +
mythweb might be activated 'in the Ubuntu way'. The code from a git clone
 +
should then be pulled (and perhaps placed in an alternate location, such as
 +
/var/www/html/ and configuration files updated).
  
<gallery>
+
Mythweb verified to work with mythweb code from a git clone on:<br>
Image:Elkin-mythweb-theme.png|Elkin skin
+
Ubuntu 21.10<br>
Image:welcome_dark.png|Haze skin
+
Fedora 35
</gallery>
 
  
 
== See Also ==
 
== See Also ==
Line 428: Line 399:
 
* [[MythWeb on Lighttpd]]
 
* [[MythWeb on Lighttpd]]
 
* [[MythWeb on Jetty]] a Java based web server
 
* [[MythWeb on Jetty]] a Java based web server
 +
* [[Using mod gzip to improve MythWeb performance]]
 +
* [[User_talk:MusicMonkey5555]]
  
 
[[Category:Plugins]]
 
[[Category:Plugins]]
 +
[[Category:MythWeb]]

Latest revision as of 00:24, 17 March 2022

Warning.png Warning: MythWeb is no longer being actively developed. Although not a full replacement, see WebFrontend.

Important.png Note: MythWeb updates released 13th December 2021 to allow master to work with PHP8. V31 was updated 15 December 2021.

Clean.png Cleanup: This article or section may require cleanup. Discuss the issue on the talk page

MythWeb TV listings
MythWeb recorded items

MythWeb provides a frontend for scheduling and managing recordings on your MythBox from a web browser located on another machine. Provided the security is set up correctly on your MythBox you can access your machine from anywhere on the internet, or even your mobile phone as long as you have a compatible browser.

Mythweb also has some unique capabilities that are only available through the web interface such as allowing for the change of key bindings and other settings. Indeed, many functions you might want to perform on your MythBox are faster or easier through MythWeb. Don't confuse this with MythBrowser which is a web page browser that is accessible through MythFrontend.

Key Features

MythWeb upcoming recordings
MythWeb details of a programme

TV

Programme Listing

Special Searches

Upcoming Recordings

Recording Schedules

Schedule Manually

Custom Schedule

Recorded Programmes

Music

Browse your Music Collection and download to your local machine for direct playback.

The interface allows you to search and browse the playlists you have set up in MythMusic. You can also put together new playlists in the web interface.

The interface also provides buttons that when pressed will stream the music in the playlist over HTTP to your browser (via a .m3u file). Your browser needs to know what to do with the file - e.g. start up a music player. Not all players seem to cope well with the file that is sent; VLC seems to work ok.

Video

Browse your Video collection and download to your local machine

Weather

MythWeb weather

Get weather reports as per MythWeather.

Status

Show the Backend Status Logs such as how much disk space and tuners that are recording

Statistics

Show key statistics such as Top Recorded Shows

Logs

Show the Server Logs.

In 0.27 database logging is disabled by default, and only enabled via the Mythbackend command line. In this case the Server Logs cannot be displayed and an error message is displayed.

Settings

Configure MythWeb and some of the MythTV settings such as:

  • MythWeb session settings
  • MythTV global defaults
  • MythTV channel info
  • MythTV key bindings
  • MythTV settings table

Installation

For a general installation guide see Build from Source and navigate to the Install MythWeb section, otherwise see the distribution specific pages.

Usage

Once MythWeb is installed, you can simply access MythWeb from any web browser.

URL for accessing mythweb from browser on same machine as MythTV use

     http://localhost:80/mythweb
     or 
     http://127.0.0.1:80/mythweb

URL for remote access to MythTV from home network use

     http://192.168.0.100:80/mythweb (replace 192.168.0.100 with your local IP address)
     or
     http://mythtv-hostname:80/mythweb (you can use the computername you assigned to the MythTV PC)

URL for remote access to MythTV from Internet use

     http://45.45.45.45:80/mythweb (45.45.45.45 is your WAN IP.)
     (If you don't know your WAN IP, use www.whatismyip.com to figure this out)

However, you will not be able to remotely access your MythTV machine until you open the port to your PC. You need to enter your home router and enable port forwarding. You need to manually change some settings in your router that let it know that you want traffic from outside the home network to enter your home network. And you want that outside traffic to be sent directly to 192.168.0.100 (the IP address of the MythTV backend) on port number 80 (which is the default port for the apache HTTP server).

Also note that your ISP may block all traffic on port 80 because they do not want residential customers to be running HTTP servers. So you may need to change the default port 80 to some other number (e.g. 8080). Don't forget to change your router's settings to forward port the incoming port 8080 to the internal network's port 80.

Importantly most users have dynamically assigned IP addresses from their ISP. This means that your ISP can change your WAN IP at any time and if this occurred while your away from your home, you would not know what the new IP address is and therefore you would not be able to access your MythTV remotely. The way to prevent this from happening is to use dynamic DNS. There are many free choices which will allow you to map any changes that your ISP makes to your home IP address. This will allow you to maintain a connection to your home computer regardless if any changes to your IP address were made.

Lastly, don't forget that you still need to modify your home computer's configuration to grant your remote computer access. This means that you may need to change a few files. Notably, if you're accessing a linux systems (ubuntu/kubuntu/etc), change these files: /etc/hosts.allow and /etc/hosts.deny.


Favicons For Your Server

Here is a favicon.

Securing Mythweb

Main article: Securing MythWeb

If your web server is accessible from the internet it is important that you secure MythWeb with some kind of authentication. See the main article for further details for your distribution.

Alternative Skins

MythWeb uses the concept of skins to give the user the power to edit/change the look and feel. The skins are based on CSS files that can be customized.

Following list of available skins can be install additionally to the default one:

To install the skins, extract them to the mythweb/skins/ directory.

Troubleshooting

Browser only showing a directory listing

If your web browser is only showing a directory listing when you point it to mythweb, check that your mythweb configuration file is set properly for Apache. This file (mythweb.conf) can typically be found in the /etc/apache2/modules.d directory, but if it does not exist, you can easily make a symlink:

ln -s /var/www/localhost/htdocs/mythweb/mythweb.conf.apache /etc/apache2/modules.d/mythweb.conf

or alternately (depending on your configuration)

ln -s /usr/share/webapps/mythweb/0.26.0/conf/apache-mythweb.conf /etc/apache2/modules.d/mythweb.conf

Once you have verified that the file location/symlink is correct, edit the file and check that the paths inside it are correct.


Apache won't start: "Invalid command 'php_value'"

If Apache fails to start after installing MythWeb, giving the error:

Syntax error on line 113 of /etc/apache2/modules.d/mythweb.conf:
Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration

Double check that the PHP5 module is being loaded.

/etc/conf.d/apache2:

APACHE2_OPTS= "..."  (add "-D PHP5" to the list)


Browser says "Not Found"

If you receive an error message such as the following:

"Not Found - The requested URL /mythweb.php/mythweb/ was not found on this server."

then double-check your mythweb.conf configuration file to ensure that the directories are correct.

In my case, I had to change:

<Directory "/var/www/localhost/htdocs/mythweb/data">
    Options -All +FollowSymLinks +IncludesNoExec
</Directory>
<Directory "/var/www/localhost/htdocs" >

to:

<Directory "/var/www/localhost/htdocs/mythweb/data">
    Options -All +FollowSymLinks +IncludesNoExec
</Directory>
<Directory "/var/www/localhost/htdocs/mythweb" >


Incompatible protocol version

After updating mythtv and mythplugins you may find that mythweb gives an error like

Error at /var/www/localhost/htdocs/mythweb/includes/mythbackend.php, line 172: 
   Incompatible protocol  version (mythweb=40, backend=41)

Fatal Error at /var/www/localhost/htdocs/mythweb/includes/mythbackend.php, line 39: 
  Unable to connect to mythbackend, is it running? 

The version numbers may be different, but the point is that they don't match between mythtv and mythweb. The problem is that even if you build and install the latest mythplugins, this does not install mythweb. You must copy the latest mythweb code to the directory from which it is served by the web server. For example:

cp -r mythplugins/mythweb/* /var/www/html/


Failure to detect wap/wml devices when secured

If MythWeb is secured it will use the logged in username to record the mythweb settings including the template/skin. This is great if you are browsing mythweb from different PCs but will bypass the detection of mobile (wap/wml) devices. A simple workaround is to ensure you setup a different userid to authenticate with from your phone. --Lwoggardner 12:08, 14 October 2006 (UTC)

The user settings are stored in the table mythweb_sessions. To reset the stored session information for a particular user, simply delete the record for that user:

DELETE FROM mythweb_sessions WHERE id = 'user:<username>'

In a contribution to the mythtv-users list on 4 December 2008, Michael T. Dean suggested that the following may also fix the issue:

http://<hostname>/mythtv/?RESET_TMPL=true JanCeuleers 19:41, 4 December 2008 (UTC)


Database connection issues

If you have edited your .htaccess db values to match your mysql.txt file and still cannot connect to database you may have mysql database problems. Try:

GRANT ALL ON mythconverg.* TO mythtv@localhost IDENTIFIED BY 'mythtv'
WITH GRANT OPTION
FLUSH PRIVILEGES;


Cannot play back recordings from index

If you can browse the recording index but cannot play back a recording then check if your /etc/mythtv/config.xml is valid.

c/o http://www.mythtv.org/pipermail/mythtv-users/2012-July/336637.html :

Hi - for the archive.

Symptom: Mythweb movie artwork does not show.
Symptom: In /var/log/apache/error.log there are a bunch of errors like:

[Mon Jul 09 11:51:57 2012] [error] [client 192.168.1.44] Cannot connect to database: , referer: http://192.168.1.20/mythweb/video
[Mon Jul 09 11:51:57 2012] [error] [client 192.168.1.44] , referer: http://192.168.1.20/mythweb/video
[Mon Jul 09 11:51:57 2012] [error] [client 192.168.1.44] Compilation failed in require at /var/www/mythweb/mythweb.pl line 61., referer: http://192.168.1.20/mythweb/video
[Mon Jul 09 11:51:57 2012] [error] [client 192.168.1.44] Premature end of script headers: mythweb.pl, referer: http://192.168.1.20/mythweb/video
[Mon Jul 09 11:51:57 2012] [error] [client 192.168.1.44] DBI connect('database=mythconverg:host=localhost;port=3306','mythtv',...) 
failed: Access denied for user 'mythtv'@'localhost' (using password: YES) at /usr/share/perl5/MythTV.pm line 351, referer: http://192.168.1.20/mythweb/video

(obviously the 192.168.1.20 is the address of my mythtv box, yours might be different)

I'm not sure what the root cause of the problem is, but I think mythweb is 
using /etc/mythtv/config.xml by default.  On my fresh installation of 
Mythbuntu 12.04 this is an empty file.  I removed the 0 byte file, and 
symlinked to the real config.xml in my configured user directory

e.g.:
         cd /etc/mythtv
         sudo rm config.xml
         sudo ln -sf /home/<your-user-name>/.mythtv/config.xml config.xml


Having this empty config.xml causes mythweb not to be able to connect to the 
database for the artwork.  It does seem to be able to connect for other 
things, so I'm not 100% sure what the matter is.


hope this helps someone,

cheers,
-kt


Streaming Music via Mythweb

If Streaming Music over Mythweb is not working check to confirm that there is a link to your music directory in mythweb/data. If your music is stored in /mythtv/music and your web directory is /var/www/html/mythweb then you would need to add a link like.

ln -s /mythtv/Music /var/www/html/mythweb/data/music

Then confirm that it worked

ll /var/www/html/mythweb/data


MythVideo error on Mythweb

Error:

Could not create a symlink to /content/dvd, the local MythVideo directory for this hostname (hostname).
Please create a symlink to your MythVideo directory at data/video in order to use the video portions of MythWeb.

I could fix this by deleting the symlink /var/www/html/mythweb/data/video with this command "rm /var/www/html/mythweb/data/video". This would allow mythweb to pull up the video page without the artwork, but when I would refresh it I would get the error. Notes:

My Video Directory: /content/dvd

This is related to permissions in the /content folder. So I did this

chown -R mythtv:apache /content
chmod -R 755 /content


I had the same problem and found out that the symlink was not created properly. If you create a new symlink in the mythweb data folder (www/mythweb/data) to your video folder and video cover folder everything works fine. The error should tell you which file to link to using the following command

ln -s target_file video
ln -s target_file video_covers

where target file is the location of your video and video_cover folders respectively.


Time Stamp is off by an hour

Arizona does not follow daylight savings time. PHP can't read the system timezone causing the Mythweb time to be an hour fast. The following needs to be set in php.ini:
[Date] ; Defines the default timezone used by the date functions
date.timezone = America/Phoenix

If your timezone has daylight saving which moves from year to year, you might experience this problem. This is because PHP does not use the system timezone information but has its own timezone database built in. System timezone information is easily updated (e.g. yum update tzdata) and if your system clock is wrong you probably should. The compiled-in data of PHP is not easily updated and reflects what the developers of PHP thought was correct when it was coded at some time in the past. The times in the MythTV database may be correct even though they show incorrectly in MythWeb. This happened in timezone Australia/Sydney in March/April 2008 when the daylight saving change was moved back by one week - MythWeb times were one hour out for the week and then corrected themselves.

To resolve future issues with daylight savings timezones being altered it may be neccessary to update or install the php timezone database. The following process was used successfully to install the php timezonedb with Ubuntu 7.10 (Gutsy).

sudo apt-get install php-pear
sudo pecl install timezonedb


Thumbnails are not generated

Check this fix and make sure that

allow_url_fopen = On

in your php.ini.


Errors showing Backend Status page

If you receive errors such as:

Error at /var/www/localhost/htdocs/mythweb/modules/status/handler.php, line 29:
file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration

when you open the "Backend Status" page, then you need to enable/install the curl plugin for php.

For Ubuntu/Debian:

sudo apt-get install php5-curl

For Fedora/Redhat:

yum install curl curl-devel

The error should be resolved after a restart of the web server.

Alternatively you can enable fopen in your php configuration file, but this is not recommended due to potential security issues with fopen.

To do this, find the following line:

allow_url_fopen = Off

and change it to:

allow_url_fopen = On


Channel Icons are not appearing

If you do not see channel icons in the listings page, there are three possible problems:

1) The option is not enabled
  • Click the "Settings" button (a picture of a key & wrench), click the "MythWeb" button on the left, click the "MythWeb Defaults" tab, and verify that there is a check in the box for "Show the channel icons"
2) The channel icons have not been retrieved
  • Run mythtv-setup, select "Channel Editor", select "Icon Download", and then select "Download all icons" from the list. Further information on channel icons is available in the Channel_icons page.
3) Icons have not been converted to the latest standard


SELinux issues

If you get an error something like:

                       Error

Unable to connect to the master backend at 127.0.0.1:6543.
Is it running?

you are sure the backend is running, and you are running Fedora or some other distribution which uses selinux, this may be the problem - selinux does not allow apache to talk to mysql in the default policy. Try

setsebool httpd_can_network_connect=1

to test this theory, and to make it permanent:

setsebool -P httpd_can_network_connect=1

If that doesn't work, try:

setenforce permissive

to test this theory, and make the change permanent, if you wish, via /etc/sysconfig/selinux:

SELINUX=permissive
# or SELINUX=disabled


Internal Server Error when attempting to stream a program

If you receive an "Internal Server Error" page when you click either the 'stream' or the 'download' icons next to a recorded program, the issue will likely be described in the Apache error log file. If the error is the following:

[error] (13)Permission denied: exec of '/var/www/localhost/htdocs/mythweb/mythweb.pl' failed

then check the permissions on the mythweb.pl file to make sure that it has execute permissions enabled.

404 error when attempting to stream a program

If you receive a message like this:

The requested URL /mythweb/mythweb.pl/pl/stream/3006/1357002000.asx was not found on this server.

then there is some problem with the Apache2 CGI setup.

One thing to try if /etc/apache2/mods-enabled/cgi.load does not exist:

cd /etc/apache2/mods-enabled/
sudo ln -s ../mods-available/cgi.load

Listing schedules show ‘No Data’

Symptoms:

After the source of listing data is changed, Mythweb shows listing data initially but it shows ‘No data’ after a week or so. Mythtv frontend shows listing data correctly.

An example:

Recordings and the database from mature system with Hauppauge PCI/USB tuners are copied to a new system but with HD-Homerun networked tuners. EIT off-air listings are used in both scenarios. The Mythtv frontend shows the scheduling data from the HDHR tuners once it has been acquired and continues to do so. Initially Mythweb shows scheduling data but the data is that imported by the database restore which becomes stale after a week leaving ‘No Data’. Backend setup shows that there are two sources, each with an entry for each channel – one in the Hauppauge source, one in the HDHomerun source.

Whilst this scenario used EIT off-air data from DVB-T tuners in the UK, there will almost certainly be similar situations with other grabber mechanisms.

The fix:

Update Mythweb to the latest version. It is not automatically updated with Mythtv. With Ubuntu use:

   sudo add-apt-repository ppa:mythbuntu/31
   sudo apt-get update
   sudo apt-get upgrade
   

Then:

a) Delete the old (Hauppauge) source in backend setup --OR--

b) Hide all old Hauppauge channels --OR--

c) Delete all old Hauppauge channels, either by a ‘clean sweep’ of all channel data and a retune or with an editor.

Hiding or deleting channels in bulk can be achieved with the API channel editor. Mythtv-setup has a button for deleting all channels of a video source. See:

   https://www.mythtv.org/wiki/Channel_Editor 
   https://www.mythtv.org/wiki/Channel_Scanning#Delete

BEWARE that deleting channels under old versions of Mythtv will cause a loss of the name of the channel shown with your recorded programs which can only be recovered by a database restore. This problem was seen with 31.20200101 of Mythtv and earlier versions. Deleting channels with 31.20211108 did not cause this problem. Versions in between are unknown.

This section was included following forum dialogue: https://forum.mythtv.org/viewtopic.php?f=36&t=4681

Mythweb and PHP 8.0

Some distributions may distribute old code incompatible with PHP 8.0. The Ubuntu mythweb package (31.0+fixes.20200323) is broken with regards to PHP 8+. For Ubuntu and derivative distributions the mythweb package should be installed so mythweb might be activated 'in the Ubuntu way'. The code from a git clone should then be pulled (and perhaps placed in an alternate location, such as /var/www/html/ and configuration files updated).

Mythweb verified to work with mythweb code from a git clone on:
Ubuntu 21.10
Fedora 35

See Also