What's new

[TUTORIAL]CHEROKEE web server through optware

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

TeHashX

Very Senior Member
New site with updated guide

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

• To start the optware environment:
• Login to router with putty terminal
• go to http://192.168.1.1/APP_Installation.asp 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 192.168.1.1:8008 and should see this webpage:
1427whv.png

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 www.htmltemplates.net
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 192.168.1.1:9090 and type username admin and paste the password from terminal
5lcmd2.png

• Go to Sources
• Click on + sign to add new Information Source
• Nick - PHP-Interpreter
• Connection - 127.0.0.1:47990
Add
• Change type from Remote host to Local interpreter
• Interpreter /opt/bin/php-fcgi -b 127.0.0.1:47990
• Press ENTER
SAVE on upper right
Graceful restart
• Click on Home and start server if is stopped
• Go to vServers
Behavior
Rule Management
• Click on + sign to add a Behavior Rule
Languages
PHP
Add
Create
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/test.php and paste this code:
<?php
phpinfo();
?>
• Save with CTRL-O / Enter / and exit with CTRL-X
• Go to 192.168.1.1:8008/test.php and if you see an info page, the webserver is configured correctly.

___________________________________________________________________________________________________________________________________________
app_set_enabled.sh cherokee yes (this is for starting webserver automatically on every router reboot)
If you want acces from wan to website and cherokee-admin:
nano /jffs/scripts/firewall-start and add this lines:
#!/bin/sh
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 it executable)
• Go to port forwarding and open this two ports:
Cherokee 80 192.168.1.1 8008 BOTH
Cherokee-Admin 9090 192.168.1.1 9090 BOTH
Press Apply
sen4ow.png

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
 
Last edited:
Hi, i install cherokee web server, working on lan but not from wan... I'm not installed PHP. Port forwarding i see in th routing table... any idea? THX
 
Hi, i install cherokee web server, working on lan but not from wan... I'm not installed PHP. Port forwarding i see in th routing table... any idea? THX

For this you have to load Merlin's firmware from here to enable /jffs partition, and follow this simple steps:

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

nano /jffs/scripts/firewall-start
• add this two 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
• Go to port forwarding and open this two ports:
Cherokee 80 192.168.1.1 8008 BOTH
Cherokee-Admin 9090 192.168.1.1 9090 BOTH
sen4ow.png

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
 
Last edited:
Yes, now its working, but when i restart router, cherokee doesnt accept iptables... its in startup, but not working.. any idea? THX
 
Yes, now its working, but when i restart router, cherokee doesnt accept iptables... its in startup, but not working.. any idea? THX

This is because you didn't set firewall-start script as executable
chmod a+rx /jffs/scripts/firewall-start
 
I'm running RT-N66U with Merlin's 3.0.0.4.260.21.
I can't get the autostart to work. I need to run putty and "cherokee-admin -b" each time the router needs rebooting. Then the "once-password", login, and "start server".
Any limitation in this firmware or am I not doing something obvious? Like checking any box in the router settings (used to run default firmware until yesterday but needed th SSH for putty and JFFS for firewall-start)?
I don't want the remote access over WAN feature so I have excluded that line from firewall-start as well as the port-forwarding.

I also don't get how to set up cherokee to not requiring a "once-password" either, but that might solve itself once I get the autostart running?

Any advice on my problems?

Thanks for a great tutorial!
 
app_set_enabled.sh cherokee yes
this will start cherokee automatically on every reboot
 
Don't work...
Might be some basic setup of Cherokee I'm missing? Like how to setup a basic admin account so I don't need to run the one-time password each time?
 
If you type app_set_enabled.sh cherokee yes than Cherokee server starts automaticaly on every router reboot, you have to refresh the web page after every modification and don't need to start cherokee admin.
If still not working, start installation from scratch.

Sent from my HTC One S using Tapatalk 2
 
If still not starting after router reboot, follow this steps:

nano /jffs/scripts/post-mount and add this lines
#!/bin/sh
/opt/etc/init.d/S80cherokee start

• save with CTRL-O / Enter / and exit with CTRL-X
chmod a+rx /jffs/scripts/post-mount (make the script executable)
reboot


Available only on Merlin's firmwares
 
Last edited:
Yay, its working. Thanks alot.
I'm suprised how stable this server is. I tried this with my Popcorn Hour C200 but performance were awful.
Any suggestion on how to be able to run the config without putty and one-time password?
 
Hi all! This is my 1th post here

First of all, congratulations for the excellent how-to!

I'd like to ask do you think it is possible to use the same method (i.e., this how-to) for installing Cherokee on my RT-N16? I am still running Asus original firmware (v. 3.0.0.4.260)...

I have not tried yet Merlin's fw (since it's said about the later that it's only 'experimental' for my router [RT-N16]), so I don't know how to get support for the /jffs partition (I want to ble able to access the web server form the wan side). So do you think it's worth to give it a try or would be preferable to move straight to Tomato's or DD-wrt's versions?
Thanks in advance
JM
 
It should work on RT-N16 too, I recommend to use Merlin's firmware first. Than come back with feedback here.

Sent from my HTC One S using Tapatalk 2
 
It should work on RT-N16 too, I recommend to use Merlin's firmware first. Than come back with feedback here.

Sent from my HTC One S using Tapatalk 2

Thanks for the fast reply, TeHashX!
I'll follow your suggestion and will report later the results...

If I got you right, it's possible to install more optware packages after installing Merlin's fw, right? I'm asking you this because, not having much experience with linux, I see in this a simple way to install some basic optware packages like Thttpd - a very lightweight web server in order to be able to stream large video files over the internet from a simple web site (I use it with my unslung NSLU2-NAS, but I'll try Cherokee as well if I manage to install it successfully).
Once again - thanks for your fast response!
Jm
 
Stock Firmware does not support JFFS, and that is needed for Cherokee. Merlins firmware is awsome, highly recommended even if you're not to install additional Linux packages.
 
Stock Firmware does not support JFFS, and that is needed for Cherokee. Merlins firmware is awsome, highly recommended even if you're not to install additional Linux packages.

Hi Natow! Thank you for your feedback. I'll try Merlin's fw as soon as possible. And yes - I am looking for a simple way to install different available apps from the vast optware repo (this is my main motivation to move from stock fw into Merlin's or other wrt flavour fw)
JM
 
Hi all!
Although it's been quite a while since I posted my initial question here, maybe my feedback will be useful for some other RT-N16 user...

So I confirm that:

a) Merlin's firmware (Version:3.0.0.4.266.23 (Merlin build)) works like a charm on the RT-N16 router!

And the upgrade process went as easy and smooth as just simply uploading the bin file to the router using the original Asus config. web page for upgrades, reboot the router and voilà. I also noticed a slightly improvement in terms of lan (wireless) speed...

b) I managed to install the Cherokee webserver from the optware repo as well following this how-to: it worked immediately, including the php module...

I just wish I could understand better how it works one of the commands - the one that allow the «webserver to start automatically on every router reboot»: • app_set_enabled.sh cherokee yes(no)

Is this a specific to Merlin's fw command? If so, the changes are recorded in an editable file? Is it possible to use this command for starting/stopping other applications installed via optware?

c) Also, following the method used in this how-to, I was able to install and setup Thttpd - a very lightwheight webserver. Unlike Lighttpd and Cherokee webservers (which offer more features but put somehow a certain strain on the Arm processor), Thttpd allows for the streamming of large video files (1,5 Gb and more) over the internet from a basic website (this is based on my experience using Thttpd and Lighttpd on another Arm processor equipped gadget - NSLU2). Since I only need the basic webserver functions plus basic authentication -- I guess Thttpd is not only ideal, it's simply the only viable webserver for streaming video using Arm class processors...


Last, not least, I want to thank Merlin and TeHashX for their wonderfull (and usefull!) contributions!

jmir
 
Last edited:

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top