httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <>
Subject Re: Hard coded HTTPD_ROOT in httpd.h...
Date Thu, 13 Sep 2001 16:26:39 GMT
From: "Brad Nicholes" <>
Sent: Thursday, September 13, 2001 10:08 AM

>   Thank you for the feedback but I am still concerned about how 
> this is going to work on NetWare.  Here are the reasons why:
> 1) NetWare like Win32 and OS2, does not have a configure utility 
> therefore config.layout will do us no good at all.  In fact 99% 
> of the compile time configuration is meaningless to us mostly due 
> to the next reason.

That's correct.  Those binaries users get no benefit from config.layout.
This really isn't up for debate on non-unix platforms, but it would
probably benefit binaries users on unix platforms as well.  [Snipped #2,
there's no argument that Win32/Netware users use binaries.]

> 3) Bill suggested that we look at the Win32 hooks.  I'm not quite sure what
> you mean by that.  Unless they are some type of Apache hook, it won't do us
> any good either.  NetWare does not have a hooking mechanism that will allow
> us to alter something like HTTP_ROOT at run-time.  When the Apache binary
> is envoked, the first thing we hit is main().  According to the code,
> def_server_root is initialized to HTTPD_ROOT and unless there is a -f or -d
> parameter specified, a hard coded path will be used and we will fail.

When I say hooks, I mean the Apache hooks in mpm_winnt.c.  We already have the
code that bases the serverroot not on the cwd (was like that once but it doesn't
work out that well) but the path of the httpd binary.  We also grab and handle
the -k flag, which unix doesn't.

MPM's are given first crack at the command line args, so they can eat what they
like and let the rest fall into the http_main.c code on Apache 2.0.

There is some talk of moving the win32 -k options into the core, so all platforms 
could start/stop/restart/graceful their server (depending on the mpm.)

> The only possible workaround that I can see at the moment is #define'ing 
> HTTP_ROOT as getcwd() which will at least get us in the ball park.  I would 
> greatly appreciate any other suggestions from those who know this code much 
> better than I do (which could be just about anybody :)  )

Rather than cwd, I strongly suggest the argv[0] path, which isn't as volatile.
We have a 'get processes' executable name' call that returns the full path on
win32 (rather than argv[0], which might simply be 'httpd'.)

View raw message