Setting up virtual hosts might seem like a big challenge, but it's not. In fact, you can set up a virtual host with just a few edits to Apache's configuration and by setting up additional directories for the documents. For this how to, I want to use an Apache installation on a Ubuntu server. Please be aware, the instructions for this may require modification if being done on a non-Debian distribution because of the way that Apache is packaged. However, the Apache directives should be standard across distributions and should work even if Apache isn't running on Linux.
Creating the Directory Structure
Before the configurations can be tackled, the directory structure for the virtual site must be created. I am going to be working with Apache as installed on a Ubuntu server, so the Apache document root will be
/var/www
. The directory structure for the new Web site can be created anywhere. Some create those directories in their home (~/
) directory, some create them in /usr/local/apache
, and other, various locations. For the sake of simplicity, I am going to illustrate setting the virtual host in the document root of Apache (in Ubuntu that would be /var/www
). By doing this, it will not be necessary to change ownership of the newly created directory or the parent directory housing the virtual host (since Apache must have access to the directories and files.)Read more http://blogmee.info/index.php/create-virtual-hosts-with-apache/
No comments:
Post a Comment