mythtv mythweb installation success on ts-219p

Post your questions about Web Server usage and Apache + PHP + MySQL/SQLite web applications.

mythtv mythweb installation success on ts-219p

Postby kja999 » Thu Dec 10, 2009 5:52 am

Hi,

As I couldn't find anything posted already I thought I would put this up as a bit of info.

I have installed mythweb on my NAS now and it all works fine.

Not the most detailed process, but these were my steps:
From an existing install, I copied /var/www/mythweb to /share/Qweb/
ssh into the NAS...
In /share/Qweb/ it needed the data folder making accessible to guest (chown -R guest.guest data)
Copy the template apache.conf from the mythweb folder to /etc/config/apache/
rename the file there (/etc/config/apache/) to mythweb.conf
Edit /etc/config/apache/apache.conf to add the following line at the very bottom;
Code: Select all
include /etc/config/apache/mythweb.conf


Edit the mythweb.conf file specifically changing the directory path to /share/Qweb/mythweb/data and /share/Qweb/mythweb, and set the host, user/password section to where your mythconverg db is.
(I used the IP address as the host, so no DNS config to do).
restart the web server using ...
Code: Select all
 /etc/init.d/Qthttpd.sh restart

This should work from here, but as per advice you should setup the htaccess security,

I had trouble with htdigest, but basic htpasswd was ok.
setup your htpasswd file ...
Code: Select all
/usr/local/apache/bin/htpasswd -c /etc/config/apache/mythweb.htaccess USERNAME


Edit the mythweb.conf file to change AuthUserFile to the one you create above.
kja999
Starting out
 
Posts: 14
Joined: Sun Nov 22, 2009 7:58 pm
NAS Model: TS-109/209 Pro II

Re: mythtv mythweb installation success on ts-219p

Postby flamaest » Fri Jan 29, 2010 1:35 am

Hi kja999,

Are you running Debian on yoru QNAP NAS or the default OS ?

Thanks,
Fabian.
flamaest
Starting out
 
Posts: 25
Joined: Mon Jan 18, 2010 2:59 pm
NAS Model: TS-109/209

Re: mythtv mythweb installation success on ts-219p

Postby jaboj » Sun Mar 07, 2010 10:20 pm

Do you run Debian or default OS? And, do anyone know if it is possible to run mythTV on TS-109 Pro II?

With this install, is MythTv then able to user a external USB tuner (ie. Terratec H7 Cable tuner)?
jaboj
First post
 
Posts: 1
Joined: Tue Oct 06, 2009 3:52 am
NAS Model: TS-109/209 Pro

Re: mythtv mythweb installation success on ts-219p

Postby kja999 » Mon May 03, 2010 4:07 am

Hi,
This is just on the standard QNAP firmware...

Also, on the new firmware, mythweb permissions should be set as this;
chown -R httpdusr /share/Qweb/mythweb
kja999
Starting out
 
Posts: 14
Joined: Sun Nov 22, 2009 7:58 pm
NAS Model: TS-109/209 Pro II

Re: mythtv mythweb installation success on ts-219p

Postby 321liftoff » Thu Mar 08, 2012 11:12 pm

As part of the mythtv forum here, I'm giving this a try and seems to work well. For mythweb version > 0.23, you need PHP 5.3 (see post below) else you'll get an http error 500. Also, you should match the mythweb version to your mythtv backend version. Just as users have pointed out in the first post and here, I didn't have luck with the AuthType Digest, so I used Basic. My steps below:
Code: Select all
(1) copy mythweb source files from zip into Public share
(2) ssh into NAS
(3) cp -r /share/Public/MYTHWEBROOTDIR /share/Web/mythweb
(4) chown -R httpdusr /share/Web/mythweb
(5) nano /etc/config/apache/apache.conf
+add "Include /etc/config/apache/extra/mythweb.conf" at very bottom
(6) cp /share/Web/mythweb/mythweb.conf.apache /etc/config/apache/extra/mythweb.conf
(7) /mnt/ext/opt/apache/bin/htpasswd -c /etc/config/apache/extra/mythweb.password INSERTUSERNAMEHERE
(8) nano /etc/config/apache/extra/mythweb.conf
+edit paths to match /share/Web/mythweb/data and /share/Web/mythweb
+uncomment the directives in the authentication section (7 total in my version)
+change AuthType from Digest to Basic
+change AuthUserFile to /etc/config/apache/extra/mythweb.password
(9) /etc/init.d/Qthttpd.sh restart
(10) go to http://NAS-ip-address/mythweb


To remove timezone errors, I did the following:
Code: Select all
mv /etc/localtime /etc/localtime_old
ln -s /usr/share/zoneinfo/US/Eastern /etc/localtime

but unfortunately, the /etc/localtime gets overwritten with every reboot...
Last edited by 321liftoff on Sun Mar 18, 2012 12:10 pm, edited 4 times in total.
321liftoff
Know my way around
 
Posts: 142
Joined: Sat Oct 22, 2011 6:54 pm
NAS Model: TS-219P+

Re: mythtv mythweb installation success on ts-219p

Postby 321liftoff » Sat Mar 17, 2012 11:01 am

I'm running Mythtv backend 0.24.1. I was using the latest code, 0.25-beta. I've found that the fixes/0.23 revision of mythweb at least brings up a webpage, but shows some errors on the top such as:
Code: Select all
User Notice at /share/MD0_DATA/Web/mythweb/classes/MythBackend.php, line 100:
Incompatible protocol version (mythweb=23056, backend=63)

User Notice at /share/MD0_DATA/Web/mythweb/classes/MythBackend.php, line 124:
Failed to set php timezone to

Warning at /share/MD0_DATA/Web/mythweb/modules/_shared/tmpl/default/header.php, line 16:
Cannot modify header information - headers already sent by (output started at /share/MD0_DATA/Web/mythweb/includes/errors.php:148)


Some functionality also doesn't work, which I suspect is because the protocols are different. Moving up to the 0.24.1 revision has the same behavior as 0.25-beta: server 500 error and no webpage. I don't even know where to begin on finding what is killing the webpage from opening, short of implementing each patch one-by-one until it breaks...
321liftoff
Know my way around
 
Posts: 142
Joined: Sat Oct 22, 2011 6:54 pm
NAS Model: TS-219P+

Re: mythtv mythweb installation success on ts-219p

Postby 321liftoff » Sat Mar 17, 2012 6:15 pm

I've found that mythweb > 0.24 requires php 5.3. (files in the mythweb/includes/ directory are the culprit) QNAP is supposed to be updating that as part of a future firmware, but in the meantime I was able to install it from here following steps 1 - 4. Then running "/etc/init.d/Qthttpd.sh restart"

Still getting these errors at the top:

Code: Select all
User Notice at /share/MD0_DATA/Web/mythweb/classes/MythBackend.php, line 125:
!!NoTrans: Failed to set php timezone to EDT Response from backend was Array ( [0] => EDT [1] => -14400 [2] => 2012-03-17T06:17:51 ) !!

Warning at /share/MD0_DATA/Web/mythweb/modules/_shared/tmpl/default/header.php, line 16:
!!NoTrans: Cannot modify header information - headers already sent by (output started at /share/MD0_DATA/Web/mythweb/includes/errors.php:150)!!


but at least the page is working.

Edit:
Fixed the errors above by doing the following:
Code: Select all
mv /etc/localtime /etc/localtime_old
ln -s /usr/share/zoneinfo/US/Eastern /etc/localtime

Of course use whatever timezone you are in...
Last edited by 321liftoff on Sat May 12, 2012 3:44 pm, edited 1 time in total.
321liftoff
Know my way around
 
Posts: 142
Joined: Sat Oct 22, 2011 6:54 pm
NAS Model: TS-219P+

Re: mythtv mythweb installation success on ts-219p

Postby 321liftoff » Mon Apr 02, 2012 2:52 am

I've noticed that an "Internal Server Error" occurs when trying to download or stream recordings from the "Recorded Programs" page. There are no errors in the apache error.log file. The MythWeb wiki suggests to look see if there are executable permissions on mythweb.pl, and for my install there is:
Code: Select all
-rwxr-xr-x    1 httpdusr administ     2.8k Mar 17 06:25 mythweb.pl*

I suspect there is an incompatibility with perl or python, but don't know where to start looking...
321liftoff
Know my way around
 
Posts: 142
Joined: Sat Oct 22, 2011 6:54 pm
NAS Model: TS-219P+

Re: mythtv mythweb installation success on ts-219p

Postby 321liftoff » Wed Jul 04, 2012 5:19 am

Was able to get my error log working and am seeing the following on clicking "stream" or "download"
[Tue Jul 03 17:07:57 2012] [error] [client 192.168.25.121] (2)No such file or directory: exec of '/share/Web/mythweb/mythweb.pl' failed, referer: http://192.168.25.120/mythweb/tv/recorded
[Tue Jul 03 17:07:57 2012] [error] [client 192.168.25.121] Premature end of script headers: mythweb.pl, referer: http://192.168.25.120/mythweb/tv/recorded

EDIT:
A problem is that the first line of mythweb.pl is:
Code: Select all
#!/usr/bin/perl -w

but my perl is located in /opt/bin/perl. So changing that gets me to this error:
[Tue Jul 03 17:19:18 2012] [error] [client 192.168.25.121] Can't locate DBI.pm in @INC (@INC contains: /opt/lib/perl5/5.10.0/arm-linux /opt/lib/perl5/5.10.0 /opt/lib/perl5/site_perl/5.10.0/arm-linux /opt/lib/perl5/site_perl/5.10.0 .) at /share/Web/mythweb/mythweb.pl line 9., referer: http://192.168.25.120/mythweb/tv/recorded
[Tue Jul 03 17:19:18 2012] [error] [client 192.168.25.121] BEGIN failed--compilation aborted at /share/Web/mythweb/mythweb.pl line 9., referer: http://192.168.25.120/mythweb/tv/recorded

Doing a find / -name DBI.pm has no hits. I found some others over here having the same issue for other applications, but no one has responded with a solution.
321liftoff
Know my way around
 
Posts: 142
Joined: Sat Oct 22, 2011 6:54 pm
NAS Model: TS-219P+

Re: mythtv mythweb installation success on ts-219p

Postby 321liftoff » Wed Jul 04, 2012 7:08 pm

Was able to install it through "ipkg install perl-dbi". Then I got an error: "install_driver(mysql) failed: Can't locate DBD/mysql.pm". My first reaction was to do "ipkg install perl-dbd-mysql", which is version 4.006-1 26-Dec-2007 (latest is 4.021 28-Apr-2012), but that installed mysql 4.1.22-3 alongside the stock mysql 5.1.36, which caused issues with mythweb. Following instructions here, I tried compiling 4.021 using CPAN and when it failed, I tried from scratch but got the same result:
Code: Select all
# perl Makefile.PL


PLEASE NOTE:

For 'make test' to run properly, you must ensure that the
database user 'admin' can connect to your MySQL server
and has the proper privileges that these tests require such
as 'drop table', 'create table', 'drop procedure', 'create procedure'
as well as others.

mysql> grant all privileges on test.* to 'admin'@'localhost' identified by 's3kr1t';

You can also optionally set the user to run 'make test' with:

perl Makefile.PL --testuser=username

I will use the following settings for compiling and testing:

  cflags        (mysql_config) = -I/usr/local/mysql/include/mysql  -I/opt/cross-project/arm/marvell/arm-none-linux-gnueabi/libc/marvell-f/usr/include -I/opt/cross-project/arm/marvell/arm-none-linux-gnueabi/libc/marvell-f/include   -DUNIV_LINUX
  embedded      (mysql_config) =
  ldflags       (mysql_config) = -rdynamic
  libs          (mysql_config) = -L/opt/cross-project/arm/marvell/arm-none-linux-gnueabi/libc/marvell-f/lib -L/opt/cross-project/arm/marvell/arm-none-linux-gnueabi/libc/marvell-f/usr/lib -L/usr/local/mysql/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm
  mysql_config  (guessed     ) = mysql_config
  nocatchstderr (default     ) = 0
  nofoundrows   (default     ) = 0
  ssl           (guessed     ) = 0
  testdb        (default     ) = test
  testhost      (default     ) =
  testpassword  (default     ) =
  testsocket    (default     ) =
  testuser      (guessed     ) = admin

To change these settings, see 'perl Makefile.PL --help' and
'perldoc INSTALL'.

Checking if your kit is complete...
Looks good
Using DBI 1.620 (for perl 5.010000 on arm-none-linux-gnueabi) installed in /opt/lib/perl5/site_perl/5.10.0/arm-linux/auto/DBI/
Writing Makefile for DBD::mysql
[/share/src/DBD-mysql-4.021] # make
cp lib/DBD/mysql.pm blib/lib/DBD/mysql.pm
cp lib/DBD/mysql/GetInfo.pm blib/lib/DBD/mysql/GetInfo.pm
cp lib/DBD/mysql/INSTALL.pod blib/lib/DBD/mysql/INSTALL.pod
cp lib/Bundle/DBD/mysql.pm blib/lib/Bundle/DBD/mysql.pm
arm-none-linux-gnueabi-gcc -c  -I/opt/lib/perl5/site_perl/5.10.0/arm-linux/auto/DBI -I/usr/local/mysql/include/mysql  -I/opt/cross-project/arm/marvell/arm-none-linux-gnueabi/libc/marvell-f/usr/include -I/opt/cross-project/arm/marvell/arm-none-linux-gnueabi/libc/marvell-f/include   -DUNIV_LINUX -DDBD_MYSQL_INSERT_ID_IS_GOOD -g  -fno-strict-aliasing -pipe -I/opt/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2   -DVERSION=\"4.021\" -DXS_VERSION=\"4.021\" -fPIC "-I/opt/lib/perl5/5.10.0/arm-linux/CORE"   dbdimp.c
/share/MD0_DATA/.qpkg/Optware/bin/perl5.10.0 -p -e "s/~DRIVER~/mysql/g" /opt/lib/perl5/site_perl/5.10.0/arm-linux/auto/DBI/Driver.xst > mysql.xsi
/share/MD0_DATA/.qpkg/Optware/bin/perl5.10.0 /opt/lib/perl5/5.10.0/ExtUtils/xsubpp  -typemap /opt/lib/perl5/5.10.0/ExtUtils/typemap  mysql.xs > mysql.xsc && mv mysql.xsc mysql.c
Warning: duplicate function definition 'do' detected in mysql.xs, line 242
Warning: duplicate function definition 'rows' detected in mysql.xs, line 752
arm-none-linux-gnueabi-gcc -c  -I/opt/lib/perl5/site_perl/5.10.0/arm-linux/auto/DBI -I/usr/local/mysql/include/mysql  -I/opt/cross-project/arm/marvell/arm-none-linux-gnueabi/libc/marvell-f/usr/include -I/opt/cross-project/arm/marvell/arm-none-linux-gnueabi/libc/marvell-f/include   -DUNIV_LINUX -DDBD_MYSQL_INSERT_ID_IS_GOOD -g  -fno-strict-aliasing -pipe -I/opt/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2   -DVERSION=\"4.021\" -DXS_VERSION=\"4.021\" -fPIC "-I/opt/lib/perl5/5.10.0/arm-linux/CORE"   mysql.c
Running Mkbootstrap for DBD::mysql ()
chmod 644 mysql.bs
rm -f blib/arch/auto/DBD/mysql/mysql.so
LD_RUN_PATH="/usr/local/mysql/lib/mysql:/opt/lib" /share/MD0_DATA/.qpkg/Optware/bin/perl5.10.0 myld arm-none-linux-gnueabi-ld  -shared -O2 -L/opt/lib -L/opt/local/lib dbdimp.o mysql.o  -o blib/arch/auto/DBD/mysql/mysql.so    \
   -L/usr/local/mysql/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm     \

make: *** [blib/arch/auto/DBD/mysql/mysql.so] Error 1

Next, I'm trying to compile 4.006 from scratch, and may try to install again by ipkg but then remove mysql. It may not like that because of the dependency, but it's worth the try...

EDIT: got the same error compiling DBD-mysql-4.006 as the newer version. Also, installing perl-dbd-mysql, then removing mysql left me with this error:
install_driver(mysql) failed: Can't load '/opt/lib/perl5/site_perl/5.10.0/arm-linux/auto/DBD/mysql/mysql.so' for module DBD::mysql: libmysqlclient_r.so.14: cannot open shared object file: No such file or directory at /opt/lib/perl5/5.10.0/arm-linux/DynaLoader.pm line 203., referer: http://192.168.25.120/mythweb/tv/recorded

I can't find out how to get a libmysqlclient file on the qnap...
321liftoff
Know my way around
 
Posts: 142
Joined: Sat Oct 22, 2011 6:54 pm
NAS Model: TS-219P+

Re: mythtv mythweb installation success on ts-219p

Postby vbier » Sun Aug 12, 2012 2:56 pm

I can't help you with your mysql problem, but I managed to get digest authentication to work.
I had to additionally load the module, here are the relevant lines of my conf file:

LoadModule auth_digest_module modules/mod_auth_digest.so
AuthType Digest
AuthName "xxxxx"
AuthUserFile /etc/config/apache/extra/password.digest

Edit: I just updated the MythTV installation wiki page at http://wiki.qnap.com/wiki/How_to_install_MythTV#MythWeb
vbier
Starting out
 
Posts: 16
Joined: Mon Jun 11, 2012 3:57 pm
NAS Model: TS-x19P II

Re: mythtv mythweb installation success on ts-219p

Postby vbier » Fri Oct 12, 2012 7:40 pm

I just managed to get the perl modules installed:
Code: Select all
ln -s /opt/bin/ld /opt/bin/ arm-none-linux-gnueabi-ld
perl -MCPAN -e shell
force install IO::Socket::INET6
install HTTP::Request
install LWP::UserAgent
install Net::UPnP::QueryResponse
install Net::UPnP::ControlPoint
install DBD::mysql


The install fails, I then went to /root/.cpan/build/DBD-mysql-4.022-n8FEgl and typed:
Code: Select all
perl Makefile.PL  --mysql_config /usr/local/mysql/bin/mysql_config
make
make install


Afterwards, the mythtv configure enables the perl bindings. I have not tested it yet, I still have to do the make and install of mythtv.

Edit: okay, downloading and streaming works after I created a symlink for perl
Code: Select all
ln -s /opt/bin/perl /usr/bin/perl
vbier
Starting out
 
Posts: 16
Joined: Mon Jun 11, 2012 3:57 pm
NAS Model: TS-x19P II


Return to Web Server & Applications (Apache + PHP + MySQL / SQLite)

Who is online

Users browsing this forum: No registered users and 1 guest