Setting up Apache vhost (multiple) websites on slicehost

First, make sure your dns records are setup. (also, you could just use slicehost’s article. it’s the best.)

Login to your slice and setup the directory structure for the site

cd ~/public_html
mkdir -p website.com/{public,private,log,cgi-bin,backup}
cd website.com/public
sudo nano index.html
# put a simple message

Now setup your apache config files

cd /etc/apache2/sites-available
sudo nano website.com
# fill it with your configuration

Here’s an example config file

sudo a2ensite website.com
sudo /etc/init.d/apache2 reload

Test out in your web browser at http://website.com

Then repeat the process for your other site(s).

Comments