[ec2-beta] Virtual Hosts with Apache2

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


Basically what I have running is the following:

Latest EC2 Beta2 instance of Ubuntu
Apache2 installed via apt-get
Attached an EBS volume as XFS file system, and mounted it.

On EBS is a folder for my website
In /etc/a[ache2 there is a default file in sites-available which is  
attached below
I copied it to a new file for my second site, edited it slightly to  
add the domain name and enabled it

I also added a line to the apache2.conf file at the bottom to allow  
name based virtual hosts...

am I at least on the right track?

-micah


<VirtualHost *:80>
	ServerAdmin webmaster at localhost
	
	DocumentRoot /var/www/
	<Directory />
		Options FollowSymLinks
		AllowOverride None
	</Directory>
	<Directory /var/www/>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride None
		Order allow,deny
		allow from all
	</Directory>

	ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
	<Directory "/usr/lib/cgi-bin">
		AllowOverride None
		Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
		Order allow,deny
		Allow from all
	</Directory>

	ErrorLog /var/log/apache2/error.log

	# Possible values include: debug, info, notice, warn, error, crit,
	# alert, emerg.
	LogLevel warn

	CustomLog /var/log/apache2/access.log combined

     Alias /doc/ "/usr/share/doc/"
     <Directory "/usr/share/doc/">
         Options Indexes MultiViews FollowSymLinks
         AllowOverride None
         Order deny,allow
         Deny from all
         Allow from 127.0.0.0/255.0.0.0 ::1/128
     </Directory>

</VirtualHost>

On Mar 9, 2009, at 11:15 AM, Prabhakar, Ramprasad (GE, Corporate,  
consultant) wrote:

> Micah
>
> If you recently moved from RH-based system (like Fedora/CentOS/RH),  
> you
> might find that Virtual hosting config is a bit diff (syntax is all  
> the
> same, but just the way it is done in ubuntu). Would you mind posting  
> the
> config/file locations ?
>
> There is no spefic reason that it should not work in EC2 (we are  
> running
> VH on it ... And had to take some effort since we moved from Fedora  
> 8 to
> Ubuntu)
>
> - Ram
> -----Original Message-----
> From: ec2-beta-bounces at lists.ubuntu.com
> [mailto:ec2-beta-bounces at lists.ubuntu.com] On Behalf Of Micah Walter
> Sent: Monday, March 09, 2009 10:58 AM
> To: Ec2-beta at lists.ubuntu.com
> Subject: [ec2-beta] Virtual Hosts with Apache2
>
> 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





More information about the Ec2-beta mailing list