www.mamboteam.com
macsat.com - OpenWrt | Olegs Firmware  
Home arrow Tutorials - OpenWrt (White Russian) arrow tthttpd on OpenWRT Tutorial
Tuesday, 14 October 2008
 
 
Main Menu
Home
About
News
Tutorials - OpenWrt (WR)
Tutorials - Oleg
Wiki (RDC Based Routers)
Online Shop
Forum
Downloads
Free Linux eBooks
Links
Search
Contact Us
We have 1 guest online
2717238 Visitors
Login
Welcome Guest.






Lost Password?
No account yet? Register
Old macsat.com
Nokia Unlock (Dansk)
Nokia Unlock (English)
XBins IRC Chat
tthttpd on OpenWRT Tutorial PDF Print E-mail
(1 vote)
Written by macsat   
Thursday, 24 November 2005

The Tutorial is made using a ASUS WL-500G Deluxe (or WL-500GX and WL-500GD as it is sometimes called).
It should however apply to all "OpenWRT Compatible" devices, even though some details like hardware ad\dresses, storage locations and so on could differ if you use other hardware. Check out the General OpenWRT Tutorial Information page for more information.

This Tutorial will leave you with a full PHP Enabled web server that is accessible from WAN.
The web server will use /www on the router as root for requests to http://your_router_ip

Tutorial Index

1. Prerequisites - What is needed to get started.
2. Installing and Configuring thttpd

Prerequisites

All you need is :
  • An OpenWRT compatible router
  • OpenWRT 1.0 WhiteRussian RC2 or later
  • In the last part of the Installing and Configuring Tutorial I make the web server reachable from WAN.

    Installing and Configuring thttpd

    Installing is simple. We download an ipk package and install it:
    cd /tmp
    wget http://www.lillesansfil.org/ipkg/thttpd-php_2.21b-2_mipsel.ipk
    ipkg install thttpd-php_2.21b-2_mipsel.ipk

    Before starting the thttpd server, you need to make a config file.
    Create /etc/thttpd.conf and configure it something like:
    dir=/www
    port=80
    user=nobody
    nochroot
    nosymlink
    novhost
    logfile=/var/log/thttpd.log
    pidfile=/var/run/thttpd.pid

    For now we disable the build-in (busybox) httpd server, it could come in handy later if you want to install some kind of Administration Web Page:
    mv /etc/init.d/S50httpd /etc/init.d/K50httpd
    killall httpd

    We need to activate the thttpd server, create the file /etc/init.d/S80thttpd :
    #!/bin/sh
    thttpd -C /etc/thttpd.conf

    Make it executable:
    chmod +x /etc/init.d/S80thttpd


    Now you can either reboot the router, or simply start the server witht he S80thttpd file we created:
    /etc/init.d/S80thttpd

    To test your php installation, you can create a php file in /www :
    echo "<?php phpinfo(); ?>" > /www/phpinfo.php

    Redirect your web browser to either http://RouterInternalIP/phpinfo.php or http://YourWANAddress/phpinfo.php to see the php test page.

    I hope you found this tutorial useful.
    Comments and questions are welcome at the Support Forum

  • Last Updated ( Tuesday, 10 January 2006 )
     
    < Prev   Next >
    Buy Router
    Buffalo Technology WBR2G54
    Buffalo Technology WBR2G54
    Recent Forum Topics
    Donations

    If you appriciate this site, please consider making a small donation.

    All donations will be used to cover expenses from running macsat.com.

    Sponsored Ads
     
    Top! Top!