Setting Up Apache Virtual Hosts- I keep getting the Apache default page?

April 27, 2015 2.3k views
Apache WordPress Ubuntu

I keep getting the apache default page, here are my steps for a single site what am i doing wrong?

sudo apt-get update
sudo apt-get install php5-gd libssh2-php

sudo mkdir -p /var/www/Mysite/publichtml
sudo chown -R rami:rami /var/www/Mysite/public
sudo chmod -R 755 /var/www

Create Demo Pages for Each Virtual Host

nano /var/www/Mysite/public_html/index.html

<title>Welcome to Example.com!</title>
<h1>Success! The example.com virtual host is working!</h1>

Create New Virtual Host Files

sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/Mysite.conf

sudo nano /etc/apache2/sites-available/photo.conf

<VirtualHost *:80>
ServerAdmin My email@live.com
ServerName Mysite.com
ServerAlias www.Mysite.com
DocumentRoot /var/www/Mysite/publichtml
ErrorLog ${APACHELOGDIR}/error.log
DIR}/access.log combined

Save and close the file.

Enable the New Virtual Host Files

sudo a2ensite photo.conf
sudo service apache2 restart

Could it be my Dns/domain setup, do i have to add subdomain or something more complex, it's set up just to point here and thats it?

Ultimately I'm trying to set 3 wordpress websites, prior to this i installed LAMP and set up the database's for each following the How To Set Up Multiple WordPress Sites on a Single Ubuntu VPS. I stopped after the database was setup and followed this guide How To Set Up Apache Virtual Hosts on Ubuntu 14.04 LTS to test if it would work but nothing so far.

Im not getting any errors and everything seemed fine, i don't know what I'm missing?

1 Answer

This question was answered by @rami2:

Hi, I've since solved the issue and set up 3 websites on one droplet, i wrote a tutorial for the entire process which you may find helpful some things are missing from the digital ocean tutorials.



View the original comment

Have another answer? Share your knowledge.