You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by di...@covalent.net on 2002/07/10 16:36:52 UTC

Port 80 vs 8080 when not SU.

In apache 1.3 we had this little trick:

    if [ "x`$aux/getuid.sh`" != "x0" -a "x$port" = "x" ]; then
        conf_port="8080"
    fi

to make the port 8080 when the user is not root - thus to reduce the
number of 'apache wont start' newby errors and be generally convenient for
the masses (and disorganized people like me).

Has that been dropped from 2.0 for a reason or by accident ?

Dw.

-- 
Dirk-Willem van Gulik


Re: Port 80 vs 8080 when not SU.

Posted by Jacek Prucia <ja...@7bulls.com>.
On Wed, 10 Jul 2002 08:29:06 -0700 (PDT)
Joshua Slive <jo...@slive.ca> wrote:

> On Wed, 10 Jul 2002, Lars Eilebrecht wrote:
> 
> > According to Ravindra Jaju:
> >
> > > How about an extra echo:
> > >
> > > if [ "x`$aux/getuid.sh`" != "x0" -a "x$port" = "x" ]; then
> > > 	conf_port="8080"
> > > 	echo "Non-root process. Server will run on port $conf_port"
> > > fi
> >
> > +1
> >
> 
> I don't see how that helps.

As Dirk pointed out, that trick was *default* with Apache 1.3.x. I
personally (and I bet a lot of people out there) simply got used to this
behaviour, and it's a little bit confusing, that new build system acts
differently. That "newbie vs. guru" problem IMO schould not be
considered a valid reason to review this change. I'm with Dirk here
(that is: his oryginal patch, without that echo above).

Since we are talking about build system, let me bring something else up.
Old APACI configure at the end of 'make install' was echoing an ASCII
table with some information (install ok, conf file here, apachectl
there, etc.). This also vanished from 2.0.x build system, but remains in
binary releases. Even if I don't need that personally -- this is another
thing that it is a little bit confusing. After all, adding a no-deps
target that echoes some ASCII stuff can't be thaht hard with
autoconf/automake?

my $cents = 2;

regards,
-- 
Jacek Prucia
7bulls.com S.A.

RE: Port 80 vs 8080 when not SU.

Posted by Sander Striker <st...@apache.org>.
> From: Ryan Bloom [mailto:rbb@covalent.net]
> Sent: 10 July 2002 17:20

>> From: Lars Eilebrecht [mailto:lars@hyperreal.org]
>> 
>> According to Ravindra Jaju:
>> 
>>> How about an extra echo:
>>>
>>> if [ "x`$aux/getuid.sh`" != "x0" -a "x$port" = "x" ]; then
>>> 	conf_port="8080"
>>> 	echo "Non-root process. Server will run on port $conf_port"
>>> fi
>> 
>> +1
> 
> The problem with this, is that it gets lost in the noise of autoconf.
> Whenever we try to put informative messages like this in the configure
> output, nobody seems it.

Also, I don't want us to outsmart users.  If you want to run on port
80, configure port 80, if you want to run on 8080, configure 8080.
Nothing wrong with that little effort.

-1 on going back to behaviour that in the end will confuse users
(and us) more than it helps.

Sander


RE: Port 80 vs 8080 when not SU.

Posted by Ryan Bloom <rb...@covalent.net>.
> From: Lars Eilebrecht [mailto:lars@hyperreal.org]
> 
> According to Ravindra Jaju:
> 
> > How about an extra echo:
> >
> > if [ "x`$aux/getuid.sh`" != "x0" -a "x$port" = "x" ]; then
> > 	conf_port="8080"
> > 	echo "Non-root process. Server will run on port $conf_port"
> > fi
> 
> +1

The problem with this, is that it gets lost in the noise of autoconf.
Whenever we try to put informative messages like this in the configure
output, nobody seems it.

Ryan



Re: Port 80 vs 8080 when not SU.

Posted by Joshua Slive <jo...@slive.ca>.
On Wed, 10 Jul 2002, Lars Eilebrecht wrote:

> According to Ravindra Jaju:
>
> > How about an extra echo:
> >
> > if [ "x`$aux/getuid.sh`" != "x0" -a "x$port" = "x" ]; then
> > 	conf_port="8080"
> > 	echo "Non-root process. Server will run on port $conf_port"
> > fi
>
> +1
>

I don't see how that helps.  Newbie users are either going to miss this
entirely as it scrolls by, or are not going to understand the
implications.  (I know a fair bit about apache configuration, and I
wouldn't really be able to parse that if it flew by with no context.)

I'm not sure what the whole hack is trying to solve.  As I said, it seems
to make things more difficult both for newbies and for experienced users.

Joshua.


Re: Port 80 vs 8080 when not SU.

Posted by Lars Eilebrecht <la...@hyperreal.org>.
According to Ravindra Jaju:

> How about an extra echo:
> 
> if [ "x`$aux/getuid.sh`" != "x0" -a "x$port" = "x" ]; then
> 	conf_port="8080"
> 	echo "Non-root process. Server will run on port $conf_port"
> fi

+1

ciao...
-- 
Lars Eilebrecht
lars@hyperreal.org

Re: Port 80 vs 8080 when not SU.

Posted by Thom May <th...@planetarytramp.net>.
* Jim Jagielski (jim@jaguNET.com) wrote :
> Ryan Bloom wrote:
> > 
> > We have fixed our installation step to preserve existing config files,
> > so if you compile as a non-root user, and install over the top of an
> > existing installation, your port won't change.
> > 
> > This only has to do with how the server is configured the FIRST time the
> > server is installed.
> > 
> 
> Which is the case with 1.3 as well, BTW.

It doesn't matter how many times it happens, or how many hysterical raisins
there are, it's still wrong behaviour.
We can't change options under someone just because their compilation
environment doesn't match our expectations. 
As Joshua says, this catches a lot of people out. We should put a warning in
the INSTALL file to point out you have to have root privs to attach to port
80, but we should not be changing anything that is runtime configurable 
unless the user explicitly asks for it.
Cheers,
-Thom
-- 
Thom May -> thom@planetarytramp.net

> Personally, I quite like the little pictures they display when things are
> scanned.  Just so you know what a zucchini looks like before you go
> throwing your money away on one.
"Oh shit! Is that zucchini? It said OREOS on the shelf!"

RE: Port 80 vs 8080 when not SU.

Posted by Sander Striker <st...@apache.org>.
> From: Ryan Bloom [mailto:rbb@covalent.net]
> Sent: 10 July 2002 21:24

>> From: Justin Erenkrantz [mailto:jerenkrantz@apache.org]
>> On Wed, Jul 10, 2002 at 03:12:07PM -0400, Jim Jagielski wrote:
>>> Have there been any complaints about how 1.3 has been doing it for
>>> ages? A 'make install; <foo>/bin/apachectl start' no matter who does
>>> the building has "always" resulted in at least a somewhat functional
>>> server. I don't see the reason for stopping a traditional behavior
>>> (and a possible expectation from the community) without more
>>> compelling reasons.
>> 
>> On the contrary, I don't believe we have an obligation to follow
>> 1.3 here.  I think what we are doing for 2.0 makes the most sense.
>> 
>> The default is the default.  Please don't muddle things based on
>> who is compiling it.  -- Justin
> 
> While I agree that changing the port based on the user who is compiling
> the server is a bit backwards, the argument about how things are done on
> Nagoya is handwaving IMNSHO.

*grin* I've got my hands on the keyboard now.
 
> We have fixed our installation step to preserve existing config files,
> so if you compile as a non-root user, and install over the top of an
> existing installation, your port won't change.
> 
> This only has to do with how the server is configured the FIRST time the
> server is installed.

*curses to self*.  Okay, in that case let's say I just don't like us messing
with the defaults based on the user doing the compiling.

> Ryan

Sander


RE: Port 80 vs 8080 when not SU.

Posted by Ryan Bloom <rb...@covalent.net>.
> From: Justin Erenkrantz [mailto:jerenkrantz@apache.org]
> 
> On Wed, Jul 10, 2002 at 03:12:07PM -0400, Jim Jagielski wrote:
> > Have there been any complaints about how 1.3 has been doing it for
> > ages? A 'make install; <foo>/bin/apachectl start' no matter who does
> > the building has "always" resulted in at least a somewhat functional
> > server. I don't see the reason for stopping a traditional behavior
> > (and a possible expectation from the community) without more
> > compelling reasons.
> 
> On the contrary, I don't believe we have an obligation to follow
> 1.3 here.  I think what we are doing for 2.0 makes the most sense.
> 
> The default is the default.  Please don't muddle things based on
> who is compiling it.  -- Justin

While I agree that changing the port based on the user who is compiling
the server is a bit backwards, the argument about how things are done on
Nagoya is handwaving IMNSHO.

We have fixed our installation step to preserve existing config files,
so if you compile as a non-root user, and install over the top of an
existing installation, your port won't change.

This only has to do with how the server is configured the FIRST time the
server is installed.

Ryan



Re: Port 80 vs 8080 when not SU.

Posted by Justin Erenkrantz <je...@apache.org>.
On Wed, Jul 10, 2002 at 03:12:07PM -0400, Jim Jagielski wrote:
> Have there been any complaints about how 1.3 has been doing it for
> ages? A 'make install; <foo>/bin/apachectl start' no matter who does
> the building has "always" resulted in at least a somewhat functional
> server. I don't see the reason for stopping a traditional behavior
> (and a possible expectation from the community) without more
> compelling reasons.

On the contrary, I don't believe we have an obligation to follow
1.3 here.  I think what we are doing for 2.0 makes the most sense.

The default is the default.  Please don't muddle things based on
who is compiling it.  -- justin

RE: Port 80 vs 8080 when not SU.

Posted by Sander Striker <st...@apache.org>.
> From: Thom May [mailto:thom@planetarytramp.net]
> Sent: 10 July 2002 18:04

> * Jim Jagielski (jim@jaguNET.com) wrote :
> > Thom May wrote:

> Please don't do this. We should_not_ be second guessing the user.
>
> > I'd prefer education but also that they get a configuration that they
> > can test "right after" a build/install :)
> >
> How do you know they are not doing what I do:
> configure; build and install as thom
> run as root.

Exactly.  Actually, this is how we are setup on nagoya.  All admins are
in the same group and configure/compile/install using their own account.

> There is a perfectly good configure option to change the port, if they want
> the port changed the user should use that.
> A config system should not alter configs away from the default unless the
> user specifically requests it.
> If we do this I'm sure we'll see an awful lot of PRs cropping up of the
> form:
> "started apache but it is not listening on http://localhost/"
>
> This is a non-commiter's -1, then.

Sander


Re: Port 80 vs 8080 when not SU.

Posted by Thom May <th...@planetarytramp.net>.
* Jim Jagielski (jim@jaguNET.com) wrote :
> Thom May wrote:
> > 
> > > How about an extra echo:
> > > 
> > > if [ "x`$aux/getuid.sh`" != "x0" -a "x$port" = "x" ]; then
> > > 	conf_port="8080"
> > > 	echo "Non-root process. Server will run on port $conf_port"
> > > fi
> > 
> > I think the best solution is to educate the user, rather than to do
> > something unexpected.
> > if [ "x`$aux/getuid.sh`" != "x0" -a "x$port" = "x" ]; then
> >         echo "You are not currently the superuser. Therefore we can't start
> >         apache listening on a privileged port (One above 1024)"
> > fi
> > 
> 
> Add to that the "Server will run..." message and the setting to port 8080
> and +1 :)
> 
Please don't do this. We should_not_ be second guessing the user.

> I'd prefer education but also that they get a configuration that they
> can test "right after" a build/install :)
>
How do you know they are not doing what I do:
configure; build and install as thom
run as root.

There is a perfectly good configure option to change the port, if they want
the port changed the user should use that. 
A config system should not alter configs away from the default unless the
user specifically requests it.
If we do this I'm sure we'll see an awful lot of PRs cropping up of the
form:
"started apache but it is not listening on http://localhost/"

This is a non-commiter's -1, then.

Cheers
-Thom

-- 
Thom May -> thom@planetarytramp.net

"Historically speaking, the presences of wheels in Unix
 has never precluded their reinvention." - Larry Wall

Re: Port 80 vs 8080 when not SU.

Posted by Thom May <th...@planetarytramp.net>.
* Ravindra Jaju (jaju@it.iitb.ac.in) wrote :
> On Wed, Jul 10, 2002 at 07:49:25AM -0700, Joshua Slive wrote:
> > On Wed, 10 Jul 2002 dirkx@covalent.net wrote:
> > > In apache 1.3 we had this little trick:
> > >
> > >     if [ "x`$aux/getuid.sh`" != "x0" -a "x$port" = "x" ]; then
> > >         conf_port="8080"
> > >     fi
> > >
> > > to make the port 8080 when the user is not root - thus to reduce the
> > > number of 'apache wont start' newby errors and be generally convenient for
> > > the masses (and disorganized people like me).
> > >
> > > Has that been dropped from 2.0 for a reason or by accident ?
> > 
> > In my opinion, that was never a good idea.  The newbie users are simply
> > confused by this, because they have a server which starts up but can't be
> > accessed at http://localhost/.  And people who do very sensible things
> > like build/install as non-root and then startup as root must go through an
> > extra step to fix this change.
> 
> How about an extra echo:
> 
> if [ "x`$aux/getuid.sh`" != "x0" -a "x$port" = "x" ]; then
> 	conf_port="8080"
> 	echo "Non-root process. Server will run on port $conf_port"
> fi

I think the best solution is to educate the user, rather than to do
something unexpected.
if [ "x`$aux/getuid.sh`" != "x0" -a "x$port" = "x" ]; then
        echo "You are not currently the superuser. Therefore we can't start
        apache listening on a privileged port (One above 1024)"
fi

(Line wrapped by mail client, obv this snippet would break)

This also (I guess) presupposes that the admin is trying to start a server
on a priv port. If they're not, then they're gonna be even more pissed if we
change unpriv ports at random on them.
Cheers,
-Thom

-- 
Thom May -> thom@planetarytramp.net

Step forward MP3.com founder Michael Robertson, a man with a talent for
soundbites: "All I know is that I'm being sued for unfair business 
practices by Microsoft. Hello pot? It's kettle on line two," he told Reuters.

Re: Port 80 vs 8080 when not SU.

Posted by Ravindra Jaju <ja...@it.iitb.ac.in>.
On Wed, Jul 10, 2002 at 07:49:25AM -0700, Joshua Slive wrote:
> On Wed, 10 Jul 2002 dirkx@covalent.net wrote:
> > In apache 1.3 we had this little trick:
> >
> >     if [ "x`$aux/getuid.sh`" != "x0" -a "x$port" = "x" ]; then
> >         conf_port="8080"
> >     fi
> >
> > to make the port 8080 when the user is not root - thus to reduce the
> > number of 'apache wont start' newby errors and be generally convenient for
> > the masses (and disorganized people like me).
> >
> > Has that been dropped from 2.0 for a reason or by accident ?
> 
> In my opinion, that was never a good idea.  The newbie users are simply
> confused by this, because they have a server which starts up but can't be
> accessed at http://localhost/.  And people who do very sensible things
> like build/install as non-root and then startup as root must go through an
> extra step to fix this change.

How about an extra echo:

if [ "x`$aux/getuid.sh`" != "x0" -a "x$port" = "x" ]; then
	conf_port="8080"
	echo "Non-root process. Server will run on port $conf_port"
fi

?

regards,
jaju


Re: Port 80 vs 8080 when not SU.

Posted by Rodent of Unusual Size <Ke...@Golux.Com>.
Joshua Slive wrote:
> 
> And people who do very sensible things like build/install as
> non-root and then startup as root must go through an extra
> step to fix this change.

Bah, they should use ./configure --with-port=80 (or whatever
the 2.0 version of that 1.3ism is).

:-)
-- 
#ken	P-)}

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

"Millennium hand and shrimp!"

Re: Port 80 vs 8080 when not SU.

Posted by Joshua Slive <jo...@slive.ca>.
On Wed, 10 Jul 2002 dirkx@covalent.net wrote:
> In apache 1.3 we had this little trick:
>
>     if [ "x`$aux/getuid.sh`" != "x0" -a "x$port" = "x" ]; then
>         conf_port="8080"
>     fi
>
> to make the port 8080 when the user is not root - thus to reduce the
> number of 'apache wont start' newby errors and be generally convenient for
> the masses (and disorganized people like me).
>
> Has that been dropped from 2.0 for a reason or by accident ?

In my opinion, that was never a good idea.  The newbie users are simply
confused by this, because they have a server which starts up but can't be
accessed at http://localhost/.  And people who do very sensible things
like build/install as non-root and then startup as root must go through an
extra step to fix this change.

Joshua.