Did You Know?
Got a tip? Let us know

We are pleased to announce our new TecMint Q/A section to submit your Linux questions

How to Setup Cherokee (Webserver) with PHP5 (FastCGI) / MySQL Support in Ubuntu 12.10

Download Your Free eBooks NOW - 10 Free Linux eBooks for Administrators
CW

Cherokee is a cross-platform feature rich and flexible, light-weight and high-performance open source Web Server/Reverse proxy server that was released under GNU (General Public License). The Cherokee project was developed using C language and was made available for all major Operating System like Linux, Mac OS X and Windows. One of the main feature of Cherokee web server is it offers graphical admin interface from where you can manage web server related tasks.

Install Cherokee Web Server in Ubuntu

Install Cherokee Web Server in Ubuntu

Cherokee Features

  1. Powerful Web interface for managing and configuring web server.
  2. Easy Web application deployment.
  3. Support for latest web technologies like PHP, FastCGI, CGI, SSI, TLS/SSL, LDAP, HTTP proxying, Content Caching, Video Streaming etc.
  4. Run on Linux, Windows, MacOS X and BSD

This article shows how to install Cherokee (Web server) on Ubuntu 12.10 Server with PHP5 (FastCGI) / MySQL Support. This article also supports older version of Ubuntu. Make sure you must be logged as root user to perform all tasks mentioned in this article.

Installing MySQL in Ubuntu 12.10

First, install MySQL support for Cherokee web server. In the middle of installation, it will be asked you to supply new MySQL root user password.

# apt-get install mysql-server mysql-client

Installing PHP5 with FastCGI in Ubuntu 12.10

Next, install PHP5 with FastCGI support for Cherokee web-server.

# apt-get install php5 php5-cgi

Configuring PHP5 for FastCGI Support

To get fastcgi support, open the file /etc/php5/cgi/php.ini.

# nano /etc/php5/cgi/php.ini

And uncomment the line cgi.fix_pathinfo=1: and save the file. See the screenshot below.

Enable FastCGI Support in Ubuntu

Enable FastCGI Support in Ubuntu

Installing Cherokee Web Server In Ubuntu 12.10

We use Cherokee own PPA (Personal Package Archive) repository, so lets add the ppa to your system and do the system update.

# add-apt-repository ppa:cherokee-webserver/ppa
# apt-get update

Once, PPA added, Open terminal with “Ctrl+Alt+T” and type command from terminal. It will ask confirmation whether you want to install Cherokee Web Server. Type ‘Yes’ to continue.

# apt-get install cheroke

One of the nice features of Cherokee Web Server of it’s Web based admin control panel from where you can manage your Web Server. Fire command ‘cherokee-admin’ it will launch one time username and password which will be use later on (Please copy password in clipboard). By default Cherokee Web Server is bind to local host (127.0.0.1) or system IP Address (xx.xx.xx.xx) at port no 9090. In my case it would be something like http://10.0.2.15:9090/.

Cherokee Admin

Start Cherokee Admin

Now, Open browser and type http://127.0.0.1:9090/ or http://10.0.2.15:9090/ in address bar. When prompted supply username ‘admin‘ paste password which was copied earlier during ‘cherokee-admin’ command. This is how web interface looks like and running of Cherokee Web Server.

Cherokee Admin Interface

Welcome Page of Cherokee Admin

How to Start, Stop and check the status of Cherokee Web Server. Also to verify cherokee-admin and Web Server are running.

# /etc/init.d/cherokee status
# /etc/init.d/cherokee stop
# /etc/init.d/cherokee start
# /etc/init.d/cherokee restart
sudo netstat -antp | grep cherokee

To stop running cherokee-admin, press CTRL+C on the terminal or use the following command.

sudo killall -TERM cherokee-admin

Configuring PHP5 with FastCGI Support for Cherokee

By default PHP5 support is not enabled in Cherokee. We need to enable it manually by going to Cherokee’s admin control panel at http://10.0.2.15:9090/.

cherokee home

Cherokee Admin Page

Navigate to vServers, select the default vhost and then go to Behavior tab and run the Rule Management.

Select Cherokee Default Vhost

Select Cherokee Default Vhost

At the left column, you will see list of available rules. See the picture below for you reference.

cherokee Rules

Cherokee Rules

Click on the “+” icon next to Behavior tab that says “Add Behaviour Rule“.

cherokee Add Behaviour Rule

Cherokee Add Behaviour Rule

Select “Languages” from the left column, then choose PHP and hit “Add” button.

Cherokee Add PHP Support

Cherokee Add PHP Support

Next, click on the Create button in the Configuration Assistant window.

Cherokee Create PHP Support

Cherokee Create PHP Support

A new rule added to left column that says “Extensions php” with status “NON FINAL“. Click on “NON FINAL” and make it as “FINAL“.

Enable PHP Extensions in  Cherokee

Enable PHP Extensions in Cherokee

Next, at top right corner, you will see “SAVE” button, click on that to save settings.

Cherokee Save Settings

Cherokee Save Settings

Now restart the Cherokee web server to take new changes.

# /etc/init.d/cherokee restart

Next, go to vServers, under Behavior tab, you will see PHP is enabled.

Verify PHP for Cherokee

Verify PHP for Cherokee

Testing PHP5 with FastCGI Support

The default web root directory for web site is /var/www. Under this directory create a file called phpinfo.php.

# nano /var/www/phpinfo.php

Add the following lines of code it and save the file.

<?php
phpinfo();
?>

Next, call the file in the browser as http://10.0.2.15/phpinfo.php

Cherokee Verify php info

Verify PHP with FastCGI Support

See the above figure, you will see PHP5 is enabled with FastCGI support with other per-loaded modules, but one thing is missing from the list (i.e. MySQL). We haven’t yet added the support for MySQL for PHP5. Let’s do it.

Enabling MySQL Support for PHP5

To enable MySQL support for PHP, install php5-mysql package with other important php modules that might required for your applications.

# apt-get install php5-mysql php5-gd php5-curl php-pear php5-imagick php5-memcache php5-xmlrpc php5-xsl

Next, restart the Cherokee web server.

# /etc/init.d/cherokee restart

Refresh the browser (http://10.0.2.15/phpinfo.php) and search for the “mysql“, you will get a MySQL section with list of other modules.

mysql support for Cheorkee

Verify MySQL Support for Cherokee

Thats It! For more information, please visit at Cherokee Web Server.

Ravi Saive

Owner at TecMint.com
Simple Word a Computer Geek and Linux Guru who loves to share tricks and tips on Internet. Most Of My Servers runs on Open Source Platform called Linux.

Linux Services & Free WordPress Setup

Our post is simply ‘DIY’ aka ‘Do It Yourself, still you may find difficulties and want us to help you out. We offer wide range of Linux and Web Hosting Solutions at fair minimum rates. Please submit your orders by Clicking Here.

One Response

  1. abilash says:

    Great and detailed Info…! Keep it Up..!
    Comes in handy for Linux admins like us..!

Leave a Reply

This work is licensed under a (cc) BY-NC | TecMint uses cookies. By using our services, you comply to use of our cookies. More info: Privacy Policy.
© 2012-2014 All Rights Reserved.