Link to home
Start Free TrialLog in
Avatar of baxleyb
baxleyb

asked on

How to modify Apache config to host multiple sites

Hi I would like to modify the config file to host multiple sites and subdomains based on 1 ip address. I am running Apache 2

This is a basic config that I have, I also have some mod_rewrites in place as well, but this is not working:

NameVirtualHost 1.2.3.4
<VirtualHost 1.2.3.4>

 ServerAdmin webmaster@site1.com
 DocumentRoot /deployment/site2/us/
 DirectoryIndex index.html index.htm index.php index.cgi
 ServerName site1.com
 ServerAlias www.site1.com
 ErrorLog /var/log/httpd/us/error_log
 CustomLog /var/log/httpd/us/access_log custom env=!object
</VirtualHost>

NameVirtualHost 1.2.3.4
<VirtualHost 1.2.3.4>

 ServerAdmin webmaster@site2.com
 DocumentRoot /deployment/site2/de/
 DirectoryIndex index.html index.htm index.php index.cgi
 ServerName site2.de
 ServerAlias www.site2.de
 ErrorLog /var/log/httpd/de/error_log
 CustomLog /var/log/httpd/de/access_log custom env=!object
</VirtualHost>


If someone could please point out where the problem is located I would greatly appreciate it!

Thanks,

BB
ASKER CERTIFIED SOLUTION
Avatar of sleep_furiously
sleep_furiously

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of baxleyb
baxleyb

ASKER

Hi,

Basically I want to host 2 top level domains, 1 .com and 1 .de.

For some reason my configuration will only allow me to host one and some sub-domains.

I hope this makes sense.

Thanks,

BB
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of baxleyb

ASKER

i am still working on this, will respond soon.

thanks,

bb
Avatar of baxleyb

ASKER

I got it to work using this config for each site I wanted to host:

NameVirtualHost 1.2.3.4
<VirtualHost 1.2.3.4>

I will split the points since you both responded.
Thanks.
BB