How to Install Cherokee with PHP5 And MySQL Support on Ubuntu 12.04

Cherokee is one of the quickest, flexible and user-friendly tools to configure Web Server. It supports the vast variety of technologies used in today’s systems. Some of them are PHP, SSL encrypted connections, TLS, Fast CGI, SCGI, virtual hosts, Apache compatible log files, and load balancing. This step by step guide will explain you about the installation process of Cherokee on an Ubuntu 12.04 server by using PHP5 (through FastCGI) and MySQL.

In this guide, we have used the hostname server1.example.com with the IP address 192.168.0.100. These settings may vary from system to system so you have to adjust them accordingly.

Instructions

  • 1

    Installing MySQL 5

    First of all install MySQL 5 through the given procedure;

    apt-get install mysql-server mysql-client

    You have to type a password for the MySQL root user. You can either use root@localhost or root@server1.example.com and this is applicable for both the users.

    New password for the MySQL "root" user: <-- yourrootsqlpassword
    Repeat password for the MySQL "root" user: <-- yourrootsqlpassword

  • 2

    Installing Cherokee

    Cherokee can be found as an Ubuntu package, so you can install it in this way;

    apt-get install Cherokee

    Now type  http://192.168.0.100 on your browser, and you could view the Cherokee placeholder page;

  • 3

    In order to configure Cherokee, you can use a web-based control panel which can be done as;

    cherokee-admin –b



    Output should be look like this;

    root@server1:~# cherokee-admin -b
    [29/05/2012 13:46:44.778] (warning) rrd_tools.c:121 - Could not find the
    rrdtool binary. | A custom rrdtool binary has not been defined, and the
    server could not find one in the $PATH.

    Cherokee Web Server 1.2.101 (Jan 30 2012): Listening on port ALL:9090, TLS
    disabled, IPv6 enabled, using epoll, 4096 fds system limit, max. 2041
    connections, caching I/O, single thread

    Login:
    User:              admin
    One-time Password: YXiRcc6wcAnwcUo5







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

    In order to log into the web interface, you will be asked to provide the username and password which can be found on http://192.168.0.100:9090/:

  • 4

    This is how the web interface looks:

  • 5

    Installing PHP5

    You can use PHP5 in Cherokee with the help of FastCGI. Since, Ubuntu offers a FastCGI-enabled PHP5, so you can install it in this way;

    apt-get install php5-cgi

  • 6

    Configuring PHP5

    You have to modify /etc/php5/cgi/php.ini and uncomment the line cgi.fix_pathinfo=1:

    vi /etc/php5/cgi/php.ini

    [...]

    ; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI.  PHP's

    ; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok

    ; what PATH_INFO is.  For more information on PATH_INFO, see the cgi specs.  Setting

    ; this to 1 will cause PHP CGI to fix its paths to conform to the spec.  A setting

    ; of zero causes PHP to behave as before.  Default is 1.  You should fix your scripts

    ; to use SCRIPT_FILENAME rather than PATH_TRANSLATED.

    ; http://php.net/cgi.fix-pathinfo

    cgi.fix_pathinfo=1

    [...]

    After that restart Cherokee:

    /etc/init.d/cherokee restart

Leave a Reply

Your email address will not be published. Required fields are marked *


4 − three =