…in fieri…

Virtual Hosts With Cherokee

by on Jul.14, 2011, under Cherokee, Hosting, Internet

The cherokee-project is a fast efficient web server that supports the widespread technologies available today. It also provides an easy to use administration interface, as well as fast deployment of web applications via the cherokee-market.

Deployment of virtual hosts is made simple using the admin interface. This short tutorial will show how to do so. The first thing we need to do is install and run the server, and then run and connect to the admin interface.

cherokee_admin

This creates a one-time password that you can use to connect to the admin interface via your browser. I am running cherokee in a virtual machine so I added the argument ‘-b192.168.0.11′ to bind to the virtual nic so I could connect from my workstation, otherwise the admin interface is only available via the localhost. Once you connect and enter the supplied credentials you will be presented with the main page of the admin panel. We need to click on the ‘vServers’ icon at the top of the page.

main_page

This will take us to the virtual hosts management section. As you can see, there is already a virtual server named ‘Default’, this is where the default pages a served from when clients connect to the server. To create a virtual host we need to click on the + icon at the top of the left hand panel.

vhost_page

This will open a popup which allows us to add a nickname and document directory for our virtual host. The nickname can be an identifier such as ‘Test Server’ or if you wish to match requests against the nickname you can use the URL that you wish to use for the host. Cherokee can match virtual hosts using a variety of methods which will be explained more later in the tutorial. If the document directory that you choose is not available in the file system then cherokee will not create the server until you create the directory yourself.

add_vhost

After we add our virtual server we will can modify all sorts of settings. Learning more about these settings is left as an exercise for the reader.

vhost_added

We are going to add PHP support to our virtual server so we need to visit the behaviors section of the configuration and add a new rule.

behavior

After we click on the ‘Add Rule’ button we will be presented with a popup that provides the option to create our own rules manually or choose from a pre-cooked rule. Since we wish to add PHP support, we click on languages, then choose PHP and then click on ‘add’.

add_php

This will create a handler for PHP and we will be taken to the main configuration for the handler. Once again, learning about all the different configuration options for the handler is left as an exercise for the reader.

php_handler

Now we need a way to tell the server what how it should match client requests with our new virtual server. To do so, we must vist the ‘Host Match’ tab of the virtual server configuration. As we can see, we are presented with a variety of self-explanatory ways to match requests to virtual hosts. For this tutorial I am going to use IP address matching.

host_match

We simply select ‘Server IP’ from the dropdown box and then will be presented with a popup where we can add the IP address we wish to match requests with.

ip_match

Now, we should be able to visit our new virtual server using the IP address we added to the match rule and see the default cherokee cover page.

coverpage

There are a lot more options available to the administrator and you will find that cherokee is choice for both development and production usage. Although it does not have the wide range of options available to more mature products like Apache, it is still a highly capable web server platform.

:

Leave a Reply

:D :) :o :eek: :( :lol: :wink: :arrow: :idea: :?: :!: :evil: :p

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Blogroll

A few highly recommended websites...