Skip to content

Lighttpd web server with PHP support through Entware

jumblies edited this page Dec 25, 2016 · 19 revisions

First, setup Entware from this guide.

Login to router with a terminal like putty and enter this commands:

The following tinyurl.com links are no longer active. Please update this tutorial with working links/source. Better yet, if someone can explain each step in more detail, it would greatly help n00bs understand what's going on (more than copypasta instructions)!

Since the links are deprecated, this URL helps with customization of the server. https://wiki.openwrt.org/doc/howto/http.lighttpd

opkg install lighttpd php5-cgi lighttpd-mod-fastcgi
rm /opt/etc/lighttpd/lighttpd.conf
wget -c -O /opt/etc/lighttpd/lighttpd.conf http://tinyurl.com/amvkxt3 --no-check-certificate
wget -c -O /opt/share/www/index.html http://tinyurl.com/bxfxpq6 --no-check-certificate
wget -c -O /opt/share/www/test.php http://tinyurl.com/b9b34kp --no-check-certificate
/opt/etc/init.d/S80lighttpd start

Go to router.asus.com:81 and if you see this page, the lighttpd web server is configured correctly

if

Go to router.asus.com:81/test.php and if you see this page, the php-mod-fastcgi is configured correctly

php

###TO ACCESS THE WEBSITE FROM WAN

opkg install nano
nano /jffs/scripts/firewall-start

Paste this lines

#!/bin/sh
iptables -I INPUT -p tcp --destination-port 81 -j ACCEPT

Save with CTRL-O / Enter / and exit nano with CTRL-X

Give right permission

chmod a+rx /jffs/scripts/firewall-start

Go to Port forwarding page and redirect port 80 to 81, after reboot you should have access from wan.

wan

Youtube video here

Post issues here

Clone this wiki locally