You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Matthew Flower <Ma...@Project.Net> on 2002/09/17 19:13:52 UTC

[users@httpd] Setting the ServerName variable per request

I've recently started to host an application that was previously hosted on
IIS.  After reading through the documentation and the mailing list, I've
learned that ServerName is generally going to be 127.0.0.1 or some static
value that you set it to.

Additionally you can use virtual hosts to set it, as in the following:

NameVirtualHost 192.168.1.55
<VirtualHost 192.168.1.55>
    ServerName demo1
</VirtualHost>
<VirtualHost 192.168.1.55>
    ServerName demo2
</VirtualHost>

Unfortunately, this creates a bit of a setup hassle.  I would like to always
set the server name environment variable to the server name that was passed
to apache.

To explain in a bit more detail, if I were to set up a new DNS entry for
demo3 and a user accessed the web site with http://demo3, I'd like the
application server to get the proper server name without having to do any
additional setup in the httpd.conf.  Is this possible?
 
Thanks in Advance,
Matthew Flower 

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Setting the ServerName variable per request

Posted by daniel <da...@rawbyte.com>.
> To explain in a bit more detail, if I were to set up a new DNS entry for
> demo3 and a user accessed the web site with http://demo3, I'd like the
> application server to get the proper server name without having to do any
> additional setup in the httpd.conf.  Is this possible?

Have a look at 
UseCanonicalName off
http://httpd.apache.org/docs-2.0/mod/core.html#usecanonicalname

Cheers

Daniel

-- 
Teach Yourself Apache 2 -- http://apacheworld.org/ty24/

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org