# Mythweb showing directory listing, not UI - SOLVED

## woZa

Hi. I am running a 64bit version of gentoo.

Have just installed mythweb and all I am getting is the directory listing when I point my browser to it.

I know that php is working correctly as phpmyadmin works just fine. I even have authentication working just fine...

Not sure where to be looking next. Any input gladly received.

```
[ebuild   R   ] dev-lang/php-5.2.6_rc1-r1  USE="apache2 berkdb cli crypt ctype dbase gd gdbm iconv ipv6 mysql ncurses nls pcre posix readline reflection session spl ssl unicode zlib ..." 0 kB 

[ebuild   R   ] www-apps/mythweb-0.21_p16468  USE="-vhosts" 0 kB 

```

```
APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D LANGUAGE -D SSL -D SSL_DEFAULT_VHOST -D PHP5"
```

----------

## woZa

Ok so an error message is showing in apache2 error log...

```
[Tue Mar 18 12:12:48 2008] [error] [client 10.0.1.2] client used wrong authentication scheme: /mythweb/

[Tue Mar 18 12:12:50 2008] [error] [client 10.0.1.2] File does not exist: /var/www/localhost/icons/blank.gif, referer: http://10.0.1.3/mythweb/

[Tue Mar 18 12:12:50 2008] [error] [client 10.0.1.2] File does not exist: /var/www/localhost/icons/back.gif, referer: http://10.0.1.3/mythweb/

[Tue Mar 18 12:12:50 2008] [error] [client 10.0.1.2] File does not exist: /var/www/localhost/icons/folder.gif, referer: http://10.0.1.3/mythweb/

[Tue Mar 18 12:12:50 2008] [error] [client 10.0.1.2] File does not exist: /var/www/localhost/icons/text.gif, referer: http://10.0.1.3/mythweb/

[Tue Mar 18 12:12:50 2008] [error] [client 10.0.1.2] File does not exist: /var/www/localhost/icons/unknown.gif, referer: http://10.0.1.3/mythweb/

```

What other authentication schemes are there?

Perhaps apache isn't up and running properly. Pointing the browser to 10.0.1.3 (ip of server) just gives a partial directory listing of phpmyadmin & not mythweb. Shouldn't there be a welcome page?

----------

## woZa

Well I removed apache2 and all config files and reinstalled and now I get the "It Works" when pointing my browser at 10.0.1.3 (server host)

Phpmyadmin works fine and as expected but still just get a directory listing with mythweb. This time with no errors in the apache logs but get the following in the access.log

```
10.0.1.2 - - [18/Mar/2008:17:45:17 +0000] "GET /mythweb HTTP/1.1" 301 290

10.0.1.2 - - [18/Mar/2008:17:45:17 +0000] "GET /mythweb/ HTTP/1.1" 200 1702

10.0.1.2 - - [18/Mar/2008:17:45:18 +0000] "GET /icons/blank.gif HTTP/1.1" 304 -

10.0.1.2 - - [18/Mar/2008:17:45:18 +0000] "GET /icons/back.gif HTTP/1.1" 304 -

10.0.1.2 - - [18/Mar/2008:17:45:18 +0000] "GET /icons/folder.gif HTTP/1.1" 304 -

10.0.1.2 - - [18/Mar/2008:17:45:18 +0000] "GET /icons/text.gif HTTP/1.1" 304 -

10.0.1.2 - - [18/Mar/2008:17:45:18 +0000] "GET /icons/unknown.gif HTTP/1.1" 304 -

```

and clicking on the mythweb.php in the browser gives the following

```
Database Setup Error

The database environment variables are not correctly set in the

webserver conf or .htaccess file. Please read through the comments

included in the file and set up the db_* environment variables correctly.

Some possible solutions are to make sure that mod_env is enabled

in httpd.conf, as well as having followed the instructions in the

README and INSTALL files.

```

Can't find any README or INSTALL files but I'll have a look through .htaccess

----------

## woZa

Contents of /var/www/localhost/htdocs/mythweb/data/.htaccess

```
# Allow the webserver to follow symlinks in the data directory, but not to

# execute any commands, browse directory indexes, etc.

    Options -All +FollowSymLinks +IncludesNoExec
```

Is this all that should be in there?

The line 

```
LoadModule env_module modules/mod_env.so
```

 is in /etc/apache2/httpd.conf so presumably the module is loaded...

----------

## drescherjm

 *woZa wrote:*   

> Contents of /var/www/localhost/htdocs/mythweb/data/.htaccess
> 
> ```
> # Allow the webserver to follow symlinks in the data directory, but not to
> 
> ...

 

That is all I have there. What about /var/www/localhost/htdocs/mythweb/.htaccess?

This is 158 lines for me although I edited the file to allow security.

----------

## woZa

No file there. /var/www/localhost/htdocs/mythweb/data/.htaccess is the only .htaccess I have in the mythweb directory...

Any chance you could post yours for me?

Thanks

Alex

----------

## drescherjm

 *woZa wrote:*   

> Pointing the browser to 10.0.1.3 (ip of server) just gives a partial directory listing of phpmyadmin & not mythweb. Shouldn't there be a welcome page?

 

You should be using http://10.0.1.3/mythweb

----------

## woZa

 *drescherjm wrote:*   

>  *woZa wrote:*   Pointing the browser to 10.0.1.3 (ip of server) just gives a partial directory listing of phpmyadmin & not mythweb. Shouldn't there be a welcome page? 
> 
> You should be using http://10.0.1.3/mythweb

 

I have been. Just shortened it for speed of posting...   :Smile: 

----------

## drescherjm

```
jmd1 ~ # cat /var/www/localhost/htdocs/mythweb/.htaccess

#

# .htaccess file for MythWeb.  Please read the descriptive comments for help

# using these directives in your own setup.  If you so desire (and for a small

# increase in efficiency, you can put this entire block into the apache config

# for your MythWeb host configuration).

#

# See http://www.mythtv.org/ for information about MythTV itself.

#

# @url       $URL$

# @date      $Date: 2006-06-28 14:33:11 -0400 (Wed, 28 Jun 2006) $

# @version   $Revision: 10338 $

# @author    $Author: xris $

#

#

# I *strongly* urge you to turn on authentication for MythWeb.  It is disabled

# by default because it requires you to set up your own password file.  Please

# see the man page for htdigest and then configure the folowing four directives

# to suit your authentication needs.

#

#     AuthType           Digest

     AuthType           Basic

     AuthName           "MythTV"

     AuthGroupFile      /dev/null

     AuthUserFile       /etc/apache2/.htpasswd

     Require            valid-user

     #Require           user john

     BrowserMatch       "MSIE"      AuthDigestEnableQueryStringHack=On

#     Satisfy           any

#

#  * If you're running Apache earlier than 2.2, you will need to use

#    AuthDigestFile instead of AuthUserFile.

# MythTV now uses the correct file suffix for mpeg files, so all .nuv files

# should actually be NuppleVideo.  However, apache probably doesn't know what

# those are, so we should tell it.

    AddType video/nuppelvideo   .nuv

# Specify the MIME type for favicon.ico in case the server configuration

# doesn't or in case the server configuration uses the IANA-approved MIME type

# (image/vnd.microsoft.icon)--which most browsers won't recognize.

    AddType image/x-icon        .ico

# Some special instructions for the PHP files of MythWeb.

    <Files mythweb.*>

    #

    # Use the following environment settings to tell MythWeb where you want it to

    # look to connect to the database, the name of the database to connect to, and

    # the authentication info to use to connect.  The defaults will usually work

    # fine unless you've changed mythtv's mysql.txt file, or are running MythWeb on

    # a different server from your main backend.  Make sure you have mod_env enabled.

    #

        setenv db_server        "jmd1"

        setenv db_name          "mythconverg"

        setenv db_login         "mythtv"

        setenv db_password      "mythtv"

    #

    # By default, MythWeb uses the hostname program to look up the hostname of the

    # machine it runs on.  If this reports incorrect data, or you run MythWeb on a

    # machine without the hostname program, set this to your current hostname.

    #

    #   setenv hostname         "my_mythbox"

    #

    # By default, php will always search the current directory for include files,

    # but if you wish to install these directories outside of the current path

    # (eg. for security reasons), set this variable to the directory that

    # contains the directories like languages and templates.  eg.

    #

    #   setenv include_path      "/usr/share/mythweb"

    # If you want MythWeb to email php/database errors (and a backtrace) to you,

    # uncomment and set the email address below.

    #

    #   setenv error_email       "mythweb_errors@example.com"

    #

    # If your local file system is something other than UTF-8, set this variable

    # so that the music and video portions of MythWeb can provide proper links

    # to your downloadable files.

    #

    #   setenv fs_encoding       "ISO-8859-1"

    #  These settings are intended for apache 2.x.  If your version of apache

    #  doesn't support php_value, or things like memory_limit aren't working

    #  as expected, then use these settings as examples for your own php.ini

    #  files.

        php_value safe_mode                     0

        php_value memory_limit                  32M

        php_value output_buffering              4096

        php_value register_globals              0

        php_value magic_quotes_gpc              0

        php_value file_uploads                  0

        php_value allow_url_fopen               On

        php_value zlib.output_handler           Off

        php_value zlib.output_compression       16384

        php_value zlib.output_compression_level 4

        php_value url_rewriter.tags             a=href,area=href,frame=src,input=src,form=action

    # These values do not change - bug in php

        php_value output_handler                NULL

    # php_flag does not work in older versions of php

        php_flag output_handler                 "NULL"

        php_flag short_open_tag                 "On"

    </Files>

# Execute perl scripts in cgi mode (so we can stream properly)

    <Files *.pl>

        SetHandler cgi-script

        Options    +ExecCGI

    </Files>

#<LocationMatch .*/pl/stream/[0-9]+/[0-9]+>

#            Allow from all

#</LocationMatch>

#

# The settings below relate specifically to mod_rewrite and the rewrite engine

# used to make the MythWeb user experience a little easier to deal with by

# simplifying the URL's neeced to access the various sections.  Do not touch

# these settings unless you really know what you're doing..

#

# Turn on the rewrite engine

    RewriteEngine  on

# If MythWeb is installed outside of the document root (eg. using Alias) then

# you will need to set this directive to the base URL that MythWeb is visible

# from externally.  If you do not, the web server will return 'not found'.  eg.

    RewriteBase    /mythweb

# Skip out early if we've already been through rewrites,

# or if this is a /css/, /js/ or /cache/ directory request.

    RewriteRule    ^(css|data|images|js|themes|skins|[a-z_]+\.(php|pl))(/|$)     -     [L]

# Redirect /pl/ requests to the perl cgi handler.

    RewriteRule     ^(pl(/.*)?)$            mythweb.pl/$1               [QSA,L]

# Redirect most of the remaining URL requests to the main mythweb script.

# It will then handle any requests given to it.

    RewriteRule     ^(.+)$                  mythweb.php/$1              [QSA,L]

# If you're experiencing trouble with the previous two lines in your copy of

# apache, you could instead use something like:

#    RewriteRule     ^(pl(/.*)?)$           mythweb.pl?PATH_INFO=/$1    [L,QSA]

#    RewriteRule     ^(.+)$                 mythweb.php?PATH_INFO=/$1   [L,QSA]

# Catch anything else that comes through and send it to mythweb.php with no parameters.

    RewriteRule     ^(.*)$                  mythweb.php                 [QSA,L]

jmd1 ~ #

```

I have had mythweb installed for 3+ years so this probably is very old but it does work in 0.21 which I have been using for a very long time now... 

You will have to edit the AuthType part perhaps by commenting it out for now.

----------

## woZa

Thanks for that... That file is very similar (same as) to /var/www/localhost/htdocs/mythweb/mythweb.conf.apache which I have edited as I needed. Perhaps it needs copying to .htaccess. I will try and post back.

Thanks

Alex

----------

## woZa

Edited out some things from the mythweb.conf.apache file (<directory> & AllowOverride etc...) and saved as .htaccess and it's working!

Had to edit /etc/php/apache2-php5/php.ini and change allow_url_fopen = Off to On to get backend status working.

I wonder why the server isn't picking up the mythweb.conf.apache file? Oh well. As long as it works...

Thanks for your help...

Alex

----------

## drescherjm

 *Quote:*   

> Had to edit /etc/php/apache2-php5/php.ini and change allow_url_fopen = Off to On

 

Now, I remember that. Very important step...

----------

## nhe

 *Quote:*   

> I wonder why the server isn't picking up the mythweb.conf.apache file? Oh well. As long as it works...

 

The docs talk about renaming mythweb.conf.apache to mythweb.conf and move it into apache's "extra config files" directory.

Not 100% sure where this directory is on gentoo I tried /etc/apache2/modules.d/ and this worked for me.

Best Regards,

Nick

----------

## woZa

 *nhe wrote:*   

>  *Quote:*   I wonder why the server isn't picking up the mythweb.conf.apache file? Oh well. As long as it works... 
> 
> The docs talk about renaming mythweb.conf.apache to mythweb.conf and move it into apache's "extra config files" directory.
> 
> Not 100% sure where this directory is on gentoo I tried /etc/apache2/modules.d/ and this worked for me.
> ...

 

Thanks Nick, that did it. Couldn't find that info anywhere...

Cheers

Alex

----------

