Setting up the Cherokee web service under Ubuntu 11.04 to work with WordPress

    Recently, I wanted to try some alternative for a home web service.
    It’s not that I wasn’t happy with the “standard” Apache - I just wanted to broaden my horizons and perhaps find a better alternative.
    The candidate had to meet simple requirements - low resource consumption and high speed.
    Since I already touched Nginx , lighthttpd and LiteSpeed, I knew approximately what to expect from them - the choice fell on the Spanish development of Cherokee .

    Initially, the article was planned as a comparison of two "Indians" - but in the process of installing and setting up the Cherokee, I came across a couple of pitfalls. So this article is an introduction, so to speak.
    A performance comparison will also be - but a little later.

    So, Cherokee.
    As it is written on the official website, it is an innovative, easily configurable web server with a lot of features. Let's get started with the installation and take a closer look.
    And immediately waiting for us

    Underwater stone number 1.



    It consists in choosing a source for installation. There are 3 options, as usual:
    • Use standard system repositories
    • use ppa;
    • compile from source codes;

    I immediately removed the third option - tea, not Gentoo , and decided to install it from the standard repository:

    sudo apt-get install cherokee php5-fpm

    As it turned out later, the standard Ubuntu repository contains a rather old version that doesn’t really work with PHP-fpm ( old 2010 bug - the Cherokee configurator cannot find PHP-fpm config on the system).
    Therefore, you need to install from the PPA: After installation, we start the Cherokee admin panel (a separate Python-based web service, you need to start it only during the configuration of Cherokee - it is not needed constantly) and go to the URL that the command will give (by default - http://127.0.0.1:9090 ):

    sudo add-apt-repository ppa:cherokee-webserver/ppa
    sudo apt-get update
    sudo apt-get install cherokee cherokee-admin




    sudo cherokee-admin

    I have my WordPress blog on my home server spinning - so we need to configure Cherokee to work with PHP-fpm, and to serve WordPress.
    There are a lot of manuals on the network about how to do this, but I did not find a detailed step-by-step instruction and spent a couple of hours putting everything in working order.

    Pitfall number 2.



    Behavior for processing php files should always be on top (real man, cho).
    This is what the Behavior settings for WordPress should look like:



    Please note that the directory processing rules contain relative paths.
    That is, in terms of Apache, if you have DocumentRoot for VirtualHost, WordPress shows in / var / www / html / blog / - you don’t need to specify the full path, it will not work. Indicate as in the screenshot: / wp-content, / wp-includes, / wp-admin.

    Summarize.


    To configure Cherokee for WordPress service, you need to install Cherokee itself, PHP-fpm, and configure the web service via cherokee-admin:

    - add a new Source for PHP-fpm (if Cherokee did not pick it up yourself), go to the Sources at the top of the menu , on the left click on the “+” sign and fill in the fields:
    • Nick: PHP Interpreter
    • Connection: 127.0.0.1:9000
    • Type: Local Interpreter
    • Interpreter: / usr / sbin / php5-fpm --fpm-config /etc/php5/fpm/main.conf

    We rule the ways according to your surroundings.

    - add Virtual Server, for this, go to the top of the vServers menu, click on the “+” sign on the left and fill in the fields:
    • Nick: yoursite.com (similar to ServerName in Apache)
    • Document root: / absolute / path / to / files

    Click Add, go to the Basics tab, write index.php in the Directory Indexes field.
    Go to the Behavior tab, click on Rule Management, add a rule for PHP:
    • Rule type: Extensions
    • Extensions: php

    Handler Tab :
    • Handler: FastCGI
    • Balancer: Round Robin (when you select the item below, our Source should load)

    In the same way, add rules like Directory for wp-admin , wp-includes and wp-content , select List & Send as Handler , click SAVE and check in the browser that the site is working. In the next article, I will consider the difference in the performance of Apache and Cherokee based on the same WordPress, do not switch.




    Also popular now: