Lighttpd Web Server with PHP Support through Optware-NG

1 - Install Optware-NG from here

2 - Update optware-ng

ipkg update
ipkg upgrade

3 - Install lighttpd

ipkg install lighttpd

4 - Change server port from 8081 to 81

sed -i 's/server.port                = 8081/server.port                = 81/g' "/opt/etc/lighttpd/lighttpd.conf"

5 - Start server

/opt/etc/init.d/S80lighttpd restart

6 - Go to and if you see this page, the lighttpd web server is configured correctly

7 - Create php info page

cat >> /opt/share/www/info.php << EOF


8 - Install PHP

ipkg install php php-fcgi

9 - Restart server

/opt/etc/init.d/S80lighttpd restart

10 - Go to and if you see this page, php is configured correctly

11 - Enable access from wan

nano /jffs/scripts/firewall-start

Paste this lines

iptables -I INPUT -p tcp --destination-port 81 -j ACCEPT
Save with CTRL-O / Enter / and exit with CTRL-X
Make script executable and apply rule
chmod a+rx /jffs/scripts/firewall-start

12 - Go to Port Forwarding page and redirect port 80 to 81




To be notified by email when a new tutorial is posted :)

Thanks for Subscribing! I'll keeping you up-to-date with latest tutorials!

Something went wrong, try again...