lørdag den 2. august 2008

Cherokee Web Server Install - Part one

Cherokee is a lightweight web server and because of its low ressource usage its perfect for the NSLU2 box. Further more its no big deal to get it running proberly - Big advantage indeed!

In this multi part article we will discuss a Cherokee Webserver setup which will be running the following apps in the end:
  • PHP
  • Python and Perl
  • MySQL with phpmyadmin
  • Secure SSL connection
  • Secure login using MySQL authentication
  • Kplaylist(Media), joomla(CMS) and torrential(webgui to enhanced-ctorrent)
One of my highest priorities was to make the webserver secure with access to known and registered users only. So we will be doing some of that aswell.

To get it all working we need a feew apps. First off, turn on your terminal and start typing(top first, buttom last):

# ipkg update
# ipkg install openssl
# ipkg install perl
# ipkg install python
# ipkg install php-fcgi
# ipkg install coreutils procps
# ipkg install enhanced-ctorrent
- At this point I recommend to restart (type: #DO_Reboot)
# ipkg install cherokee
# ipkg install cherokee-admin
- At this point I recommend to restart (type: # DO_Reboot)
# ipkg install mysql

# ipkg install phpmyadmin

Restart your NSLU2.

#1 Basic Webserver:
type in your browser:
http://your-nslu2-ip:8008

If you see a red cherokee welcoming screen you have succeeded the install. Congratz!

#2 phpmyadmin setup
To get phpmyadmin up and running go to: /opt/share/www/ and move the newly installed phpmyadmin folder to the cherokee folder
/opt/share/www/cherokee .

Go to:
http://your-nslu2-ip:8008/phpmyadmin

Now to get the security in place
go to privileges and set a password on every user. Now go to the config.inc.php file in the phpmyadmin folder and find this section:

$cfg['Servers'][$i]['auth_type'] = 'http'; // Authentication method (config, http or cookie based)?
$cfg['Servers'][$i]['user'] = 'root'; // MySQL user
$cfg['Servers'][$i]['password'] = 'your password'; // MySQL password (only needed

setting "http" in the authentication folder will ask for your password every time you need go to your phpmyadmin. Im not sure about how secure it is though.. Later in Part 2 we will be making some more advance security precautions.

18 kommentarer:

Anonym sagde ...

hi... i copy to phpmyadmin folder but when i go to http:/myip:8008/phpmyadmin i get the error "503 not available"

Anonym sagde ...

Have you done exactly this:

go to: /opt/share/www/ and move the newly installed phpmyadmin folder to the cherokee folder /opt/share/www/cherokee .

Anonym sagde ...

It is youre firewall. In my case it was the windows firewall blocking LAN connections.

Viktor K. sagde ...

ahh .. sweet.. thx for the tip.. I hope the guy can use it :)

have a nice day

Anonym sagde ...

Try : http://myip:8008/phpmyadmin/index.php

Anonym sagde ...

I have done the install as above =but when i try to go to the PHPmyadmnin page insted of laoding the page it trys to send as downloads all of the PHP pages.

Cliff C

Unknown sagde ...

I followed all of the steps, but when I access phpmyadmin, I get the page, but it is completely scramble (maybe encoded??) with diamonds and symbols etc, the frames do show up however. phpinfo.php runs fine, and shows no problems... any ideas?

Anonym sagde ...

I followed all of the steps, but when I access phpmyadmin, I get the page, but it is completely scramble (maybe encoded??) with diamonds and symbols etc, the frames do show up however. phpinfo.php runs fine, and shows no problems... any ideas?

Anonym sagde ...

i got the same wierd symbols as above.
i found out the problem is that the server compresses youre script and phpmyadmin does that to

to fix it change this line:

/**
* Other core phpMyAdmin settings
*/
$cfg['OBGzip'] = 'auto'; to
$cfg['OBGzip'] = FALSE;

its in the phpmyadmin directorie file config.inc.php

Happy_Jack sagde ...

Very useful article but it might be helpful to say exactly why you installed each of those packages. Other people won't necessarily want the same functionality as you do.

viktor k sagde ...

hi jack,

thx for your comment :)

well.. as I write in the intro:

"In this multi part article we will discuss a Cherokee Webserver setup which will be running the following apps in the end:

* PHP
* Python and Perl
* MySQL with phpmyadmin
* Secure SSL connection
* Secure login using MySQL authentication
* Kplaylist(Media), joomla(CMS) and torrential(webgui to enhanced-ctorrent)"

if you for instance dont want a secure ssl connection, dont install openssl.. :) etc etc.

Nisse sagde ...

Hello!

I follow the list.

After move the phpmyadmin to /opt/share/www/cherokee and then in the webbrowser:
http://MyIP:8008/phpmyadmin/

I get a:
Index of /phpmyadmin/

When I try:
http://MyIP:8008/phpmyadmin/index.php
My FireFox ask me what to do with the file. Open it or Save?

Cherokee admin
Via the telnet i set:
/opt/sbin/cherokee-admin -b
When I in the browser try:
http://MyIP:9090/
Login as: admin
And type the password
The respond is:
500 Internal Server Error
__________________________
Cherokee web server 0.99.24 (UNIX), Port 9090

So, please, what do I need to do?

Unknown sagde ...

Hi,

I have exactly the same issue as Nisse

http://MyIP:8008/phpmyadmin/

I get an Index of /phpmyadmin/ when opening http://MyIP:8008/phpmyadmin/
The only option given is to download the selected php file???

Also get the following error when opening http://MyIP:8008/phpmyadmin/index.php with the generated password:
500 Internal Server Error

Little help will be much appreciated.

Thanks

Pochrist sagde ...

Me too I got the same problem as Nisse and manutitou, is there some reason why. Any help would be appresciated

Viktor K sagde ...

hmm, thats odd! Maybe they have made some sort of changes too the packages which causes the error..

unfortunatly my NSLU2 is kinda packed away, so I can't even power it up to see if I could fix the problem.

If one of you find a solution. Be kind to post it here or send it to my e-mail:

vikezz(a)gmail.com

Ty

Anonym sagde ...

looks like cherokee is not configured right to use php. Same problem here

Unknown sagde ...

Hi,

I have followed you instructions above but when I try to log into the Cherokee-Admin interface i get a 503 Service Unavailable msg. I ran it again with the -x option and it complained about the following;

ImportError: No module named Radio

this is when it is trying to import CTK.

ANy ideas?

Thanks,

Anonym sagde ...

Hi all, i'm new to this too.
The problem is with python --

1. Install python26 in ipkg
2. change the python version at line one in the /cherokee/admin/server.py file to "python2.6"

Problem Solved.