Apache vhosts 2 domains
com and .co.uk domains, is it possible to create a virtual host to point to a single directory on the box?
At present I have
<VirtualHost *:80>
ServerName www.domain.co.uk
ServerAlias domain.co.uk
DocumentRoot "C:/htdocs/domain.com/htdocs" <Directory />
Options +Includes
</Directory> ErrorLog "C:/htdocs/domain.co.uk/logs/error.log"
CustomLog "C:/htdocs/domain.co.uk/logs/access.log" combined
Yes just add them to your ServerAlias
ServerAlias domain.co.uk www.domain.com domain.com
Or you could do it like this:
ServerName domain.co.uk
ServerAlias *.domain.co.uk domain.com *.domain.com
I think you have som inconsistency problems with your posted code. Using both C:/htdocs/domain.co.uk/ and C:/htdocs/domain.com/
If it was up to me. I would put everything in C:/htdocs/domain.com/ and use the following
<VirtualHost *:80>
ServerName domain.com
ServerAlias *.domain.com domain.co.uk *.domain.co.uk
DocumentRoot "C:/htdocs/domain.com/htdocs" <Directory />
Options +Includes
</Directory> ErrorLog "C:/htdocs/domain.com/logs/error.log"
CustomLog "C:/htdocs/domain.com/logs/access.log" combined
</VirtualHost>
Please note, when using *.domain.com (star-alias) in ServerAlias. If you wish to add a specific subdomain (example delicious-subs.domain.co.uk) in a new VirtualHost – pointing to another location. Then you will have to add that new VirtualHost with above/before the VirtualHost using the star-alias.
Check more discussion of this question.
Related posts:
Leave a comment
Recent Posts
- Cron expression that runs every 5 minutes from 1:30 am – 6:00 am [duplicate]
- Understanding redundant power supplies
- Is there a way for administrators to disable users from installing Firefox extensions?
- Is there research material on NTP accuracy available?
- How to create a limited “domain admin” that does not have access to domain controllers?
Tags
active-directory
amazon-ec2
apache
apache2
backup
bash
centos
cisco
command-line
debian
dns
email
exchange
firewall
iis
iis7
iptables
linux
macosx
monitoring
mysql
networking
nginx
performance
permissions
php
postfix
raid
security
sql-server
sql-server-2005
sql-server-2008
ssh
ssl
ubuntu
unix
virtualization
vpn
webserver
windows
windows-7
windows-server-2003
windows-server-2008
windows-server-2008-r2
windows-xp





