cherokeecentos

Cherokee is a very fast, flexible and easy to configure Web Server. It supports the widespread technologies nowadays: FastCGI, SCGI, PHP, CGI, TLS and SSL encrypted connections, virtual hosts, authentication, on the fly encoding, load balancing, Apache compatible log files, and much more. This tutorial shows how you can install Cherokee on a CentOS server with PHP 5.2.10 support (through FastCGI) and MySQL support.

Preliminary Note

In this tutorial I use a base 64 bit server install with the hostname server1.example.co.za with the IP address 10.0.0.10. These settings might differ for you, so you have to replace them where appropriate.

Adjust any package names if installing the EL4 or 32 bit packages. If any dependencies are unsatisfied, install the required packages and retry.

Installing MySQL 5

First we install MySQL 5 like this:

# yum groupinstall “MySQL Database”

You will be asked to provide a password for the MySQL root user – this password is valid for the user root@localhost as well as root@server1.example.co.za, so we don’t have to specify a MySQL root password manually later on:

New password for the MySQL “root” user: <-- yourpassword
Repeat password for the MySQL "root" user: <-- yourrpassword

chkconfig mysqld on

Installing Cherokee

Cherokee is available as a Fedora EPEL 5 package, therefore we can install it like this:

First we install the Fedora EPEL 5 repository:

# rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-3.noarch.rpm

Then we’ll install the Cherokee binaries and add it to startup:

# yum install cherokee
# chkconfig cherokee on
# service cherokee start

Now direct your browser to http://10.0.0.10, and you should see the Cherokee placeholder page:

Cherokee can be configured through a web-based control panel which we can start as follows:

cherokee-admin -b

(By default cherokee-admin binds only to 127.0.0.1 (localhost), with the -b parameter you can specify the network address to listen to. If no IP is provided, it will bind to all interfaces.)

Output should be similar to this one:

# cherokee-admin -b

Login:
User: admin
One-time Password: (your one-time password)

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, caching I/O, single thread

The admin web interface can be found on http://10.0.0.10:9090/ (make sure to enter your one-time password)

To stop cherokee-admin, type CTRL+C on the shell.

Installing PHP 5.2.10 with FastCGI and MySQL Support

We can make PHP 5.2.10 work in Cherokee through FastCGI:

# wget http://oss.oracle.com/projects/php/dist/files/EL5/x86_64/php52-5.2.10-2.el5.x86_64.rpm
# wget http://oss.oracle.com/projects/php/dist/files/EL5/x86_64/php52-common-5.2.10-2.el5.x86_64.rpm
# wget http://oss.oracle.com/projects/php/dist/files/EL5/x86_64/php52-mysql-5.2.10-2.el5.x86_64.rpm
# wget http://oss.oracle.com/projects/php/dist/files/EL5/x86_64/php52-cli-5.2.10-2.el5.x86_64.rpm
# wget http://oss.oracle.com/projects/php/dist/files/EL5/x86_64/php52-pdo-5.2.10-2.el5.x86_64.rpm
# wget http://oss.oracle.com/projects/php/dist/files/EL5/x86_64/php52-snmp-5.2.10-2.el5.x86_64.rpm

yum install php52-5.2.10-2.el5.x86_64.rpm php52-cli-5.2.10-2.el5.x86_64.rpm php52-common-5.2.10-2.el5.x86_64.rpm php52-mysql-5.2.10-2.el5.x86_64.rpm php52-pdo-5.2.10-2.el5.x86_64.rpm php52-snmp-5.2.10-2.el5.x86_64.rpm

Adjust the package names if installing the EL4 or 32 bit packages. If any dependencies are unsatisfied, install the required packages and retry the above command.

Configuring PHP 5.2.10

There is not much to learn to configure PHP with Cherokee. Cherokee-admin ships a one-click wizard that will do everything for you. It will look for the PHP interpreter, it will check whether it supports FastCGI, and then it’ll perform all the necessary operations to set it up on Cherokee.

It requires a single operation to get PHP configured on a Virtual Server: Choose the virtual server your want to configure, and click on the Behavior tab. Once in there, click on Wizards.

Now select Languages and run the PHP wizard. And, that’s it. If you had php-cgi installed in your system, PHP should be configured now and listed on the Behavior tab. Make sure you mark its checkbox in the Final column

Save your changes and reboot!

Testing PHP 5.2.10 and getting details about your installation

The document root of the default web site is /var/www/cherokee. We will now create a PHP info file (info.php) in that directory and call it in a browser. The file will display lots of useful details about our PHP installation, such as the installed PHP version.

# vi /var/www/cherokee/info.php

	

Save the file and call that it in a browser (e.g. http://10.0.0.10/info.php):

As you see, PHP 5.2.10 is working, and it’s working through FastCGI, as shown in the Server API line. If you scroll further down, you will see all modules that are already enabled in PHP 5.2.10 including MySQL.

Links

Cherokee: http://www.cherokee-project.com/
PHP: http://www.php.net/
MySQL: http://www.mysql.com/
CentOS: http://centos.org/

Related posts:

  1. Installing and upgrading to #PHP 5.2.9 on #CentOS and #RedHat Linux 5.3 x86_64
  2. Installing #Jasper reporting for #MySQL on #CentOS 5.4
  3. Enabling #multimedia support on #CentOS 5.5
  4. Installing #Puppet Master with #Foreman frontend on #CentOS 5.5
  5. Installing #FFmpeg with #AMR on #CentOS 5.x 64 bit

Tagged with:  

View Comments to “Installing #Cherokee with #PHP 5.2.10 and MySQL Support On #CentOS 5.3”

  1. Greg says:

    do you have guide how to upgrade Cherokee to new version? thanks

  2. How2CentOS says:

    If you've followed this guide, when you do “yum install cherokee” it will install the latest packaged version.

    However if the latest version isn't packaged yet I suggest waiting.

  3. tam says:

    Following this guide, when I try to install Php with yum, i get this error message

    warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 1e5e0159
    Public key for php52-5.2.10-2.el5.x86_64.rpm is not installed

    Is there something wrong with the repository or should I install an additional PGP key.

    Thank you for your help

  4. How2CentOS says:

    It's not ideal but disable gpgcheck in yum.conf

    # vi /etc/yum.conf

    change: gpgcheck=1
    to: gpgcheck=0

    Make sure to change it back once you've finished the install.

  5. Djgibo says:

    yum install php52-5.2.13-1.el5.x86_64.rpm php52-cli-5.2.13-1.el5.x86_64.rpm php52-common-5.2.13-1.el5.x86_64.rpm php52-mysql-5.2.13-1.el5.x86_64.rpm php52-pdo-5.2.13-1.el5.x86_64.rpm php52-snmp-5.2.13-1.el5.x86_64.rpm

Leave a Reply

blog comments powered by Disqus
Get Adobe Flash playerPlugin by wpburn.com wordpress themes
Afrigator
Blog WebMastered by All in One Webmaster.