Apache mod_ssl httpd.mm semaphore; absolute EAPI_MM_CORE_PATH
Oliver Crow
ocrow at simplexity.net
Fri Nov 7 11:55:19 PST 2003
-- Problem --
Attempting to run apache as a non root user when you have built apache
with mod_ssl using the www/apache13-modssl port, the following error
message appears when you start apache:
> Ouch! ap_mm_create(1048576, "/var/run/httpd.mm.82733") failed
> Error: MM: mm:core: failed to open semaphore file (No such file or
> directory): OS: No such file or directory
The apache binary is hardcoded with the directory in which to create an
httpd.mm semaphore file. The default path (/var/run) is only writable by
the root user. There is no httpd.conf configuration directive to change
the semaphore directory, because this path must be set before the apache
conf file is read.
-- Solution --
Run 'httpd -V' and you will see a line like this:
-D EAPI_MM_CORE_PATH="/var/run/httpd.mm"
If the EAPI_MM_CORE_PATH is absolute (begins with a '/') you cannot
change the path at runtime. If it is relative (doesn't begin with a
slash), the actual path used will be relative to the ServerRoot which can
be set using 'http -d /path/to/serverroot'.
By default on FreeBSD the EAPI_MM_CORE_PATH is absolute. To change it
apache must be rebuilt from the port with different configuration
settings. If you built from the apache13-modssl port, create a file
'/usr/ports/www/apache13-modssl/Makefile.local' with the following line:
CONFIGURE_ARGS+=--runtimedir=run
After rebuilding and installing the port, 'httpd -V' will have this line:
-D EAPI_MM_CORE_PATH="run/httpd.mm"
and you can configure apache to use a user specific directory for the
httpd.mm semaphore files. For example:
% httpd -d /home/user1/www
will try to put the semaphore files in /home/user1/www/run/httpd.mm.%%
More information about the freebsd-ports
mailing list