Litespeed - Virtual Host Layout
This article outlines the layout used for the virtual hosts throughout the Litespeed Server setup articles.
Understanding the layout makes for quicker and easier setup of the server and consistency will save us time.
These details of how I setup my server for these articles. Take the time to read it as it will give an overview of the layout of my virtual host folders, where the log files go and how multiple domains 'stitch' together in the Litespeed configuration.
If you've come from Apache, or even some other server, you may be used to using /var/www/ or /srv/www/ for your domain folders. You can, of course, continue to do that, except I like to keep them in my home folder for a few reasons. Firstly it's easy to access and it's easier to set permissions without being concerned about messing around in folders owned by root (there's a reason they're owned by root!).
Let's say we are setting up two domains: one PHP based domain and one Ruby on Rails domain. In my home folder (/home/paul/) I would create a public_html folder:
mkdir /home/paul/public_html
It can be called anything and can reside anywhere but I like it there and I like to call it public_html (probably left over from my Apache days).
The public_html folder contains all my domains, so a quick glance at the structure would look like:

A more detailed look at the public_html layout would reveal very similar layouts in both the PHP domain folder and the Ruby on Rails domain folder. The quick eyed among you will note that, in fact, the PHP folders mirror a lot of the Ruby on Rails folders - this is quite deliberate as consistency in everything, whether naming protocols or programming, is a Good Thing . A close look at the PHP domain folder looks like:

As is clearly shown, the 'public' folder in the PHP domain layout contains the public files such as index.php and so on. The log folder will contain the domain log files, the config folder will contain any configuration files such the one Litespeed will produce outlining the layout of that virtual host. I don't want my mysql connection files to be in a public folder so I keep them in a folder above the public root called private.
As said before, this is simply how I setup the domains for these articles. It can vary as much as you want and you can name your folders whatever you like but having an overview like this makes understanding the virtual host templates a lot easier.
The PHP domain shown above mirrors a lot of the structure of a Ruby on Rails application. For those who have created a Rails application before, or used Mephisto, you will recognise the layout shown below. I haven't included all the folders that are created as most are irrelevant to the virtual host configuration (such as the vendor directory - useful for our Rails application but not relevant to our virtual host layout):

Again, the public folder contains our public files, the log folder will contain this domain's log files, the config folder contains not only the Rails application files but the xml file Litespeed creates containing the virtual host layout.
Although, it's all fairly self explanatory, I hope the layouts clear up any questions or doubts as to what we are doing and why we are doing it when we configure the Virtual Host Templates.
The next two articles concentrate on configuring:
A PHP Virtual Host and a Ruby on Rails Virtual Host.
Feel free to skip the PHP Virtual Host article and move straight onto the Rails Virtual Host Article. Both are mutually exclusive so read the one that is relevant to you or, if like me, you have many different sites to host, read both.
PickledOnion.
Digg it |
del.icio.us |
reddit |
StumbleUpon

Subscribe to Feed