[ec2-beta] Virtual Hosts with Apache2

Micah Walter micahpix at mac.com
Mon Mar 9 17:33:45 GMT 2009


thanks for the info. I followed the directions a little more closely  
and it seems to be working now.. I now have the "default" site running  
which you can get to by typing in the elastic IP address as the URL,  
and my second site by going to its domain name... when I restarted  
apache I did notice a warning message

NameVirtualHost myipaddress:80 has no VirtualHosts

It seems to still work just fine, but I wonder why I am getting this  
error, maybe adding the line to the apache2.conf file wasn't necessary?

-micah


On Mar 9, 2009, at 1:24 PM, Michael Greenly wrote:

> There's nothing unique about EC2 in respect to any of this.
>
> If it's falling through the default location it means it's not  
> finding a match.
>
> You will want to make sure that each domain name you want to use  
> with this instance has record pointing to the instances IP address.
>
> You can do an "nslookup mydomain.com" to check this
>
> You will want to make sure that you have a virtualhost configuration  
> that includes a servername or serveralias directive.
>
> <virtualhost *:80>
>   servername www.example.com
>   serveralias  example.com
>
>   ....
>
> </virtualhost>
>
> <virtualhost *:80>
>   servername www.someplace.com
>   serveralias  www.someplace.net
>
>  ....
>
> </virtual>
>
> Also make sure that your configuration modifications are enabled.   
> Each configuration should be in it's own file inside the /etc/ 
> apache2/sites-available directory.  Then you'd use a2ensite to  
> enable it.  If you're not familiar with this I'd look around the web  
> for some tutorials about configuring Apache in Ubuntu or Debian.
>
> Hope that helps some.
>
> On Mon, Mar 9, 2009 at 9:57 AM, Micah Walter <micahpix at mac.com> wrote:
> Hi,
> I am trying to set up an instance to serve about 5 or 6 websites. I
> would like to do this via Apache2's Virtual Hosts setup where I can
> have one IP address and many sites.
>
> So far I haven't been able to get it to work. I use an elastic IP with
> the instance and put that in the godaddy domain setup. It seems to
> always want to point to the default location and not the virtual host
> I have created. So I am guessing that I either have my apache config
> files setup incorrectly, or that perhaps there is some intricacy about
> doing this on EC2 that I'm not aware of...
>
> Has anyone else been successful setting this up?
>
> best
> micah
>
> --
> Ec2-beta mailing list
> Ec2-beta at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ec2-beta
>
>
>
> -- 
> Michael Greenly
> http://blog.michaelgreenly.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/mailman/private/ec2/attachments/20090309/07a12029/attachment-0002.htm 


More information about the Ec2-beta mailing list