torsdag den 14. august 2008

Cherokee Web Server Install - Part two

A good friend once told me, that the lenght between up and down is equal but not as fast nor secure! That's the same thing with MySQL authentication and plain text file authentication.

Therefore, this article begins easy and guide you through a fast and very simple plain text password protection setup/jump. That way you will also learn how to easily control the admin interface. In Part three we will focus on the MySQL Auth which is a bit more triggy(not much though but still up hill)

------------------------------------
Password creation
------------------------------------
First create the password plain text file by simply type in your terminal

#ipkg install joe (install a good and easy text program)
#joe /opt/share/www/cherokee/text.txt

Type:

Almighty:CherokeeGod

and press CTRL+KX for exiting and saving.

username is now : Almighty
Password is now:
CherokeeGod

Very simpel -> but be sure to make a more secure password!

Also make a new folder called pass inside your webroot. eg: /opt/share/www/cherokee/pass/

------------------------------------
Make the webserver remember to ask who's knocking!
------------------------------------
In the terminal, type:
#cherokee-admin -b (this will open the cherokee admin webgui)

Go to your browser and type: http://slugip:9090/ to see your admin welcome screen.

Now to set the settings for the password press on virtual servers

Press Default
Press Default again, "List & Send"Press the security tab -> and match the screenshots text fields.



Press, send request followed by a gentle press on the apply button.

Go to your terminal and write: DO_Reboot. (As you prolly guessed, this will magically reboot the slug).

------------------------------------
Testing
------------------------------------
Once its back in action, try your browsers power and type: http://slugip:8008/
(Note: in Firefox it will look normal. But if you type in http://slugip:8008/ pass/ it will ask for a password!)

in IE it will ask for a pass after just pressing http://slugip:8008/

So that's it, you have now created a very simple password authentication system. Though its normally not recommended that you put the pass file inside your webroot, this time was just to check the basic stuff in the admin gui. So please don't use this as your final attempt in accomplishing a secure webserver.

Next we will do some more advanced MySQL Auth kongfu stuff, so be prepared!

For now, have fun password protecting your files and thank you for reading.

Cheers!

9 kommentarer:

Per sagde ...

Hi!

Thanks for blogging this!

Just bought an NSLU2 and unslinged with the intention of setting up a low-energe, always-up-and-running web and svn server for home use. Your "pointing in the right direction" blog has saved me a lot of time and trouble.
Looking forward to read about your further progress...

Viktor K. sagde ...

great, always nice to hear :)

Glad my work helped out!

I'm experimenting with Debian on NSLU2, so stay tuned with more guides! :)

Anonym sagde ...

Hi!

I followed your instructions and now at the step where I want to use joe or cherokee-admin I get the shell message "No such file or directory".

Any advice on how to fix this?

Thanks,
Detlef

vikezz sagde ...

have u installed joe and cherokee-admin?

Raul sagde ...

Hi

Great guide! but i have some problems and i am tired of looking for solutions in all internet.
I can see http://my-ip:8008/index.htm, and i can see http://my-ip:8008/phpmyadmin (tree directories) but when I try to see http://my-ip:9090 to adminI get error 500.
I made every single step, I have installed cherokee-admin, php-fcgi...
I don't know what more to do...
Any ideas?

Thx

vikezz sagde ...

Hi mate,

thanks for ur comment!

oh well.. my nslu2 is unfortunatly gathering dust atm... but maybe u can search for help at http://www.nslu2-linux.org/

good luck

//Viktor

Raul sagde ...

Hi

I have already seen that site, but I haven't found a fix.
Anyway, thanks for your comment.

Unknown sagde ...

Hello,

Thank you for the how-to :)

I have an issue with cherokee-admin
HW wl500g FW oleg 1.9.2.7-7g

[root@hostname www]$ cherokee-admin -b -p 81 -x -u

Web Interface:
URL: http://localhost:81/

Cherokee Web Server 1.0.8 (Aug 14 2010): Listening on port ALL:81, TLS disabled,
IPv6 enabled, using poll, 4096 fds system limit, max. 2041 connections,
caching I/O, single thread
DEBUG: SIGUSR1 invokes the console..
SIGUSR2 prints a backtrace..
Server 1.0.8 running.. PID=1393 Socket=/tmp/cherokee-admin-scgi.socket
DEBUG: SIGUSR1 invokes the console..
SIGUSR2 prints a backtrace..
Server 1.0.8 running.. PID=1394 Socket=/tmp/cherokee-admin-scgi.socket
DEBUG: SIGUSR1 invokes the console..
SIGUSR2 prints a backtrace..
Server 1.0.8 running.. PID=1395 Socket=/tmp/cherokee-admin-scgi.socket
DEBUG: SIGUSR1 invokes the console..
SIGUSR2 prints a backtrace..

and a few seconds after testing

[root@kokoro1 www]$ ----------------------------------------
Exception happened during processing of request from
Traceback (most recent call last):
File "/opt/lib/python2.5/SocketServer.py", line 222, in handle_request
self.process_request(request, client_address)
File "/opt/share/cherokee/admin/CTK/CTK/pyscgi.py", line 178, in process_request
return SocketServer.ThreadingMixIn.process_request (self, request, client_address)
File "/opt/lib/python2.5/SocketServer.py", line 477, in process_request
t.start()
File "/opt/lib/python2.5/threading.py", line 442, in start
_sleep(0.000001) # 1 usec, to let the thread run (Solaris hack)
KeyboardInterrupt
----------------------------------------


For the testing i got the first time Error 503, after 2-3 minutes, the if i try again (still the same cherokee admin process), i got Error 504 Gateway Timeout a few seconds after, again and again if i try again.

Hello,

I have an issue with cherokee-admin

[root@hostname www]$ cherokee-admin -b -p 81 -x -u

Web Interface:
URL: http://localhost:81/

Cherokee Web Server 1.0.8 (Aug 14 2010): Listening on port ALL:81, TLS disabled,
IPv6 enabled, using poll, 4096 fds system limit, max. 2041 connections,
caching I/O, single thread
DEBUG: SIGUSR1 invokes the console..
SIGUSR2 prints a backtrace..
Server 1.0.8 running.. PID=1393 Socket=/tmp/cherokee-admin-scgi.socket
DEBUG: SIGUSR1 invokes the console..
SIGUSR2 prints a backtrace..
Server 1.0.8 running.. PID=1394 Socket=/tmp/cherokee-admin-scgi.socket
DEBUG: SIGUSR1 invokes the console..
SIGUSR2 prints a backtrace..
Server 1.0.8 running.. PID=1395 Socket=/tmp/cherokee-admin-scgi.socket
DEBUG: SIGUSR1 invokes the console..
SIGUSR2 prints a backtrace..

and a few seconds after testing

[root@kokoro1 www]$ ----------------------------------------
Exception happened during processing of request from
Traceback (most recent call last):
File "/opt/lib/python2.5/SocketServer.py", line 222, in handle_request
self.process_request(request, client_address)
File "/opt/share/cherokee/admin/CTK/CTK/pyscgi.py", line 178, in process_request
return SocketServer.ThreadingMixIn.process_request (self, request, client_address)
File "/opt/lib/python2.5/SocketServer.py", line 477, in process_request
t.start()
File "/opt/lib/python2.5/threading.py", line 442, in start
_sleep(0.000001) # 1 usec, to let the thread run (Solaris hack)
KeyboardInterrupt
----------------------------------------


For the testing i got the first time Error 503, after 2-3 minutes, the if i try again (still the same cherokee admin process), i got Error 504 Gateway Timeout a few seconds after, again and again if i try again.

Error 503
[h1]503 Service Unavailable[/h1]
[p][hr]
Cherokee web server 1.0.8 (UNIX), Port 81

Error 504
[h1]504 Gateway Timeout[/h1]

Any idea ? :)

jonathanku sagde ...

Guys, don't know how many might still be using Cherokee on an NSLU2... but I could use some help.

I've installed as per this tutorial, but I can't seem to get PHP working. Anyone know how to debug that?

(also cherokee-admin causes some problems, but I don't know if the two issues are related)

Thanks in advance.