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_lo g
CustomLog /var/log/httpd/us/access_l og 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_lo g
CustomLog /var/log/httpd/de/access_l og custom env=!object
</VirtualHost>
If someone could please point out where the problem is located I would greatly appreciate it!
Thanks,
BB
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_lo
CustomLog /var/log/httpd/us/access_l
</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_lo
CustomLog /var/log/httpd/de/access_l
</VirtualHost>
If someone could please point out where the problem is located I would greatly appreciate it!
Thanks,
BB
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
i am still working on this, will respond soon.
thanks,
bb
thanks,
bb
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
NameVirtualHost 1.2.3.4
<VirtualHost 1.2.3.4>
I will split the points since you both responded.
Thanks.
BB
ASKER
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