Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

use Location directive for specific site configuration

Status
Not open for further replies.

csgonan

MIS
May 2, 2007
118
US
I have to apply specific configuration commands to a site site.my-domain.com the do not get applied to all other sites in *.my-domain.com. In addition, all my-domain.com (including the specific) have to be ssl only sites.

To accomplish this I have a vhost that is defined by a specific ServerName and a wildcard ServerAlias. Which seems to work. All sites have the same DocumentRoot.

I now have to apply certain apache configuration commands only when site.my-domain.com is accessed, not the other *.my-domain.com is accessed. Can I use the Location directory to specify only the commands that apply to site.my-domain.com and not for all others in *.my-domain.com?

Thank you.
 
You should be able to put most of the directives in the virtual host block.

One caveat jumped out at me in your post: the fact that all of your sites have to be ssl. You may run into trouble here. The problem is that ssl doesn't work correctly with named virtual hosts. Each host must have its own (public) IP address. (If anyone knows of how to get around this, I and many others would like to know how).

The problem is that the SSL authentication is done at a step before the naming of the host. Consequently, the authentication must be done on the basis of IP address only.

Now, if you do have multiple virtual hosts with SSL, you will be able to use SSL and encrypt the pages, BUT you will get a certificate error. The error is due to the fact that the certificate for the first site on the list will be used. Depending on your needs, this may not be a problem for you. For example, if you want to have a web-mail site and always want to encrypt it you may not care if the certificate is valid.

I have read that the GNUTLS supports multiple named based virtual hosts. It didn't quite work for me, though, I think you need to patch and re-compile apache2 to get it to work (which I didn't do). If anyone else has any experience with it and got it to work, maybe they can help out.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top