From: Joshua Slive Date: Wed, 13 Feb 2002 19:58:21 +0000 (+0000) Subject: Change httpd.conf default UseCanonicalName to off to make the server X-Git-Tag: 2.0.33~275 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e468fda9c507da8b00de615fb97d2839c7a3a1b7;p=apache Change httpd.conf default UseCanonicalName to off to make the server more idiot proof. Also, move UseCanonicalName to directly under ServerName to make the connection clearer, and clean up the comments. I removed the http://123.123.123.231/ example, because it just makes it too tempting for people to use ServerName http://123.23.23.23/ git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93396 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/conf/httpd-nw.conf b/docs/conf/httpd-nw.conf index 57daa9afdf..ccc6a8f1ab 100644 --- a/docs/conf/httpd-nw.conf +++ b/docs/conf/httpd-nw.conf @@ -178,22 +178,27 @@ Listen @@Port@@ ServerAdmin @@ServerAdmin@@ # -# ServerName allows you to set a host name which is sent back to clients for -# your server if it's different than the one the program would get (i.e., use -# "www" instead of the host's real name). +# ServerName gives the name and port that the server uses to identify itself. +# This can often be determined automatically, but we recommend you specify +# it explicitly to prevent problems during startup. # -# 127.0.0.1 is the TCP/IP local loop-back address. Your machine -# always knows itself by this address. If you machine is connected to -# a network, you should change this to be your machine's name +# If this is not set to valid DNS name for your host, server-generated +# redirections will not work. See also the UseCanonicalName directive. # -# Note: You cannot just invent host names and hope they work. The name you -# define here must be a valid DNS name for your host. If you don't understand -# this, ask your network administrator. # If your host doesn't have a registered DNS name, enter its IP address here. -# You will have to access it by its address (e.g., http://123.45.67.89/) -# anyway, and this will make redirections work in a sensible way. +# You will have to access it by its address anyway, and this will make +# redirections work in a sensible way. # -ServerName @@ServerName@@ +#ServerName new.host.name:80 + +# +# 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. +# +UseCanonicalName Off # # DocumentRoot: The directory out of which you will serve your @@ -314,16 +319,6 @@ AccessFileName .htaccess Deny from all -# -# UseCanonicalName: With this setting turned on, whenever Apache needs -# to construct a self-referencing URL (a URL that refers back to the -# server the response is coming from) it will use ServerName to form -# a "canonical" name. With this setting off, Apache will use the -# hostname:port that the client supplied, when possible. This also -# affects SERVER_NAME and SERVER_PORT in CGI scripts. -# -UseCanonicalName On - # # TypesConfig describes where the mime.types file (or equivalent) is # to be found. diff --git a/docs/conf/httpd-std.conf b/docs/conf/httpd-std.conf index 805ace4841..6533dcb619 100644 --- a/docs/conf/httpd-std.conf +++ b/docs/conf/httpd-std.conf @@ -269,11 +269,20 @@ ServerAdmin you@your.address # redirections will not work. See also the UseCanonicalName directive. # # If your host doesn't have a registered DNS name, enter its IP address here. -# You will have to access it by its address (e.g., http://123.45.67.89/) -# anyway, and this will make redirections work in a sensible way. +# You will have to access it by its address anyway, and this will make +# redirections work in a sensible way. # #ServerName new.host.name:80 +# +# 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. +# +UseCanonicalName Off + # # DocumentRoot: The directory out of which you will serve your # documents. By default, all requests are taken from this directory, but @@ -383,16 +392,6 @@ AccessFileName .htaccess Deny from all -# -# UseCanonicalName: With this setting turned on, whenever Apache needs -# to construct a self-referencing URL (a URL that refers back to the -# server the response is coming from) it will use ServerName to form -# a "canonical" name. With this setting off, Apache will use the -# hostname:port that the client supplied, when possible. This also -# affects SERVER_NAME and SERVER_PORT in CGI scripts. -# -UseCanonicalName On - # # TypesConfig describes where the mime.types file (or equivalent) is # to be found. diff --git a/docs/conf/httpd-win.conf b/docs/conf/httpd-win.conf index 7417063ebf..c1b93fe773 100644 --- a/docs/conf/httpd-win.conf +++ b/docs/conf/httpd-win.conf @@ -204,11 +204,20 @@ ServerAdmin @@ServerAdmin@@ # redirections will not work. See also the UseCanonicalName directive. # # If your host doesn't have a registered DNS name, enter its IP address here. -# You will have to access it by its address (e.g., http://123.45.67.89/) -# anyway, and this will make redirections work in a sensible way. +# You will have to access it by its address anyway, and this will make +# redirections work in a sensible way. # ServerName @@ServerName@@:@@Port@@ +# +# 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. +# +UseCanonicalName Off + # # DocumentRoot: The directory out of which you will serve your # documents. By default, all requests are taken from this directory, but @@ -323,16 +332,6 @@ AccessFileName .htaccess Deny from all -# -# UseCanonicalName: With this setting turned on, whenever Apache needs -# to construct a self-referencing URL (a URL that refers back to the -# server the response is coming from) it will use ServerName to form -# a "canonical" name. With this setting off, Apache will use the -# hostname:port that the client supplied, when possible. This also -# affects SERVER_NAME and SERVER_PORT in CGI scripts. -# -UseCanonicalName On - # # TypesConfig describes where the mime.types file (or equivalent) is # to be found.