I have a cakephp web app which I've uploaded and linked to an apache server on an ubuntu Amazon EC2 instance under domain name ec2xxxx.compute.aws.com
. The cake app is lying in the root of apache in /var/www/Cakefolder/
and opens directly on opening above link. I have bought a domain www.mywebsite.com
I now wish to link the production alpha version of cake app with my domain under a subdomain link like alpha.mywebsite.com
and have just a banner on www.mywebsite.com
. I wrote the following code in a file I created called mywebsite.com.conf
in etc/apache2/sites-available/
:
<VirtualHost alpha.mywebsite.com>
ServerAdmin webmaster@localhost
ServerAlias www.alpha1.mywebsite.com
DocumentRoot /var/www/cakeFolder
#if using awstats
ScriptAlias /awstats/ /usr/lib/cgi-bin/
CustomLog /var/log/apache2/mywebsite.com-access.log combined
</VirtualHost>
and then I added the following to etc/hosts file :
127.0.0.1 localhost.localdomain localhost alpha1.mywebsite.com www.alpha1.mywebsite.com
Right after doing this, my ec2 instance started displaying page unavailable and I cannot connect to the instance using putty or filezilla using ec2.aws.com dns or even elastic IP address. I have not yet linked it to the domain registrar, could that be the problem? Please help!