You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Marc Slemko <ma...@znep.com> on 1998/03/29 03:24:58 UTC

http_paths.h

This adds a new command line option to dump out the 
current "significant" defines in a way that can be written directly
to a .h file to be included in a build of a new version of Apache.

The idea is that the user should be able to take their old binary,
run "httpd -p > foo.../apache-foo/src/include/http_paths.h" and
make a new binary without having to edit any defines.

This is also a place where people making third party distributions
can put all the defines they need to change paths, etc. without
having to edit httpd.h at all.  http_paths.h will be included in
httpd.h before any of the other definitions and will be empty (well,
just a comment saying what it is) by default.

This is a win for users upgrading because they no longer have
hell trying to make the paths on both versions agree.  The idea is
that httpd.h can change, but in most cases it won't matter if things
are added since the new defaults should be fine and the http_paths.h
that comes with a distribution can always be overwritten without
loss of information.

Comments?  Technically, only a very few of these have to be modified
at compile time and the rest are just defaults that can be changed
later, but many distributions really like changing them in httpd.h
or with command line defines.  I haven't yet decided if that is
ok, or if we should strongly recommend they only change the absolute
minimum number of defines.

(yes, the patch needs cleaning up, but the concept...)

After this, I would also like another command line option that 
goes through read_config, then dumps out a variety of important
server configuration information that is desirable for third
party programs to know to be able to put things in the right place.


Index: http_main.c
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
retrieving revision 1.315
diff -u -r1.315 http_main.c
--- http_main.c	1998/03/27 20:18:50	1.315
+++ http_main.c	1998/03/29 01:20:07
@@ -3949,9 +3949,9 @@
     setup_prelinked_modules();
 
 #ifdef DEBUG_SIGSTOP
-    while ((c = getopt(argc, argv, "C:c:Xd:f:vVhlZ:")) != -1) {
+    while ((c = getopt(argc, argv, "C:c:Xd:f:vVhlZ:p")) != -1) {
 #else
-    while ((c = getopt(argc, argv, "C:c:Xd:f:vVhl")) != -1) {
+    while ((c = getopt(argc, argv, "C:c:Xd:f:vVhlp")) != -1) {
 #endif
 	char **new;
 	switch (c) {
@@ -3981,6 +3981,35 @@
 	    exit(0);
 	case 'l':
 	    show_modules();
+	    exit(0);
+	case 'p':
+	    printf("
+/*
+ * http_paths.h: save as src/include/http_paths.h in an Apache 1.3
+ * or later distribution to preserve the compile-time paths being used 
+ * by your current server.
+ *
+ * Autogenerated by %s, built %s.
+ */
+
+", apapi_get_server_version(), apapi_get_server_built());
+#define dump_path_str(x) printf("#define " #x " \"%s\"\n", x);
+	    dump_path_str(HTTPD_ROOT);
+	    dump_path_str(DOCUMENT_LOCATION);
+	    dump_path_str(DEFAULT_USER);
+	    dump_path_str(DEFAULT_GROUP);
+	    dump_path_str(DEFAULT_XFERLOG);
+	    dump_path_str(DEFAULT_ERRORLOG);
+	    dump_path_str(DEFAULT_PIDLOG);
+	    dump_path_str(DEFAULT_SCOREBOARD);
+	    dump_path_str(DEFAULT_LOCKFILE);
+	    dump_path_str(SERVER_CONFIG_FILE);
+	    dump_path_str(RESOURCE_CONFIG_FILE);
+	    dump_path_str(TYPES_CONFIG_FILE);
+	    dump_path_str(ACCESS_CONFIG_FILE);
+	    dump_path_str(DEFAULT_USER_DIR);
+	    dump_path_str(DEFAULT_PATH);
+	    dump_path_str(SUEXEC_BIN);
 	    exit(0);
 	case 'X':
 	    ++one_process;	/* Weird debugging mode. */


Re: http_paths.h

Posted by Martin Kraemer <Ma...@mch.sni.de>.
On Sat, Mar 28, 1998 at 06:24:58PM -0700, Marc Slemko wrote:
> This adds a new command line option to dump out the 
> current "significant" defines in a way that can be written directly
> to a .h file to be included in a build of a new version of Apache.

I like the idea. Kind of a "bootstrap mode" when you have an older apache
(where the "older" era is starting: now) and want to upgrade.

+1
    Martin
-- 
| S I E M E N S |  <Ma...@mch.sni.de>  |      Siemens Nixdorf
| ------------- |   Voice: +49-89-636-46021     |  Informationssysteme AG
| N I X D O R F |   FAX:   +49-89-636-44994     |   81730 Munich, Germany
~~~~~~~~~~~~~~~~My opinions only, of course; pgp key available on request

Re: http_paths.h

Posted by Marc Slemko <ma...@worldgate.com>.
On Sun, 29 Mar 1998, Dean Gaudet wrote:

> 
> 
> On Sat, 28 Mar 1998, Marc Slemko wrote:
> 
> > This adds a new command line option to dump out the 
> > current "significant" defines in a way that can be written directly
> > to a .h file to be included in a build of a new version of Apache.
> 
> Cool.  It would be so rad if this also picked up "optional" settings like
> BUFFERED_LOGS and such too. 

Mmm.  While the completely optional settings that are never automatically
enabled should go in, how far do you go?  What about settings that can be
set automatically on some platforms (in which case you don't want to
include them, because that introduces bad legacies if things have to
change), but can also be set manually, like USE_MMAP_FILES? 

> 
> > (yes, the patch needs cleaning up, but the concept...)
> 
> I don't see what needs cleaning up. Other than the fact that you've got to
> duplicate this in the win32 section of code which has its own command line
> parsing. 

Exactly; the code should be pulled out into its own subroutine.

> 
> > After this, I would also like another command line option that 
> > goes through read_config, then dumps out a variety of important
> > server configuration information that is desirable for third
> > party programs to know to be able to put things in the right place.
> 
> Very useful. 

My long term goal, of course, is to get this support in so that it can be
used in a smarter way in the future, eg. apache-toys collection of things
needs to be able to figure out the runtime configs, a more easily
automated upgrade procedure (with -v and -l), etc.


Re: http_paths.h

Posted by Dean Gaudet <dg...@arctic.org>.

On Sat, 28 Mar 1998, Marc Slemko wrote:

> This adds a new command line option to dump out the 
> current "significant" defines in a way that can be written directly
> to a .h file to be included in a build of a new version of Apache.

Cool.  It would be so rad if this also picked up "optional" settings like
BUFFERED_LOGS and such too. 

> (yes, the patch needs cleaning up, but the concept...)

I don't see what needs cleaning up. Other than the fact that you've got to
duplicate this in the win32 section of code which has its own command line
parsing. 

> After this, I would also like another command line option that 
> goes through read_config, then dumps out a variety of important
> server configuration information that is desirable for third
> party programs to know to be able to put things in the right place.

Very useful. 

Dean