Addon: Custom Webserver

Discussion in 'Tomato Firmware' started by xcooling, Jun 13, 2008.

  1. xcooling

    xcooling LI Guru Member

    This is a very early Alpha.. but it does work.

    Guys I need ur help with this one

    Limitations/know bugs:
    .htacess not working
    default root gives error ( 500 Unknown Read error )
    have to specify the page (
    requires a login ( default tomato config details)

    Custom 404 redirect page
    .htacces usage

    Port :999
    Routers IP:
    directory: /tmp/www/

    #// Webserver : Version 0.0.1 : 13 June 2008
    #// Created by Adrian Jon Kriel: root-AT-extremecooling-DOT-org
    #// Uses (either): 
    #// Serving http content
    #// Goals:
    #// To tidy adblocking (blocked traffic redirected to the wedserver and having micro content fill the blocked content)
    #// serve cusom pages
    #// Create a shellscript containing the following and chmod 777 (/tmp/ or paste the following into the console.
    eval WWWPORT="999"
    eval WWWDIR="/tmp/www"
    #// Create temp www directory
    mkdir $WWWDIR
    #// Create .htaccess
    touch $WWWDIR/.htaccess
    chmod 666 $WWWDIR/.htaccess
    cat > $WWWDIR/.htaccess <<EOF
    errordocument 400
    errordocument 404
    errordocument 405
    errordocument 414
    RedirectMatch 301 \.gif$
    RedirectMatch 301 \.jpg$
    RedirectMatch 301 .*banner.*
    RedirectMatch 301 ^image
    #// Create index.htm
    touch $WWWDIR/index.htm
    chmod 666 $WWWDIR/index.htm
    cat > $WWWDIR/index.htm <<EOF
    <head><title>IT WORKS</title></head>
    <body><H2>IT WORKS</H2></body>
    #// Display some info
    echo "Launch webbrowser:$WWWPORT/index.htm"
    echo "CTRL + C to stop the test webserver (non deamon mode)"
    #// Launch webserver to test
    /usr/sbin/httpd -d -p $WWWPORT $WWWDIR
  2. xcooling

    xcooling LI Guru Member

    Found silentaccord post
    ^^ this method is far from ideal, to load another 1MByte of data onto the router is something thats not a viable option.

    Does anyone know the current httpd server is based on ( i know its been customised)

    mini_httpd (1.19 ?) or micro_httpd (12dec2005 ?)
  3. xcooling

    xcooling LI Guru Member

    Anyone able to offer any info or support ?
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice