How to install Cherokee on Fedora 11

Cherokee HTTP server is a cross platform web server. It is very fast and flexible while being light weighted. It is written entirely in C and supports most of the widespread techologies now a days like FastCGI, HTTP load balancing. I will tell you how to install cherokee on fedora 11 with PHP5 and MySQL support.

 

 

  1. Install mysql client and server

Run the following command.

[jasonleon]$ yum install mysql mysql-server

Start the mysql server

[jasonleon]$ /etc/init.d/mysqld start  

  1. Install cherokee

Run the following command

[jasonleon]$ yum install cherokee

Stop any other webserver on your machine before starting cherokee. If its apache then it can be stopped by running this command

[jasonleon]$ /etc/init.d/httpd stop

Now, start the cherokee server

[jasonleon]$ /etc/init.d/cherokee start

Enter you IP in your URL ( mine is 10.0.0.15). And you will see the fedora cherokee placeholder page.

  1. Install PHP5

PHP5 can be configured to work in cherokee through FastCGI. So, we install the package php-cli.

[jasonleon]$ yum install php-cli

  1. Configuring PHP5

Open the file /etc/php.ini and add the line cgi.fix_pathinfo = 1 at the end of it. Or you may run the following command as root.

[jasonleon]$ echo “cgi.fix_pathinfo = 1” | tee -a /etc/php.ini

Now, restart the server

[jasonleon]$ /etc/init.d/cherokee restart

  1. Configuring Cherokee from admin panel and add PHP support

Cherokee is configured by an admin interface called cherokee-admin. This interface contains all the configurable options for cherokee and makes configuring it a lot easier than configuring individual files in other webservers. To start the interface run this command.

[jasonleon]$ cherokee-admin - -bind IP

This will bind Cherokee to listen to the network address IP. Otherwise, if –bind option is not provided then it will bind only to 127.0.0.1, i.e. it could then be accessed only through local system. If no IP is provided then it will bind to all interfaces.

After running this command you will see something like this. (run as root)

 

[jasonleon]$ cherokee-admin --bind Login:
User: admin
One-time Password: 0WtG6D8F6lrrtjik

Web Interface:
URL: http://localhost:9090/

Cherokee Web Server 0.99.17 (Jun 14 2009): Listening on port ALL:9090, TLS disabled, IPv6 disabled, using epoll, 1024 fds system limit, max. 505 connections, catching I/O, single thread

So, if you open the address 10.0.0.15:9090 (or YOURIP:9090) then you will be able to access the admin page. You will be prompted for login, enter the username and password given above in the output of cherokee-admin command. You will see a page like this.

Now, go to Virtual Servers and click the default virtual host. Then got to Behaviour tab. You should be seeing a page similar to this.
 

Click on the wizards option and select the php option at the bottom(wizards > misc) to get it listed in the behaviour tab. And after clicking you will see the php option in the table above. Mark the Final column in the table.

Click on the PHP option in the table (target column) to change its default settings. The default settings work fine for most of the cases so you might not have to change the default settings. But still if you want to explore then you can see that the FastCGI settings are mentioned in the handler tab.

Before leaving make sure to save the changes you have done. This option is available in the left panel. Select it to do a graceful restart.

Press Ctrl-C to stop the admin interface.

  1. Test if PHP5 is working

The root directory for cherokee in fedora is /var/www/cherokee. Make a file test.php in this folder and add the following lines in it.

[jasonleon]$ vim /var/www/cherokee/test.php

<?php
phpinfo();
?>

Now, open this file in your browser http://yourIP/test.php. You should see a page similar to this.

If you see a similar page as above then php is working fine.

  1. Enable MySQL support in PHP

Download the php-mysql package to enable mysql support in PHP.

[jasonleon]$ yum install php-mysql

restart the cherokee server.

[jasonleon]$ /etc/init.d/cherokee restart

Open the same test.php page again and you will see MySQL in the modules section. In a similar way you can download more modules.

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <img> <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <h1> <h2> <h3> <h4> <h5> <h6> <p> <br>
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Use syntax $$latex$$ to insert LaTeX formulas.
  • Image links with 'rel="lightbox"' in the <a> tag will appear in a Lightbox when clicked on.
  • Search Engines will index and follow ONLY links to allowed domains.

More information about formatting options

Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.