You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Ryan Bloom <rb...@covalent.net> on 2001/10/04 05:24:04 UTC

[PATCH] Remove the Port directive.

This patch completely deprectates the Port directive.  The ServerName
directive is now overloaded, so that admins specify the port and name on
the same directive.  It also makes Listen a required directive.  Pay attention
to that.  There are no default ports with this patch.  If your config doesn't have
a Listen directive, the server doesn't start, and it emits an error.

I am a bit hesitant to commit this without some feedback, because it is a pretty
major change.  Before I commit this, I will update all of the docs.

Thoughts?

Ryan

? build.log
? build.err
? modules/httpd-pop3
? srclib/apr/build.log
? srclib/apr/build.err
? srclib/apr/test/build.log
? srclib/apr/test/build.err
Index: docs/conf/httpd-std.conf
===================================================================
RCS file: /home/cvs/httpd-2.0/docs/conf/httpd-std.conf,v
retrieving revision 1.52
diff -u -d -b -w -u -r1.52 httpd-std.conf
--- docs/conf/httpd-std.conf	2001/10/03 18:56:38	1.52
+++ docs/conf/httpd-std.conf	2001/10/04 02:49:00
@@ -231,12 +231,6 @@
 #
 
 #
-# Port: The port to which the standalone server listens. For
-# ports < 1023, you will need httpd to be run as root initially.
-#
-Port @@Port@@
-
-#
 # If you wish httpd to run as a different user or group, you must run
 # httpd as root initially and it will switch.  
 #
@@ -270,7 +264,7 @@
 # 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.
 #
-#ServerName new.host.name
+#ServerName new.host.name:80
 
 #
 # DocumentRoot: The directory out of which you will serve your
Index: server/core.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/core.c,v
retrieving revision 1.64
diff -u -d -b -w -u -r1.64 core.c
--- server/core.c	2001/09/29 08:33:02	1.64
+++ server/core.c	2001/10/04 02:49:02
@@ -1603,15 +1603,27 @@
     return NULL;
 }
 
-static const char *server_port(cmd_parms *cmd, void *dummy, const char *arg)
+static const char *server_hostname_port(cmd_parms *cmd, void *dummy, const char *arg)
 {
     const char *err = ap_check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE|NOT_IN_LIMIT);
+    const char *portstr;
+    const char *server;
     int port;
 
     if (err != NULL) {
 	return err;
     }
-    port = atoi(arg);
+    portstr = ap_strchr_c(arg, ':');
+    if (portstr) {
+        cmd->server->server_hostname = apr_pstrndup(cmd->pool, arg, 
+                                                    portstr - arg);
+        portstr++;
+        port = atoi(portstr);
+    }
+    else {
+        cmd->server->server_hostname = apr_pstrdup(cmd->pool, arg);
+        port = 80;
+    }
     if (port <= 0 || port >= 65536) { /* 65536 == 1<<16 */
 	return apr_pstrcat(cmd->temp_pool, "The port number \"", arg, 
 			  "\" is outside the appropriate range "
@@ -2411,7 +2423,8 @@
 
 /* Old server config file commands */
 
-AP_INIT_TAKE1("Port", server_port, NULL, RSRC_CONF, "A TCP port number"),
+AP_INIT_TAKE1("Port", ap_set_deprecated, NULL, RSRC_CONF, 
+  "Port was replaced with Listen in Apache 2.0"),
 AP_INIT_TAKE1("HostnameLookups", set_hostname_lookups, NULL,
   ACCESS_CONF|RSRC_CONF,
   "\"on\" to enable, \"off\" to disable reverse DNS lookups, or \"double\" to "
@@ -2419,9 +2432,8 @@
 AP_INIT_TAKE1("ServerAdmin", set_server_string_slot,
   (void *)APR_XtOffsetOf (server_rec, server_admin), RSRC_CONF,
   "The email address of the server administrator"),
-AP_INIT_TAKE1("ServerName", set_server_string_slot,
-  (void *)APR_XtOffsetOf (server_rec, server_hostname), RSRC_CONF,
-  "The hostname of the server"),
+AP_INIT_TAKE1("ServerName", server_hostname_port, NULL, RSRC_CONF,
+  "The hostname and port of the server"),
 AP_INIT_TAKE1("ServerSignature", set_signature_flag, NULL, OR_ALL,
   "En-/disable server signature (on|off|email)"),
 AP_INIT_TAKE1("ServerRoot", set_server_root, NULL, RSRC_CONF,
Index: server/listen.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/listen.c,v
retrieving revision 1.61
diff -u -d -b -w -u -r1.61 listen.c
--- server/listen.c	2001/08/13 04:57:34	1.61
+++ server/listen.c	2001/10/04 02:49:03
@@ -273,11 +273,10 @@
     ap_listen_rec *next;
     int num_open;
 
-    /* allocate a default listener if necessary */
-    if (ap_listeners == NULL) {
-	alloc_listener(process, NULL, (apr_port_t)(port ? port : DEFAULT_HTTP_PORT));
-    }
-
+    /* Don't allocate a default listener.  If we need to listen to a
+     * port, then the user needs to have a Listen directive in their
+     * config file.
+     */
     num_open = 0;
     for (lr = ap_listeners; lr; lr = lr->next) {
 	if (lr->active) {


______________________________________________________________
Ryan Bloom				rbb@apache.org
Covalent Technologies			rbb@covalent.net
--------------------------------------------------------------

Re: [PATCH] Remove the Port directive.

Posted by Ryan Bloom <rb...@covalent.net>.
On Thursday 04 October 2001 09:14 am, William A. Rowe, Jr. wrote:
> From: "Ryan Bloom" <rb...@covalent.net>
> Sent: Thursday, October 04, 2001 11:04 AM
>
> > On Thursday 04 October 2001 08:50 am, Rodent of Unusual Size wrote:
> > > "William A. Rowe, Jr." wrote:
> > >
> > > Also, from your example:
> > > > ServerName this.host.com       [assumes the default port 80]
> > >
> > > except that Ryan said there is no default port any more.
> >
> > That was a poor explanation on my part.  The default port is 80, but we
> > do not default a listening port anymore.  This means that we will report
> > that we are listening on port 80 by default, but if there are no Listen
> > directives, the server will not start.
>
> What does this do?
>
> Listen 10.0.0.10
>
> Will it assume a default of :80, or error out?

It errors out saying that a port must be specified.  I didn't change that logic
at all.

Ryan

______________________________________________________________
Ryan Bloom				rbb@apache.org
Covalent Technologies			rbb@covalent.net
--------------------------------------------------------------

Re: [PATCH] Remove the Port directive.

Posted by "William A. Rowe, Jr." <wr...@covalent.net>.
From: "Ryan Bloom" <rb...@covalent.net>
Sent: Thursday, October 04, 2001 11:04 AM


> On Thursday 04 October 2001 08:50 am, Rodent of Unusual Size wrote:
> > "William A. Rowe, Jr." wrote:
> 
> > Also, from your example:
> > > ServerName this.host.com       [assumes the default port 80]
> >
> > except that Ryan said there is no default port any more.
> 
> That was a poor explanation on my part.  The default port is 80, but we
> do not default a listening port anymore.  This means that we will report that
> we are listening on port 80 by default, but if there are no Listen directives,
> the server will not start.

What does this do?

Listen 10.0.0.10

Will it assume a default of :80, or error out?


Re: [PATCH] Remove the Port directive.

Posted by Ryan Bloom <rb...@covalent.net>.
On Thursday 04 October 2001 03:12 pm, dean gaudet wrote:

> if a "NameVirtualHost Foo.Com" directive is present, and there are no
> other vhost sections then it'll warn that there's a NameVirtualHost
> without any vhosts.
>
> > The default port is 80, but we do not default a listening port
> > anymore.
>
> so this means an httpd.conf with "Listen 80", but no ServerName directive
> and no vhosts would JFW, right?  (i.e. the ServerName would end up
> defaulting to the gethostname() result, and the port would default to 80.)

That was my test case, and it does JFW.

Ryan
______________________________________________________________
Ryan Bloom				rbb@apache.org
Covalent Technologies			rbb@covalent.net
--------------------------------------------------------------

Re: [PATCH] Remove the Port directive.

Posted by dean gaudet <de...@arctic.org>.
On Thu, 4 Oct 2001, Ryan Bloom wrote:

> On Thursday 04 October 2001 08:50 am, Rodent of Unusual Size wrote:
>
> > Listen 80
> > ServerName Foo.Com
> > <VirtualHost OtherFoo.Com:8080>
> >
> > What happens?  Presumably the vhost will never hear anything,
> > but will/should we detect it and report it?
>
> We don't today.  Should we, probably.  This patch does not touch this
> logic though.

in the absense of a "NameVirtualHost Foo.Com" directive, the above doesn't
generate a warning in 1.3... (although it does if you select the dump
vhosts command line option, odd that i didn't put the warning into normal
runs!)

if a "NameVirtualHost Foo.Com" directive is present, and there are no
other vhost sections then it'll warn that there's a NameVirtualHost
without any vhosts.

> The default port is 80, but we do not default a listening port
> anymore.

so this means an httpd.conf with "Listen 80", but no ServerName directive
and no vhosts would JFW, right?  (i.e. the ServerName would end up
defaulting to the gethostname() result, and the port would default to 80.)

+1 if so.

-dean




Re: [PATCH] Remove the Port directive.

Posted by Ryan Bloom <rb...@covalent.net>.
On Thursday 04 October 2001 08:50 am, Rodent of Unusual Size wrote:
> "William A. Rowe, Jr." wrote:
> > And if you are correct, that this breaks VirtualHost, then
> > we have a bug and we better fix that before Ryan's commit.
>
> I am not sure if it breaks it or not, but having lots of
> flexibility for specifying name/address/port in the <VirtualHost>
> open directive bungs up the cleanliness.
>
> Listen 80
> ServerName Foo.Com
> <VirtualHost OtherFoo.Com:8080>
>
> What happens?  Presumably the vhost will never hear anything,
> but will/should we detect it and report it?

We don't today.  Should we, probably.  This patch does not touch this
logic though.

> Also, from your example:
> > ServerName this.host.com       [assumes the default port 80]
>
> except that Ryan said there is no default port any more.

That was a poor explanation on my part.  The default port is 80, but we
do not default a listening port anymore.  This means that we will report that
we are listening on port 80 by default, but if there are no Listen directives,
the server will not start.

Ryan
______________________________________________________________
Ryan Bloom				rbb@apache.org
Covalent Technologies			rbb@covalent.net
--------------------------------------------------------------

Re: [PATCH] Remove the Port directive.

Posted by Ryan Bloom <rb...@covalent.net>.
On Thursday 04 October 2001 09:18 am, William A. Rowe, Jr. wrote:
> From: "Aaron Bannert" <aa...@clove.org>
> Sent: Thursday, October 04, 2001 11:04 AM
>
> > On Thu, Oct 04, 2001 at 11:50:27AM -0400, Rodent of Unusual Size wrote:
> > > > ServerName this.host.com       [assumes the default port 80]
> > >
> > > except that Ryan said there is no default port any more.
> >
> > There is no default Listener anymore, but if you omit the port from
> > the ServerName directive, it will default to port 80.
>
> There isn't anything that says we can't substitute
>
> Listen 0.0.0.0:80
>
> in the absense of _any_ Listen directives.  This might be more intuitive.

We could do this, but I am afraid it might lead to the same situation we
are in now.  Namely, users saying:

I just added Listen 443 to my config file, and now it stops listening to port 80.

This isn't the only required directive we have, so I don't think it hurts to
not have a default, and just require a Listen directive.

> Speaking of which, would it be good to make a seperate proxy.conf and
> (within subprojects) pop.conf, mbox.conf etc?  I mention it because proxy,
> in particular, adds alot of information to the httpd.conf that some users
> never need to review.  It seems like it would 'lighten the load'.  Of
> course, the same logic as ssl;
>
> <IfModule mod_proxy.c>
>     Include proxy.conf
> </IfModule>
>
> would be standard in httpd.conf, just as we suggest for ssl.

++1.

Ryan
______________________________________________________________
Ryan Bloom				rbb@apache.org
Covalent Technologies			rbb@covalent.net
--------------------------------------------------------------

Re: [PATCH] Remove the Port directive.

Posted by "William A. Rowe, Jr." <wr...@covalent.net>.
From: "Aaron Bannert" <aa...@clove.org>
Sent: Thursday, October 04, 2001 11:04 AM


> On Thu, Oct 04, 2001 at 11:50:27AM -0400, Rodent of Unusual Size wrote:
> > > ServerName this.host.com       [assumes the default port 80]
> > 
> > except that Ryan said there is no default port any more.
> 
> There is no default Listener anymore, but if you omit the port from
> the ServerName directive, it will default to port 80.

There isn't anything that says we can't substitute

Listen 0.0.0.0:80

in the absense of _any_ Listen directives.  This might be more intuitive.

Of course, that doesn't lessen the need for the Listen 80 in our default
config!  If we don't provide that directive, and the user adds in the ssl
or pop config, then we are in _serious_ trouble.

Speaking of which, would it be good to make a seperate proxy.conf and
(within subprojects) pop.conf, mbox.conf etc?  I mention it because proxy,
in particular, adds alot of information to the httpd.conf that some users
never need to review.  It seems like it would 'lighten the load'.  Of course,
the same logic as ssl;

<IfModule mod_proxy.c>
    Include proxy.conf
</IfModule>

would be standard in httpd.conf, just as we suggest for ssl.

Bill


Re: [PATCH] Remove the Port directive.

Posted by Aaron Bannert <aa...@clove.org>.
On Thu, Oct 04, 2001 at 11:50:27AM -0400, Rodent of Unusual Size wrote:
> > ServerName this.host.com       [assumes the default port 80]
> 
> except that Ryan said there is no default port any more.

There is no default Listener anymore, but if you omit the port from
the ServerName directive, it will default to port 80.

-aaron

Re: [PATCH] Remove the Port directive.

Posted by Cliff Woolley <cl...@yahoo.com>.
On Thu, 4 Oct 2001, Rodent of Unusual Size wrote:

> > ServerName this.host.com       [assumes the default port 80]
>
> except that Ryan said there is no default port any more.

He said there is no default _listener_.

--Cliff

--------------------------------------------------------------
   Cliff Woolley
   cliffwoolley@yahoo.com
   Charlottesville, VA



Re: [PATCH] Remove the Port directive.

Posted by Rodent of Unusual Size <Ke...@Golux.Com>.
"William A. Rowe, Jr." wrote:
> 
> Now our users have exactly _two_ directives to comprehend:
> 
> Listen controls what addresses and ports the server listens on;
> 
> ServerName defines the server's OWN name for itself, including
> it's port if it is a nonstandard assignment;

All right, got it.  

> And if you are correct, that this breaks VirtualHost, then
> we have a bug and we better fix that before Ryan's commit.

I am not sure if it breaks it or not, but having lots of
flexibility for specifying name/address/port in the <VirtualHost>
open directive bungs up the cleanliness.

Listen 80
ServerName Foo.Com
<VirtualHost OtherFoo.Com:8080>

What happens?  Presumably the vhost will never hear anything,
but will/should we detect it and report it?

Also, from your example:

> ServerName this.host.com       [assumes the default port 80]

except that Ryan said there is no default port any more.
-- 
#ken	P-)}

Ken Coar, Sanagendamgagwedweinini  http://Golux.Com/coar/
Author, developer, opinionist      http://Apache-Server.Com/

"All right everyone!  Step away from the glowing hamburger!"

Re: [PATCH] Remove the Port directive.

Posted by "William A. Rowe, Jr." <wr...@covalent.net>.
From: "Rodent of Unusual Size" <Ke...@Golux.Com>
Sent: Thursday, October 04, 2001 6:26 AM


> Ryan Bloom wrote:
> > 
> > This patch completely deprectates the Port directive.
> > The ServerName directive is now overloaded, so that
> > admins specify the port and name on the same directive.
> > It also makes Listen a required directive.
> 
> I must have missed something.  Just WTH is the motivation
> for all this?  I foresee nasty interactions with
> <VirtualHost>, among other things.

A four month long conversation on list between just about
everybody, that the BindAddress duplicated Listen, and the
Port directive was too broken for most users to understand.

Now our users have exactly _two_ directives to comprehend:

Listen controls what addresses and ports the server listens on;

Listen 80   [Listen to port 80 on all IP addresses bound to this machine]
Listen 10.0.0.10:80  [Listen to just the 10.0.0.10 IP address, port 80]

ServerName defines the server's OWN name for itself, including 
it's port if it is a nonstandard assignment;

ServerName this.host.com       [assumes the default port 80]
ServerName this.host.com:8080  [specified this server runs on port 8080]

And if you are correct, that this breaks VirtualHost, then we have a
bug and we better fix that before Ryan's commit.  But this makes the
server easier to understand.  Just WTF is a Port directive that doesn't
actually choose a port?  Since Listen overrides the Port directive, I
spend most of my time on newslists asking the user for _every_ bindaddr,
listen, port and servername, which is overkill.

Bill


Re: [PATCH] Remove the Port directive.

Posted by Rodent of Unusual Size <Ke...@Golux.Com>.
Ryan Bloom wrote:
> 
> This patch completely deprectates the Port directive.
> The ServerName directive is now overloaded, so that
> admins specify the port and name on the same directive.
> It also makes Listen a required directive.

I must have missed something.  Just WTH is the motivation
for all this?  I foresee nasty interactions with
<VirtualHost>, among other things.
-- 
#ken	P-)}

Ken Coar, Sanagendamgagwedweinini  http://Golux.Com/coar/
Author, developer, opinionist      http://Apache-Server.Com/

"All right everyone!  Step away from the glowing hamburger!"

Re: mod_rewrite.c adding X-Forwarded-For for proxy requests

Posted by Thomas Eibner <th...@stderr.net>.
On Thu, Oct 04, 2001 at 11:55:42AM -0700, Josh Goldberg wrote:
> I'm new around here, so please correct me if this is the wrong list.  I was having trouble with my weblogs only seeing my reverse proxy server as the referrer, so I integrated Bjoern Hansen's proxy_add_forward module functionality into the proxy section of mod_rewrite.  Below is diff of CVS rev. 1.172 against my module.

If it was to be put in there mod_rewrite probably wouldn't be the place
to put it (IMO). mod_proxy is where it belongs.

What are you using to get it the other way around on your backend? I made
a little module that does the opposite of mod_proxy_add_forward, it's
called mod_rpaf and you can find it on http://stderr.net/apache/rpaf/

-- 
  Thomas Eibner <http://thomas.eibner.dk/> DnsZone <http://dnszone.org/>
  mod_pointer <http://stderr.net/mod_pointer> 


mod_rewrite.c adding X-Forwarded-For for proxy requests

Posted by Josh Goldberg <jo...@4dmatrix.com>.
I'm new around here, so please correct me if this is the wrong list.  I was having trouble with my weblogs only seeing my reverse proxy server as the referrer, so I integrated Bjoern Hansen's proxy_add_forward module functionality into the proxy section of mod_rewrite.  Below is diff of CVS rev. 1.172 against my module.

1133a1134,1153
>             /* send real client headers */
>             if (oldvalue = ap_table_get(r->headers_in, "X-Forwarded-For")) {
>                 ap_table_set(r->headers_in, "X-Forwarded-For",
>                              ap_pstrcat(r->pool, oldvalue, ", ",
>                                         r->connection->remote_ip, NULL));
>             }
>             else {
>                 ap_table_set(r->headers_in, "X-Forwarded-For",
>                              r->connection->remote_ip);
>             }
> 
>             ap_table_set(r->headers_in, "X-Host",
>                          ap_table_get(r->headers_in, "Host"));
> 
>             ap_table_set(r->headers_in, "X-Server-Hostname",
>                          r->server->server_hostname);
> 
> 
> 
> 


Re: [PATCH] Remove the Port directive.

Posted by Aaron Bannert <aa...@clove.org>.
On Thu, Oct 04, 2001 at 10:33:08AM -0700, Justin Erenkrantz wrote:
> I'd *like* to see ./configure --with-port=8080 set Listen 8080 in
> httpd.conf.  I don't like seeing the default configuration requiring
> manual edits.  -- justin

That might cause more trouble for administrators than it's worth, and
for some subtle reasons. Almost all installations will require some
sort of manual intervention, which usually means editing the httpd.conf
file. When people come to depend on a build-time configuration script
to define some of these parameters, they will be less likely to know how
to do it by hand, the end result of which is more users asking for help.

I'm not directing this to you in specific, but I think it may do us well
to separate the build-time configuration from the run-time configuration.

Here's a section from the Autoconf manual titled _Configuring Site Details_:

"Some software packages require complex site-specific information. Some
examples are host names to use for certain services, company names, and
email addresses to contact. Since some configuration scripts generated
by Metaconfig ask for such information interactively, people sometimes
wonder how to get that information in Autoconf-generated configuration
scripts, which aren't interactive."

Instead of having a --with-port parameter at build-time, perhaps our default
configuration should simply have a "Listen 80" directive. If the server can't
bind to port 80, it will be very obvious to the administrator how to fix it,
and they won't try to recomple.

-aaron


Re: [PATCH] Remove the Port directive.

Posted by Rodent of Unusual Size <Ke...@Golux.Com>.
Justin Erenkrantz wrote:
> 
> I'd *like* to see ./configure --with-port=8080 set Listen 8080 in
> httpd.conf.  I don't like seeing the default configuration requiring
> manual edits.  -- justin

+1
-- 
#ken	P-)}

Ken Coar, Sanagendamgagwedweinini  http://Golux.Com/coar/
Author, developer, opinionist      http://Apache-Server.Com/

"All right everyone!  Step away from the glowing hamburger!"

Re: [PATCH] Remove the Port directive.

Posted by Justin Erenkrantz <je...@ebuilt.com>.
On Thu, Oct 04, 2001 at 11:49:11AM -0700, Ryan Bloom wrote:
> Take a look at the file as it exists today.  This change was made
> yesterday.

Ah, nevermind.  =)  -- justin


Re: [PATCH] Remove the Port directive.

Posted by Ryan Bloom <rb...@covalent.net>.
On Thursday 04 October 2001 11:43 am, Justin Erenkrantz wrote:
> On Thu, Oct 04, 2001 at 11:38:30AM -0700, Ryan Bloom wrote:
> > It should already support that.  The @@Port@@ in the httpd-std.conf
> > is what does that.
>
> Correct me if I'm wrong, but your patch has:
>
> -# Port: The port to which the standalone server listens. For
> -# ports < 1023, you will need httpd to be run as root initially.
> -#
> -Port @@Port@@
>
> What I'm suggesting is adding:
>
> Listen @@Port@@

Take a look at the file as it exists today.  This change was made
yesterday.

Ryan
______________________________________________________________
Ryan Bloom				rbb@apache.org
Covalent Technologies			rbb@covalent.net
--------------------------------------------------------------

Re: [PATCH] Remove the Port directive.

Posted by "Ian Kallen <iank@covalent.net>" <ia...@covalent.net>.
I don't vote on this craziness but I've always thought the overlap of
Port, ServerName, Listen and BindAddress was severely hideous so fwiw,
bravo for striking Port.

My original motivation for patching the old configure script to handle
--with-port was for the course I teach: I introduce students to apache by
doing the minimal precompile configuration just to get something running
out of the asf tarball.  Then, of course, I start introducing them to all
that is evil and loathsome in httpd.conf -- please, whatever you do,
continue the precompile configuration behavior of enabling a working
Apache.  IMO, the minimal bootstrap steps should continue to be
./configure --with-port=MY_ASSIGNED_PORT --prefix=$HOME/apache
make && make install
cd $HOME/apache
./bin/apachectl start

Ta-da!

On Thu, 4 Oct 2001, Aaron Bannert wrote:

> On Thu, Oct 04, 2001 at 11:43:40AM -0700, Justin Erenkrantz wrote:
> > I sort of agree with Aaron about run-time configuration options, but
> > not enough that I want to edit files manually.  =)
> 
> I don't want to have to edit them manually either, but I end up doing it
> anyway.
> 
> > This concept has always been a topic of debate between Aaron and
> > myself - we talked about this for a long time when we did flood.
> > I'd be curious to see what other people think.
> > 
> > I think build-time options can specify the defaults - they can
> > always be overriden later...  -- justin
> 
> That is the trouble with this, it is very alluring to have it all fall into
> place at "make install"-time, but it's hard to see how that can be a problem
> from our perspective.
> 
> -aaron
> 

cheers,
-Ian

--
Ian Kallen <ia...@covalent.net> | AIM: iankallen




Re: [PATCH] Remove the Port directive.

Posted by Aaron Bannert <aa...@clove.org>.
On Thu, Oct 04, 2001 at 11:43:40AM -0700, Justin Erenkrantz wrote:
> I sort of agree with Aaron about run-time configuration options, but
> not enough that I want to edit files manually.  =)

I don't want to have to edit them manually either, but I end up doing it
anyway.

> This concept has always been a topic of debate between Aaron and
> myself - we talked about this for a long time when we did flood.
> I'd be curious to see what other people think.
> 
> I think build-time options can specify the defaults - they can
> always be overriden later...  -- justin

That is the trouble with this, it is very alluring to have it all fall into
place at "make install"-time, but it's hard to see how that can be a problem
from our perspective.

-aaron

Re: [PATCH] Remove the Port directive.

Posted by Justin Erenkrantz <je...@ebuilt.com>.
On Thu, Oct 04, 2001 at 11:38:30AM -0700, Ryan Bloom wrote:
> It should already support that.  The @@Port@@ in the httpd-std.conf
> is what does that.

Correct me if I'm wrong, but your patch has:

-# Port: The port to which the standalone server listens. For
-# ports < 1023, you will need httpd to be run as root initially.
-#
-Port @@Port@@

What I'm suggesting is adding:

Listen @@Port@@

I sort of agree with Aaron about run-time configuration options, but
not enough that I want to edit files manually.  =)

This concept has always been a topic of debate between Aaron and
myself - we talked about this for a long time when we did flood.
I'd be curious to see what other people think.

I think build-time options can specify the defaults - they can
always be overriden later...  -- justin


Re: [PATCH] Remove the Port directive.

Posted by Ryan Bloom <rb...@covalent.net>.
On Thursday 04 October 2001 10:33 am, Justin Erenkrantz wrote:
> On Wed, Oct 03, 2001 at 08:24:04PM -0700, Ryan Bloom wrote:
> > This patch completely deprectates the Port directive.  The ServerName
> > directive is now overloaded, so that admins specify the port and name on
> > the same directive.  It also makes Listen a required directive.  Pay
> > attention to that.  There are no default ports with this patch.  If your
> > config doesn't have a Listen directive, the server doesn't start, and it
> > emits an error.
> >
> > I am a bit hesitant to commit this without some feedback, because it is a
> > pretty major change.  Before I commit this, I will update all of the
> > docs.
> >
> > Thoughts?
>
> I'd *like* to see ./configure --with-port=8080 set Listen 8080 in
> httpd.conf.  I don't like seeing the default configuration requiring
> manual edits.  -- justin

It should already support that.  The @@Port@@ in the httpd-std.conf
is what does that.

Ryan

______________________________________________________________
Ryan Bloom				rbb@apache.org
Covalent Technologies			rbb@covalent.net
--------------------------------------------------------------

Re: [PATCH] Remove the Port directive.

Posted by Justin Erenkrantz <je...@ebuilt.com>.
On Wed, Oct 03, 2001 at 08:24:04PM -0700, Ryan Bloom wrote:
> 
> This patch completely deprectates the Port directive.  The ServerName
> directive is now overloaded, so that admins specify the port and name on
> the same directive.  It also makes Listen a required directive.  Pay attention
> to that.  There are no default ports with this patch.  If your config doesn't have
> a Listen directive, the server doesn't start, and it emits an error.
> 
> I am a bit hesitant to commit this without some feedback, because it is a pretty
> major change.  Before I commit this, I will update all of the docs.
> 
> Thoughts?

I'd *like* to see ./configure --with-port=8080 set Listen 8080 in
httpd.conf.  I don't like seeing the default configuration requiring
manual edits.  -- justin


Re: [PATCH] Remove the Port directive.

Posted by "William A. Rowe, Jr." <wr...@covalent.net>.
From: "Ryan Bloom" <rb...@covalent.net>
Sent: Wednesday, October 03, 2001 10:24 PM


> 
> This patch completely deprectates the Port directive.  The ServerName
> directive is now overloaded, so that admins specify the port and name on
> the same directive.  It also makes Listen a required directive.  Pay attention
> to that.  There are no default ports with this patch.  If your config doesn't have
> a Listen directive, the server doesn't start, and it emits an error.
> 
> I am a bit hesitant to commit this without some feedback, because it is a pretty
> major change.  Before I commit this, I will update all of the docs.

++1, that's the way :)

> Thoughts?

We've already killed BindAddress, no?  If not, we need to :) 


Re: [PATCH] Remove the Port directive.

Posted by Aaron Bannert <aa...@clove.org>.
On Thu, Oct 04, 2001 at 06:36:18AM -0700, Ryan Bloom wrote:
> On Wednesday 03 October 2001 08:36 pm, Aaron Bannert wrote:
> > On Wed, Oct 03, 2001 at 08:35:04PM -0700, Ryan Bloom wrote:
> > > The thing that concerns me the most, is that there is no default Port. 
> > > If people can accept that change, then I think this is the right way to
> > > go.
> >
> > I think you meant there is no default listener.
> >
> > So what happens with this patch if you don't specify a listener?
> 
> As I said in the original message, it doesn't start the server, and an error
> is written to the error log.

Missed that.

BTW, I am ++1 on this (FWIW). It clears up a longstanding point of confusion.

-aaron

Re: [PATCH] Remove the Port directive.

Posted by Ryan Bloom <rb...@covalent.net>.
On Wednesday 03 October 2001 08:36 pm, Aaron Bannert wrote:
> On Wed, Oct 03, 2001 at 08:35:04PM -0700, Ryan Bloom wrote:
> > The thing that concerns me the most, is that there is no default Port. 
> > If people can accept that change, then I think this is the right way to
> > go.
>
> I think you meant there is no default listener.
>
> So what happens with this patch if you don't specify a listener?

As I said in the original message, it doesn't start the server, and an error
is written to the error log.

Ryan
______________________________________________________________
Ryan Bloom				rbb@apache.org
Covalent Technologies			rbb@covalent.net
--------------------------------------------------------------

Re: [PATCH] Remove the Port directive.

Posted by Aaron Bannert <aa...@clove.org>.
On Wed, Oct 03, 2001 at 08:35:04PM -0700, Ryan Bloom wrote:
> The thing that concerns me the most, is that there is no default Port.  If people
> can accept that change, then I think this is the right way to go.

I think you meant there is no default listener.

So what happens with this patch if you don't specify a listener?

-aaron

Re: [PATCH] Remove the Port directive.

Posted by Ryan Bloom <rb...@covalent.net>.
On Wednesday 03 October 2001 08:27 pm, Cliff Woolley wrote:
> On Wed, 3 Oct 2001, Ryan Bloom wrote:
> > This patch completely deprectates the Port directive.  The ServerName
> > directive is now overloaded, so that admins specify the port and name
> > on the same directive.  It also makes Listen a required directive.
> > Pay attention to that.  There are no default ports with this patch.
> > If your config doesn't have a Listen directive, the server doesn't
> > start, and it emits an error.
>
> +1.  Port vs. Listen has always been one of the things people just can't
> seem to figure out no matter how carefully we try to explain it.  Doing it
> through ServerName makes it much more clear what's going on.

The thing that concerns me the most, is that there is no default Port.  If people
can accept that change, then I think this is the right way to go.

Ryan

______________________________________________________________
Ryan Bloom				rbb@apache.org
Covalent Technologies			rbb@covalent.net
--------------------------------------------------------------

Re: [PATCH] Remove the Port directive.

Posted by Ryan Bloom <rb...@covalent.net>.
On Thursday 04 October 2001 04:30 am, Rodent of Unusual Size wrote:
> Cliff Woolley wrote:
> > +1.  Port vs. Listen has always been one of the things
> > people just can't seem to figure out no matter how
> > carefully we try to explain it.  Doing it through
> > ServerName makes it much more clear what's going on.
>
> Due to the non-1:1 relationship between names and
> addresses, and that ports should be associated with
> IP addresses rather than names, I feel uncomfortable
> with the blanket statement above.

But Port hasn't been about selecting a port to listen to for a long time.
That is what Listen was for.  The only reason to have Port (in any situation
where you had multiple ports to listen to), was to have a way to tell the
server what port to report.

This removes the problem of having users put a Port directive in their config,
and two listen directives, and then wonder why the server was only listening
on two ports.  I have received three bug reports about this, this month alone.

Ryan

______________________________________________________________
Ryan Bloom				rbb@apache.org
Covalent Technologies			rbb@covalent.net
--------------------------------------------------------------

Re: [PATCH] Remove the Port directive.

Posted by Rodent of Unusual Size <Ke...@Golux.Com>.
Cliff Woolley wrote:
> 
> +1.  Port vs. Listen has always been one of the things
> people just can't seem to figure out no matter how
> carefully we try to explain it.  Doing it through
> ServerName makes it much more clear what's going on.

Due to the non-1:1 relationship between names and
addresses, and that ports should be associated with
IP addresses rather than names, I feel uncomfortable
with the blanket statement above.
-- 
#ken	P-)}

Ken Coar, Sanagendamgagwedweinini  http://Golux.Com/coar/
Author, developer, opinionist      http://Apache-Server.Com/

"All right everyone!  Step away from the glowing hamburger!"

Re: [PATCH] Remove the Port directive.

Posted by Cliff Woolley <cl...@yahoo.com>.
On Wed, 3 Oct 2001, Ryan Bloom wrote:

> This patch completely deprectates the Port directive.  The ServerName
> directive is now overloaded, so that admins specify the port and name
> on the same directive.  It also makes Listen a required directive.
> Pay attention to that.  There are no default ports with this patch.
> If your config doesn't have a Listen directive, the server doesn't
> start, and it emits an error.

+1.  Port vs. Listen has always been one of the things people just can't
seem to figure out no matter how carefully we try to explain it.  Doing it
through ServerName makes it much more clear what's going on.

--Cliff

--------------------------------------------------------------
   Cliff Woolley
   cliffwoolley@yahoo.com
   Charlottesville, VA