Page 2 of 2

Posted: 17 Aug 2006, 18:35
by gravyface
oops. read your reply too late. Windows Apache2 might be wonky -- I know there were gripes when it was first released. Try ServerAlias:

http://httpd.apache.org/docs/2.0/mod/co ... erveralias

Posted: 17 Aug 2006, 18:43
by gravyface
I'd try a search through c:\program files\*apache directory* for the string "localhost" and see if you set it somewhere during installation.

Posted: 17 Aug 2006, 18:54
by btenpenny
No dice there, either (other than some hits in the documentation).

If I wanted to set that PHP variable, where would I set it?

Posted: 17 Aug 2006, 18:56
by gravyface
don't give up yet! :)

There's got to be a way to set this up. did you try ServerAlias?

Posted: 17 Aug 2006, 19:04
by btenpenny
I'm not using virtual hosts at all, so I don't think it would enter into the equation.

Can I specify those php variables somewhere in the Apache Config?

Thanks again for all the time you've spent helping me on this.

Posted: 17 Aug 2006, 19:07
by gravyface
Man I'm doin all your work for you :)

Here's what they said in the #apache IRC channel on freenode:

"it returns either the value of the ServerName directive, or possibly ServerAlias (of the value sent in the Host: header) if UseCanonicalName is Off"

So... try ServerAlias or set UseCanonicalName to "Off".

Posted: 17 Aug 2006, 19:10
by shark
from httpd.conf:
UseCanonicalName: Determines how Apache constructs self-referencing
# URLs and the SERVER_NAME and SERVER_PORT variables.
# When set "Off", Apache will use the Hostname and Port supplied
# by the client. When set "On", Apache will use the value of the
# ServerName directive.
#
So depending on this var, and how you set other vars, Apache will create SERVER_NAME

http://httpd.apache.org/docs/2.0/mod/co ... onicalname
http://httpd.apache.org/docs/2.0/mod/co ... servername

Posted: 17 Aug 2006, 19:10
by gravyface
Can I specify those php variables somewhere in the Apache Config?
They should be pulling them from ServerName and/or ServerAlias -- if you read the PHP dox (or read what I posted above) it tells you that the Web Server (Apache) provides the data for the PHP environmental variables, which are really just the CGI variables, a standardized set of system properties accessible through Apache/IIS etc.

You need to figure out why the ServerName and ServerAlias are not providing those values.

Posted: 17 Aug 2006, 19:25
by btenpenny
SCORE!

Setting "UseCanonicalName On" appears to have fixed it. According to the docs, it defaults to on anyway, so I don't know why it needed to be explicitly set. Anyway, it now works. Thanks ever so much to both of you!

Posted: 17 Aug 2006, 19:41
by shark
yay :)

Posted: 17 Aug 2006, 22:10
by gravyface
np. Now if only somebody would reply to my permissions/category post. :(