[mythtv-users] Securing /var/www/html loses WAP access

Trey Thompson treythompson at gmail.com
Sun Oct 29 05:33:51 UTC 2006


On 10/26/06, Trey Thompson <treythompson at gmail.com> wrote:
> > > > Following the wiki:
> > > > http://www.mythtv.org/wiki/index.php/Securing_MythWeb
> > > >
> > > > I secured Apache with this, and when enabled, the WAP pages no longer appear
> > > > on my phone, the main full default templates appear...
> > > >
> > > > The security, other than the WAP problem, appears to function perfectly...
> > > >
> > > >
> > > > <Directory "/var/www/html">
> > > > Options FollowSymLinks
> > > > AuthType Basic
> > > > AuthName "MythTV"
> > > > AuthUserFile PASSFILEHERE
> > > > Require user USERNAMEHERE
> > > > Order allow,deny
> > > > Allow from 192.168.201.
> > > > #Allow from all
> > > > Satisfy Any
> > > > AllowOverride None
> > > > </Directory>
> > > >
> > > > Thoughts?
> > > >
> > > >
> > >
> > > OK, here's some more detailed information.  I took snippets of the
> > > access_log from apache to see what kind of requests are going on when
> > > the security is on, and when it is off.  Here's the results, nothing
> > > is jumping out at me.
> > >
> > > No security
> > >
> > > <Directory "/var/www/html">
> > > Options FollowSymLinks
> > > #AuthType Basic
> > > #AuthName "MythTV"
> > > #AuthUserFile /etc/httpd-passwords
> > > #Require user trey
> > > Order allow,deny
> > > #Allow from 192.168.201.
> > > Allow from all
> > > Satisfy Any
> > > AllowOverride None
> > > </Directory>
> > >
> > > 70.196.29.107 - - [25/Oct/2006:13:15:54 -0500] "GET /mythweb/
> > > HTTP/1.1" 200 489 "-" "Mozilla/4.0 (compatible; MSIE 4.01; Windows CE;
> > > PPC; 240x320)"
> > > 70.196.29.107 - - [25/Oct/2006:13:15:55 -0500] "GET
> > > /mythweb/skins/wap/style.css HTTP/1.1" 304 -
> > > "http://cmt.verustech.com/mythweb/" "Mozilla/4.0 (compatible; MSIE
> > > 4.01; Windows CE; PPC; 240x320)"
> > > 70.196.29.107 - - [25/Oct/2006:13:15:56 -0500] "GET
> > > /mythweb/skins/wap/handheld.css HTTP/1.1" 304 -
> > > "http://cmt.verustech.com/mythweb/" "Mozilla/4.0 (compatible; MSIE
> > > 4.01; Windows CE; PPC; 240x320)"
> > > 70.196.29.107 - - [25/Oct/2006:13:15:56 -0500] "GET
> > > /mythweb/skins/wap/img/mythtv-logo.gif HTTP/1.1" 304 -
> > > "http://cmt.verustech.com/mythweb/" "Mozilla/4.0 (compatible; MSIE
> > > 4.01; Windows CE; PPC; 240x320)"
> > >
> > > With Security in place
> > >
> > > <Directory "/var/www/html">
> > > Options FollowSymLinks
> > > #AuthType Basic
> > > #AuthName "MythTV"
> > > #AuthUserFile /etc/httpd-passwords
> > > #Require user trey
> > > Order allow,deny
> > > #Allow from 192.168.201.
> > > Allow from all
> > > Satisfy Any
> > > AllowOverride None
> > > </Directory>
> > >
> > > 70.196.29.107 - - [25/Oct/2006:13:17:38 -0500] "GET /mythweb/
> > > HTTP/1.1" 401 483 "-" "Mozilla/4.0 (compatible; MSIE 4.01; Windows CE;
> > > PPC; 240x320)"
> > > 70.196.29.107 - trey [25/Oct/2006:13:17:39 -0500] "GET /mythweb/
> > > HTTP/1.1" 200 2062 "-" "Mozilla/4.0 (compatible; MSIE 4.01; Windows
> > > CE; PPC; 240x320)"
> > > 70.196.29.107 - trey [25/Oct/2006:13:17:40 -0500] "GET
> > > /mythweb/js/init.js HTTP/1.1" 200 1487
> > > "http://cmt.verustech.com/mythweb/" "Mozilla/4.0 (compatible; MSIE
> > > 4.01; Windows CE; PPC; 240x320)"
> > > 70.196.29.107 - trey [25/Oct/2006:13:17:41 -0500] "GET
> > > /mythweb/js/browser.js HTTP/1.1" 200 13095
> > > "http://cmt.verustech.com/mythweb/" "Mozilla/4.0 (compatible; MSIE
> > > 4.01; Windows CE; PPC; 240x320)"
> > > 70.196.29.107 - trey [25/Oct/2006:13:17:43 -0500] "GET
> > > /mythweb/js/utils.js HTTP/1.1" 200 9299
> > > "http://cmt.verustech.com/mythweb/" "Mozilla/4.0 (compatible; MSIE
> > > 4.01; Windows CE; PPC; 240x320)"
> > > 70.196.29.107 - trey [25/Oct/2006:13:17:44 -0500] "GET
> > > /mythweb/js/mouseovers.js HTTP/1.1" 200 20406
> > > "http://cmt.verustech.com/mythweb/" "Mozilla/4.0 (compatible; MSIE
> > > 4.01; Windows CE; PPC; 240x320)"
> > > 70.196.29.107 - trey [25/Oct/2006:13:17:46 -0500] "GET
> > > /mythweb/js/visibility.js HTTP/1.1" 200 3722
> > > "http://cmt.verustech.com/mythweb/" "Mozilla/4.0 (compatible; MSIE
> > > 4.01; Windows CE; PPC; 240x320)"
> > > 70.196.29.107 - trey [25/Oct/2006:13:17:47 -0500] "GET
> > > /mythweb/js/ajax.js HTTP/1.1" 200 4792
> > > "http://cmt.verustech.com/mythweb/" "Mozilla/4.0 (compatible; MSIE
> > > 4.01; Windows CE; PPC; 240x320)"
> > > 70.196.29.107 - trey [25/Oct/2006:13:17:48 -0500] "GET
> > > /mythweb/skins/default//style.css HTTP/1.1" 200 5530
> > > "http://cmt.verustech.com/mythweb/" "Mozilla/4.0 (compatible; MSIE
> > > 4.01; Windows CE; PPC; 240x320)"
> > > 70.196.29.107 - trey [25/Oct/2006:13:17:49 -0500] "GET
> > > /mythweb/skins/default//header.css HTTP/1.1" 200 2740
> > > "http://cmt.verustech.com/mythweb/" "Mozilla/4.0 (compatible; MSIE
> > > 4.01; Windows CE; PPC; 240x320)"
> > > 70.196.29.107 - trey [25/Oct/2006:13:17:50 -0500] "GET
> > > /mythweb/skins/default//menus.css HTTP/1.1" 200 5488
> > > "http://cmt.verustech.com/mythweb/" "Mozilla/4.0 (compatible; MSIE
> > > 4.01; Windows CE; PPC; 240x320)"
> > > 70.196.29.107 - trey [25/Oct/2006:13:17:51 -0500] "GET
> > > /mythweb/skins/default//programming.css HTTP/1.1" 200 4395
> > > "http://cmt.verustech.com/mythweb/" "Mozilla/4.0 (compatible; MSIE
> > > 4.01; Windows CE; PPC; 240x320)"
> > > 70.196.29.107 - trey [25/Oct/2006:13:17:51 -0500] "GET
> > > /mythweb/skins/default//welcome.css HTTP/1.1" 200 1404
> > > "http://cmt.verustech.com/mythweb/" "Mozilla/4.0 (compatible; MSIE
> > > 4.01; Windows CE; PPC; 240x320)"
> > > 70.196.29.107 - trey [25/Oct/2006:13:17:52 -0500] "GET
> > > /mythweb/skins/default/img/mythtv-logo.png HTTP/1.1" 200 10279
> > > "http://cmt.verustech.com/mythweb/" "Mozilla/4.0 (compatible; MSIE
> > > 4.01; Windows CE; PPC; 240x320)"
> > > 70.196.29.107 - trey [25/Oct/2006:13:17:52 -0500] "GET
> > > /mythweb/skins/default/img/tv.png HTTP/1.1" 200 2936
> > > "http://cmt.verustech.com/mythweb/" "Mozilla/4.0 (compatible; MSIE
> > > 4.01; Windows CE; PPC; 240x320)"
> > > 70.196.29.107 - trey [25/Oct/2006:13:17:53 -0500] "GET
> > > /mythweb/skins/default/img/video.png HTTP/1.1" 200 2662
> > > "http://cmt.verustech.com/mythweb/" "Mozilla/4.0 (compatible; MSIE
> > > 4.01; Windows CE; PPC; 240x320)"
> > > 70.196.29.107 - trey [25/Oct/2006:13:17:54 -0500] "GET
> > > /mythweb/skins/default/img/weather.png HTTP/1.1" 200 4283
> > > "http://cmt.verustech.com/mythweb/" "Mozilla/4.0 (compatible; MSIE
> > > 4.01; Windows CE; PPC; 240x320)"
> > > 70.196.29.107 - trey [25/Oct/2006:13:17:54 -0500] "GET
> > > /mythweb/skins/default/img/settings.png HTTP/1.1" 200 4522
> > > "http://cmt.verustech.com/mythweb/" "Mozilla/4.0 (compatible; MSIE
> > > 4.01; Windows CE; PPC; 240x320)"
> > > 70.196.29.107 - trey [25/Oct/2006:13:17:54 -0500] "GET
> > > /mythweb/skins/default//img/tv.png HTTP/1.1" 200 2936
> > > "http://cmt.verustech.com/mythweb/" "Mozilla/4.0 (compatible; MSIE
> > > 4.01; Windows CE; PPC; 240x320)"
> > >
> >
> > Does anyone have Myth .20, password protected, WAP access working?
> >
>
> OK, so for those following, if any, I've been chasing this down
> looking through PHP.  I've found this area in the init.php file:
>
> // Reset the template?
>    if ($_REQUEST['RESET_TMPL'] || $_REQUEST['RESET_TEMPLATE'])
>        $_SESSION['tmpl'] = 'default';
> // If the requested template is missing the welcome file, look for
> other options
>    else if (!file_exists(modules_path.'/_shared/tmpl/'.$_SESSION['tmpl'].'/welcome.php'))
> {
>    // Detect different types of browsers and set the theme accordingly.
>        require_once "includes/mobile.php";
>        if (isMobileUser()) {
>        // Browser is mobile but does it accept HTML? If not, use the WML theme.
>            if (browserAcceptsMediaType(array('text/html', '\*/\*')))
>                 $_SESSION['tmpl'] = 'wap';
>            else
>                 $_SESSION['tmpl'] = 'wml';
>        // Make sure the skin is set to the appropriate phone-template type
>        /** @todo eventually, we'll put all of this in the skins section */
>            $_SESSION['skin'] = $_SESSION['tmpl'];
>            define('skin', $_SESSION['skin']);
>        }
>    // Otherwise set the default theme.
>        else {
>             $_SESSION['tmpl'] = 'default';
>        }
>    }
>
> I thought I could FORCE it to the wap or wml template by setting the
> last part to that instead of 'default', but no go.
>
> Any thoughts?
>

Well, I echoed out the variable $_SESSION['tmpl'] when auth was off,
and it was 'wap'.  Then, I turned on Basic Authentication, and now
it's 'default'.

Please please please, someone knowledgeable in php help.  :)  Maybe
xris?  He/She's the documented author...?

I'll say thank you!  I promise!


More information about the mythtv-users mailing list