Re: [HEAD] --with-mpm=worker under FreeBSD 4.5 does nothing?

2002-01-24 Thread Aaron Bannert

On Thu, Jan 24, 2002 at 09:19:45AM -0400, Marc G. Fournier wrote:
> On Wed, 23 Jan 2002, Aaron Bannert wrote:
> 
> > > Now, does apache2 *require* shared memory, or can I set all of the above
> > > to zero, and it will work around the limitation?

Setting them all to zero will fail on Unix.

> > If you wish to run apache with multiple processes, then shared memory
> > is necessary.
> 
> How did Apache1 deal with this?  It ran multiple processes, but had no
> shared memory requirement ...

I'm sorry, I should have been more clear. By "shared memory" I also
included things like mmap()ing a common file, which from my perspective
is just another type of shared memory. Those types are:

APR_USE_SHMEM_MMAP_TMP  (file-based)
APR_USE_SHMEM_MMAP_SHM  (file-based)
APR_USE_SHMEM_MMAP_ZERO (anonymous)
APR_USE_SHMEM_MMAP_ANON (anonymous)

The SYSV types that you have disabled in your chroot jail are probably these
two:

APR_USE_SHMEM_SHMGET_ANON
APR_USE_SHMEM_SHMGET

-aaron



Re: [HEAD] --with-mpm=worker under FreeBSD 4.5 does nothing?

2002-01-24 Thread Marc G. Fournier

On Wed, 23 Jan 2002, Aaron Bannert wrote:

> > Now, does apache2 *require* shared memory, or can I set all of the above
> > to zero, and it will work around the limitation?
>
> If you wish to run apache with multiple processes, then shared memory
> is necessary.

How did Apache1 deal with this?  It ran multiple processes, but had no
shared memory requirement ...





Re: [HEAD] --with-mpm=worker under FreeBSD 4.5 does nothing?

2002-01-23 Thread Aaron Bannert

On Sat, Jan 12, 2002 at 09:09:02PM -0400, Marc G. Fournier wrote:
> On Fri, 11 Jan 2002, Aaron Bannert wrote:
...
> > If you are getting "Not implemented on this platform" errors, then
> > something funny is going on -- that only happens in the scoreboard if
> > you don't have any anonymous shmem implementations, which according to
> > your HAVE_SHMEM defines above is not true (you have every shmem type
> > known to APR on your system).
> 
> Okay, this makes sense then, as use of shared memory in a jail environment
> is not currently enabled by default, and is not recommended:
> 
>  jail.sysvipc_allowed
>   This MIB entry determines whether or not processes within a jail
>   have access to System V IPC primitives.  In the current jail imple-
>   mentation, System V primitives share a single namespace across the
>   host and jail environments, meaning that processes within a jail
>   would be able to communicate with (and potentially interfere with)
>   processes outside of the jail, and in other jails.  As such, this
>   functionality is disabled by default, but can be enabled by setting
>   this MIB entry to 1.
> 
> Now, does apache2 *require* shared memory, or can I set all of the above
> to zero, and it will work around the limitation?

If you wish to run apache with multiple processes, then shared memory
is necessary.

Sorry for the late reply, I must have missed this one.

-aaron



Re: [HEAD] --with-mpm=worker under FreeBSD 4.5 does nothing?

2002-01-12 Thread Marc G. Fournier

On Fri, 11 Jan 2002, Aaron Bannert wrote:

> On Fri, Jan 11, 2002 at 01:32:35PM -0400, Marc G. Fournier wrote:
> > On Fri, 11 Jan 2002, Aaron Bannert wrote:
> >
> > > On Fri, Jan 11, 2002 at 10:27:18AM -0400, Marc G. Fournier wrote:
> > > ...
> > > > [Fri Jan 11 14:20:19 2002] [crit] (78)Function not implemented: Fatal error: 
>could not open(create) scoreboard
> > > ...
> > >
> > > > Even if I comment out the 'ScoreBoard' line in httpd.conf, it
> > > > gives the 'Function not implemented' error ...
> > > >
> > > > Known problem?  If not, suggestions on how to debug and provide
> > > > something just a wee bit more useful?  I'm not finding any core files
> > > > laying about, so nothing I can gdb ...
> > > ...
> > >
> > > send in the output of `grep SHM srclib/apr/include/apr.h` so we can find
> > > out what shared memory subsystems are available on your platform.
> >
> > jail# grep SHM srclib/apr/include/apr.h
> > #define APR_HAVE_SHMEM_MMAP_TMP 1
> > #define APR_HAVE_SHMEM_MMAP_SHM 1
> > #define APR_HAVE_SHMEM_MMAP_ZERO1
> > #define APR_HAVE_SHMEM_SHMGET_ANON  1
> > #define APR_HAVE_SHMEM_SHMGET   1
> > #define APR_HAVE_SHMEM_MMAP_ANON1
> > #define APR_HAVE_SHMEM_BEOS 0
> > #define APR_USE_SHMEM_MMAP_TMP 0
> > #define APR_USE_SHMEM_MMAP_SHM 0
> > #define APR_USE_SHMEM_MMAP_ZERO0
> > #define APR_USE_SHMEM_SHMGET_ANON  0
> > #define APR_USE_SHMEM_SHMGET   1
> > #define APR_USE_SHMEM_MMAP_ANON1
> > #define APR_USE_SHMEM_BEOS 0
>
> These are identical to what I have on 5.0-CURRENT, and I just
> verified that it still works for me.
>
> If you are getting "Not implemented on this platform" errors, then
> something funny is going on -- that only happens in the scoreboard if
> you don't have any anonymous shmem implementations, which according to
> your HAVE_SHMEM defines above is not true (you have every shmem type
> known to APR on your system).

Okay, this makes sense then, as use of shared memory in a jail environment
is not currently enabled by default, and is not recommended:

 jail.sysvipc_allowed
  This MIB entry determines whether or not processes within a jail
  have access to System V IPC primitives.  In the current jail imple-
  mentation, System V primitives share a single namespace across the
  host and jail environments, meaning that processes within a jail
  would be able to communicate with (and potentially interfere with)
  processes outside of the jail, and in other jails.  As such, this
  functionality is disabled by default, but can be enabled by setting
  this MIB entry to 1.

Now, does apache2 *require* shared memory, or can I set all of the above
to zero, and it will work around the limitation?




Re: [HEAD] --with-mpm=worker under FreeBSD 4.5 does nothing?

2002-01-11 Thread Aaron Bannert

On Fri, Jan 11, 2002 at 01:32:35PM -0400, Marc G. Fournier wrote:
> On Fri, 11 Jan 2002, Aaron Bannert wrote:
> 
> > On Fri, Jan 11, 2002 at 10:27:18AM -0400, Marc G. Fournier wrote:
> > ...
> > > [Fri Jan 11 14:20:19 2002] [crit] (78)Function not implemented: Fatal error: 
>could not open(create) scoreboard
> > ...
> >
> > >   Even if I comment out the 'ScoreBoard' line in httpd.conf, it
> > > gives the 'Function not implemented' error ...
> > >
> > >   Known problem?  If not, suggestions on how to debug and provide
> > > something just a wee bit more useful?  I'm not finding any core files
> > > laying about, so nothing I can gdb ...
> > ...
> >
> > send in the output of `grep SHM srclib/apr/include/apr.h` so we can find
> > out what shared memory subsystems are available on your platform.
> 
> jail# grep SHM srclib/apr/include/apr.h
> #define APR_HAVE_SHMEM_MMAP_TMP 1
> #define APR_HAVE_SHMEM_MMAP_SHM 1
> #define APR_HAVE_SHMEM_MMAP_ZERO1
> #define APR_HAVE_SHMEM_SHMGET_ANON  1
> #define APR_HAVE_SHMEM_SHMGET   1
> #define APR_HAVE_SHMEM_MMAP_ANON1
> #define APR_HAVE_SHMEM_BEOS 0
> #define APR_USE_SHMEM_MMAP_TMP 0
> #define APR_USE_SHMEM_MMAP_SHM 0
> #define APR_USE_SHMEM_MMAP_ZERO0
> #define APR_USE_SHMEM_SHMGET_ANON  0
> #define APR_USE_SHMEM_SHMGET   1
> #define APR_USE_SHMEM_MMAP_ANON1
> #define APR_USE_SHMEM_BEOS 0

These are identical to what I have on 5.0-CURRENT, and I just
verified that it still works for me.

If you are getting "Not implemented on this platform" errors, then
something funny is going on -- that only happens in the scoreboard if
you don't have any anonymous shmem implementations, which according to
your HAVE_SHMEM defines above is not true (you have every shmem type
known to APR on your system).

I'd say first try doing a full "make clean && make distclean && ./buildconf"
to make sure nothing is stale. Let us know if you're still seeing this
problem at that point.

Like Justin suggested, this could just be a problem with the jail. If
the above doesn't work, you might try changing to these defines:
#define APR_USE_SHMEM_SHMGET_ANON  1
#define APR_USE_SHMEM_MMAP_ANON0

So that you're using shmget() for the ANON shmem instead of mmap().

-aaron



Re: [HEAD] --with-mpm=worker under FreeBSD 4.5 does nothing?

2002-01-11 Thread Marc G. Fournier

On Fri, 11 Jan 2002, Aaron Bannert wrote:

> On Fri, Jan 11, 2002 at 10:27:18AM -0400, Marc G. Fournier wrote:
> ...
> > [Fri Jan 11 14:20:19 2002] [crit] (78)Function not implemented: Fatal error: could 
>not open(create) scoreboard
> ...
>
> > Even if I comment out the 'ScoreBoard' line in httpd.conf, it
> > gives the 'Function not implemented' error ...
> >
> > Known problem?  If not, suggestions on how to debug and provide
> > something just a wee bit more useful?  I'm not finding any core files
> > laying about, so nothing I can gdb ...
> ...
>
> send in the output of `grep SHM srclib/apr/include/apr.h` so we can find
> out what shared memory subsystems are available on your platform.

jail# grep SHM srclib/apr/include/apr.h
#define APR_HAVE_SHMEM_MMAP_TMP 1
#define APR_HAVE_SHMEM_MMAP_SHM 1
#define APR_HAVE_SHMEM_MMAP_ZERO1
#define APR_HAVE_SHMEM_SHMGET_ANON  1
#define APR_HAVE_SHMEM_SHMGET   1
#define APR_HAVE_SHMEM_MMAP_ANON1
#define APR_HAVE_SHMEM_BEOS 0
#define APR_USE_SHMEM_MMAP_TMP 0
#define APR_USE_SHMEM_MMAP_SHM 0
#define APR_USE_SHMEM_MMAP_ZERO0
#define APR_USE_SHMEM_SHMGET_ANON  0
#define APR_USE_SHMEM_SHMGET   1
#define APR_USE_SHMEM_MMAP_ANON1
#define APR_USE_SHMEM_BEOS 0

> I tested this code on 5.0-current and I know Justin as well as others
> have tested this on earlier versions (4.4 IIRC).

jail# uname -a
FreeBSD jail 4.5-PRERELEASE FreeBSD 4.5-PRERELEASE #2: Mon Jan  7 11:19:58 AST 2002
 [EMAIL PROTECTED]:/usr/obj/usr/src/sys/atelier  i386




Re: [HEAD] --with-mpm=worker under FreeBSD 4.5 does nothing?

2002-01-11 Thread Marc G. Fournier

On Fri, 11 Jan 2002, Justin Erenkrantz wrote:

> On Fri, Jan 11, 2002 at 10:27:18AM -0400, Marc G. Fournier wrote:
> >
> > Morning all ...
> >
> > Just built a 'jail' environment under a 4.5 system so that I can
> > putz around with Apache2-HEAD, where I could "reformat" at will to clean
> > up any cruft ... build went great, using:
> >
> > #!/bin/sh
> > ./configure  \
> > --prefix=/usr/local/apache \
> > --with-perl=/usr/bin/perl \
> > --enable-so \
> > --with-suexec-caller=nobody \
> > --with-mpm=worker \
> > --enable-threads \
> > --with-port=80 \
> > --enable-mods-shared='all cgid ssl proxy proxy-connect proxy-ftp 
>proxy-http cache mem-cache file-cache'
> >
> > Install went as smooth ... but I can't connect ...
> >
> > logs/error_log shows:
> >
> > [Fri Jan 11 14:20:17 2002] [info] mod_unique_id: using ip addr 131.162.139.86
> > [Fri Jan 11 14:20:18 2002] [info] mod_unique_id: using ip addr 131.162.139.86
> > [Fri Jan 11 14:20:19 2002] [notice] Digest: generating secret for digest 
>authentication ...
> > [Fri Jan 11 14:20:19 2002] [notice] Digest: done
> > [Fri Jan 11 14:20:19 2002] [warn] pid file /usr/local/apache/logs/httpd.pid 
>overwritten -- Unclean shutdown of previous Apache run?
> > [Fri Jan 11 14:20:19 2002] [crit] (78)Function not implemented: Fatal error: could 
>not open(create) scoreboard
> >
> > And a ps listing shows no root process, only the one nobody
> > process:
> >
> > jail# ps aux | grep http
> > nobody  83618  0.0  1.1  4224 2924  ??  IJ2:20PM   0:00.00 bin/httpd
> >
> > Even if I comment out the 'ScoreBoard' line in httpd.conf, it
> > gives the 'Function not implemented' error ...
>
> I'm not familiar enough with the "jail," but it sounds like
> anonymous mmap may not be supported in this environment.  Can you
> grep for APR_USE_SHMEM in srclib/apr/include/apr.h and send that?
> I'll bet mmap is returning that error.

jail# grep APR_USE_SHMEM srclib/apr/include/apr.h
#define APR_USE_SHMEM_MMAP_TMP 0
#define APR_USE_SHMEM_MMAP_SHM 0
#define APR_USE_SHMEM_MMAP_ZERO0
#define APR_USE_SHMEM_SHMGET_ANON  0
#define APR_USE_SHMEM_SHMGET   1
#define APR_USE_SHMEM_MMAP_ANON1
#define APR_USE_SHMEM_BEOS 0

> Please understand that threads aren't working on FreeBSD.  It's why
> you had to manually enable them.  =)

Thought of that too, so I tried prefork ... got same results ...


> However, worker MPM on FreeBSD isn't usable by anyone at this
> point other than as a conversation piece.  -- justin

Actually, I am using on an older 4.4 jail environment:

Server Version: Apache/2.0.28 (Unix) mod_ssl/3.0a0 OpenSSL/0.9.6 DAV/2

Current Time: Friday, 11-Jan-2002 17:30:18 GMT
Restart Time: Tuesday, 08-Jan-2002 18:28:03 GMT
Parent Server Generation: 0
Server uptime:  2 days 23 hours 2 minutes 15 seconds
Total accesses: 173 - Total Traffic: 163 kB
CPU Usage: u24.5469 s63.2891 cu0 cs0 - .0343% CPU load
.000676 requests/sec - 0 B/second - 964 B/request
1 requests currently being processed, 24 idle workers

Not a heavily loaded server, mind you ... but it is running ...




Re: [HEAD] --with-mpm=worker under FreeBSD 4.5 does nothing?

2002-01-11 Thread David Reid

Justin,

On FreeBSD 4.5 worker is now reasonably usable (albeit in short bursts I
will grant), at least it was for me earlier today.  We'll have to play with
it and see what's going on on other systems and under load though.

david

- Original Message -
From: "Justin Erenkrantz" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 11, 2002 4:08 PM
Subject: Re: [HEAD] --with-mpm=worker under FreeBSD 4.5 does nothing?


> On Fri, Jan 11, 2002 at 10:27:18AM -0400, Marc G. Fournier wrote:
> >
> > Morning all ...
> >
> > Just built a 'jail' environment under a 4.5 system so that I can
> > putz around with Apache2-HEAD, where I could "reformat" at will to clean
> > up any cruft ... build went great, using:
> >
> > #!/bin/sh
> > ./configure  \
> > --prefix=/usr/local/apache \
> > --with-perl=/usr/bin/perl \
> > --enable-so \
> > --with-suexec-caller=nobody \
> > --with-mpm=worker \
> > --enable-threads \
> > --with-port=80 \
> > --enable-mods-shared='all cgid ssl proxy proxy-connect proxy-ftp
proxy-http cache mem-cache file-cache'
> >
> > Install went as smooth ... but I can't connect ...
> >
> > logs/error_log shows:
> >
> > [Fri Jan 11 14:20:17 2002] [info] mod_unique_id: using ip addr
131.162.139.86
> > [Fri Jan 11 14:20:18 2002] [info] mod_unique_id: using ip addr
131.162.139.86
> > [Fri Jan 11 14:20:19 2002] [notice] Digest: generating secret for digest
authentication ...
> > [Fri Jan 11 14:20:19 2002] [notice] Digest: done
> > [Fri Jan 11 14:20:19 2002] [warn] pid file
/usr/local/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous
Apache run?
> > [Fri Jan 11 14:20:19 2002] [crit] (78)Function not implemented: Fatal
error: could not open(create) scoreboard
> >
> > And a ps listing shows no root process, only the one nobody
> > process:
> >
> > jail# ps aux | grep http
> > nobody  83618  0.0  1.1  4224 2924  ??  IJ2:20PM   0:00.00 bin/httpd
> >
> > Even if I comment out the 'ScoreBoard' line in httpd.conf, it
> > gives the 'Function not implemented' error ...
>
> I'm not familiar enough with the "jail," but it sounds like
> anonymous mmap may not be supported in this environment.  Can you
> grep for APR_USE_SHMEM in srclib/apr/include/apr.h and send that?
> I'll bet mmap is returning that error.
>
> > Known problem?  If not, suggestions on how to debug and provide
> > something just a wee bit more useful?  I'm not finding any core files
> > laying about, so nothing I can gdb ...
>
> You can do a break in apr_shm_create() and watch the return
> value from mmap.  I bet it'll be an error condition.
>
> Please understand that threads aren't working on FreeBSD.  It's why
> you had to manually enable them.  =)
>
> At the very least, something looks busted with their
> pthread_cond_* implementation (or our usage of it) that blows up
> our worker scheme.
>
> If you want to help out with the development of worker and threads
> on FreeBSD, you are more than welcome to assist.  I would recommend
> reading through the various STATUS files for FreeBSD notes.  We have
> tidbits all over the place.
>
> However, worker MPM on FreeBSD isn't usable by anyone at this
> point other than as a conversation piece.  -- justin
>
>




Re: [HEAD] --with-mpm=worker under FreeBSD 4.5 does nothing?

2002-01-11 Thread Aaron Bannert

On Fri, Jan 11, 2002 at 10:27:18AM -0400, Marc G. Fournier wrote:
...
> [Fri Jan 11 14:20:19 2002] [crit] (78)Function not implemented: Fatal error: could 
>not open(create) scoreboard
...
 
>   Even if I comment out the 'ScoreBoard' line in httpd.conf, it
> gives the 'Function not implemented' error ...
> 
>   Known problem?  If not, suggestions on how to debug and provide
> something just a wee bit more useful?  I'm not finding any core files
> laying about, so nothing I can gdb ...
...

send in the output of `grep SHM srclib/apr/include/apr.h` so we can find
out what shared memory subsystems are available on your platform.

I tested this code on 5.0-current and I know Justin as well as others
have tested this on earlier versions (4.4 IIRC).

-aaron



Re: [HEAD] --with-mpm=worker under FreeBSD 4.5 does nothing?

2002-01-11 Thread Justin Erenkrantz

On Fri, Jan 11, 2002 at 10:27:18AM -0400, Marc G. Fournier wrote:
> 
> Morning all ...
> 
>   Just built a 'jail' environment under a 4.5 system so that I can
> putz around with Apache2-HEAD, where I could "reformat" at will to clean
> up any cruft ... build went great, using:
> 
> #!/bin/sh
> ./configure  \
> --prefix=/usr/local/apache \
> --with-perl=/usr/bin/perl \
> --enable-so \
> --with-suexec-caller=nobody \
> --with-mpm=worker \
> --enable-threads \
> --with-port=80 \
> --enable-mods-shared='all cgid ssl proxy proxy-connect proxy-ftp proxy-http 
>cache mem-cache file-cache'
> 
>   Install went as smooth ... but I can't connect ...
> 
>   logs/error_log shows:
> 
> [Fri Jan 11 14:20:17 2002] [info] mod_unique_id: using ip addr 131.162.139.86
> [Fri Jan 11 14:20:18 2002] [info] mod_unique_id: using ip addr 131.162.139.86
> [Fri Jan 11 14:20:19 2002] [notice] Digest: generating secret for digest 
>authentication ...
> [Fri Jan 11 14:20:19 2002] [notice] Digest: done
> [Fri Jan 11 14:20:19 2002] [warn] pid file /usr/local/apache/logs/httpd.pid 
>overwritten -- Unclean shutdown of previous Apache run?
> [Fri Jan 11 14:20:19 2002] [crit] (78)Function not implemented: Fatal error: could 
>not open(create) scoreboard
> 
>   And a ps listing shows no root process, only the one nobody
> process:
> 
> jail# ps aux | grep http
> nobody  83618  0.0  1.1  4224 2924  ??  IJ2:20PM   0:00.00 bin/httpd
> 
>   Even if I comment out the 'ScoreBoard' line in httpd.conf, it
> gives the 'Function not implemented' error ...

I'm not familiar enough with the "jail," but it sounds like
anonymous mmap may not be supported in this environment.  Can you 
grep for APR_USE_SHMEM in srclib/apr/include/apr.h and send that?
I'll bet mmap is returning that error.

>   Known problem?  If not, suggestions on how to debug and provide
> something just a wee bit more useful?  I'm not finding any core files
> laying about, so nothing I can gdb ...

You can do a break in apr_shm_create() and watch the return
value from mmap.  I bet it'll be an error condition.

Please understand that threads aren't working on FreeBSD.  It's why
you had to manually enable them.  =)

At the very least, something looks busted with their 
pthread_cond_* implementation (or our usage of it) that blows up 
our worker scheme. 

If you want to help out with the development of worker and threads
on FreeBSD, you are more than welcome to assist.  I would recommend
reading through the various STATUS files for FreeBSD notes.  We have
tidbits all over the place.  

However, worker MPM on FreeBSD isn't usable by anyone at this
point other than as a conversation piece.  -- justin