0

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!

user221931
  • 1,852
  • 1
  • 13
  • 16

1 Answers1

0

This has nothing to do with your virtual host configuration. When you have attached an EIP, the instance would drop the Public DNS name. So that is out of picture.

Now, could you check and ensure that the EIP is still attached to the instance. OR to reconfirm, could you detach the EIP and re-attach it. Also, there is an option called "Get System Log" as shown below. Click on that and see whether you find any suspicious messages:

enter image description here

The SSH connection is independent of your apache configuration and this could be just a coincidence.

slayedbylucifer
  • 22,878
  • 16
  • 94
  • 123
  • THe instance is opening fine with both the EIP and the public DNS, sorry for the mistake..But I just can't access it now through an SSH connection somehow. The system log's last entry is august when I started the instance and contains its fingerprint and key pair, it's normal. Why did the SSH connection start getting rejected suddenly? – Anugrah Pandey Oct 26 '13 at 09:16
  • You response is confusing. What do you mean by `THe instance is opening fine` ? – slayedbylucifer Oct 26 '13 at 11:58
  • Meaning the server is up, and when I'm accessing it via IP address or linked domain it resolves correctly and displays. But I cant make any changes to the instance(server) config or website because ftp cant access the server! – Anugrah Pandey Oct 26 '13 at 13:58