| tthttpd on OpenWRT Tutorial |
|
|
|
| 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 Index1. Prerequisites - What is needed to get started.2. Installing and Configuring thttpd PrerequisitesAll you need is :Installing and Configuring thttpdInstalling 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. |
|
| Last Updated ( Tuesday, 10 January 2006 ) |
| < Prev | Next > |
|---|







