CHEROKEE web server through optware

We need a usb-flash formatted EXT2 or a usb-hdd formated EXT3, will not work on FAT32 or NTFS.

• To start the optware environment:
• Login to router with putty terminal
• go to and install Download Master (uninstall or disable after, if you are not using it)

ipkg update
ipkg upgrade
ipkg install php-fcgi
ipkg install cherokee
ipkg install cherokee-admin

• In your favorite internet browser type and should see this webpage:

If you have already a website created, just copy it to /opt/share/www/cherokee but first set write permission to folder:

chmod 777 /opt/share/www/cherokee

If you don't have a website, a good start is to download a template from web, like one from this site
Edit with your favorite HTML editor and publish.

To enable PHP support:

cherokee-admin -b

This will give you a one-time password
• Go to and type username admin and paste the password from terminal
• Go to Sources
• Click on + sign to add new Information Source
• Nick - PHP-Interpreter
• Connection -
• Change type from Remote host to Local interpreter
• Interpreter /opt/bin/php-fcgi -b
• Press ENTER
SAVE on upper right
Graceful restart
• Click on Home and start server if is stopped
• Go to vServers
Rule Management
• Click on + sign to add a Behavior Rule
SAVE on upper right
Graceful restart
• Click on Home and start server if is stopped
To verify if php is enabled we will create a test page:
• open another putty sesion because the first one is busy with cherokee-admin

ipkg install nano
nano /opt/share/www/cherokee/info.php

Paste this code:


• Save with CTRL-O / Enter / and exit with CTRL-X
• Go to and if you see an info page, the webserver is configured correctly.
For starting webserver automatically on every router reboot: cherokee yes

If you want acces from wan to website and cherokee-admin:

nano /jffs/scripts/firewall-start

Add this lines:

iptables -I INPUT -p tcp --destination-port 8008 -j ACCEPT
iptables -I INPUT -p tcp --destination-port 9090 -j ACCEPT

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

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

Make script executable

• Go to port forwarding and open this two ports like in the screenshot, then press Apply
Now just type your_wan_ip adress in browser and should see your webpage
If you have dynamic ip, better set a dynamic dns

Youtube video HERE




Thanks @Leon