SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I have multiple domain names, all going to the same IP and apache server.
The way I had it setup, if you surfed there, the server name in the browser would change to one of the other ones (I forget exactly what it did, but it was a minor irritant.)
My question is: How do I keep these straight? I have RTFM, but I'm as confused as ever.
Any easier to understand guides on apache than the dang docs? As I said, I'm cornfuzzled.
I would like to know what/where/how/options of the virtual hosts.
The following setup uses 3 virtual hosts. The first one serves no purpose except to intercept requests that use an IP address instead of a domain name - it returns 403 errors for everything. I figure if people don't know my domain, they're not looking for the content, just vulnerabilities.
The other 2 entries represent domains I have visible through the servers at dyndns.com. I've stripped out the re-write rules, logging and authentication stuff just to provide the overview.
This all goes at the end of the httpd.conf file:
Code:
NameVirtualHost *:80
<VirtualHost *:80>
ServerName default.only
<Location />
Order allow,deny
Deny from all
</Location>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /var/www/mydomain
ServerName www.mydomain.com
<Directory "/var/www/mydomain">
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /var/www/anotherdomain
ServerName www.anotherdomain.com
<Directory "/var/www/anotherdomain">
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.