*) ab: Fix read failure when targeting SSL server. [Jeff Trawick]
*) The following now respect DefaultRuntimeDir/DEFAULT_REL_RUNTIMEDIR:
- - core: the scoreboard (ScoreBoardFile), pid file (PidFile), and
- mutexes (Mutex)
- mod_auth_digest: shared memory file
- - APIs: ap_log_pid(), ap_remove_pid, ap_read_pid()
- - mod_lbmethod_heartbeat, mod_heartmonitor: heartbeat storage file
- - mod_ldap: shared memory cache
- - mod_socache_shmcb, mod_socache_dbm: shared memory or dbm for cache
- [Jeff Trawick, Jim Jagielski]
+ [Jeff Trawick]
*) htpasswd: Use correct file mode for checking if file is writable.
PR 45923. [Stefan Fritsch]
*) Add "strict" and "warnings" pragmas to Perl scripts. [Rich Bowen]
+ *) The following now respect DefaultRuntimeDir/DEFAULT_REL_RUNTIMEDIR:
+ - core: the scoreboard (ScoreBoardFile), pid file (PidFile), and
+ mutexes (Mutex)
+ [Jim Jagielski]
+
*) ab: Fix bind() errors. [Joe Orton]
*) mpm_event: Don't do a blocking write when starting a lingering close
[ start all new proposals below, under PATCHES PROPOSED. ]
+ * opinion on more complete DefaultRuntimeDir use in 2.4.x?
+ o If a module has a config directive for the run-time file that
+ treats the configured path as relative to server root, preserve
+ that behavior but change the location when not configured to
+ respect DefaultRuntimeDir. With these changes, users with no
+ per-runtime-file configuration directives can control
+ everything with DefaultRuntimeDir.
+ BUT: Existing users of DefaultRuntimeDir might get a short-term scare
+ when some unconfigured run-time file starts respecting their
+ DefaultRuntimeDir directive after an upgrade.
+ +1: trawick, jim, rjung
+ rjung: backport candidates are:
+ heartbeat r1364695
+ scoreboard r1369477
+ core/pid file r1369808
+ core/mutex r1370288
+ mod_socache_XXX r1370225
+ mod_slotmem_plain r1370763
+ mod_ldap r1371684
+
+
PATCHES PROPOSED TO BACKPORT FROM TRUNK:
[ New proposals should be added at the end of the list ]
# Note that this is the default PidFile for most MPMs.
#
<IfModule !mpm_netware_module>
- PidFile "httpd.pid"
+ PidFile "@rel_runtimedir@/httpd.pid"
</IfModule>
#
# Inter-Process Session Cache:
# Configure the SSL Session Cache: First the mechanism
# to use and second the expiring timeout (in seconds).
-#SSLSessionCache "dbm:ssl_scache"
-SSLSessionCache "shmcb:ssl_scache(512000)"
+#SSLSessionCache "dbm:@exp_runtimedir@/ssl_scache"
+SSLSessionCache "shmcb:@exp_runtimedir@/ssl_scache(512000)"
SSLSessionCacheTimeout 300
##
<p>With the file-based mechanisms <em>fcntl</em> and <em>flock</em>,
the path, if provided, is a directory where the lock file will be created.
- The default directory is httpd's run-time file directory,
- <directive module="core">DefaultRuntimeDir</directive>. If a relative
- path is provided, it is relative to
- <directive module="core">DefaultRuntimeDir</directive>. Always use a local
- disk filesystem for <code>/path/to/mutex</code> and never a directory residing
+ The default directory is httpd's run-time file directory relative to
+ <directive module="core">ServerRoot</directive>. Always use a local disk
+ filesystem for <code>/path/to/mutex</code> and never a directory residing
on a NFS- or AFS-filesystem. The basename of the file will be the mutex
type, an optional instance string provided by the module, and unless the
<code>OmitPID</code> keyword is specified, the process id of the httpd
<directivesynopsis>
<name>LDAPSharedCacheFile</name>
<description>Sets the shared memory cache file</description>
-<syntax>LDAPSharedCacheFile <var>file-path</var></syntax>
+<syntax>LDAPSharedCacheFile <var>directory-path/filename</var></syntax>
<contextlist><context>server config</context></contextlist>
<usage>
- <p>Specifies the path of the shared memory cache file. If not set,
- anonymous shared memory will be used if the platform supports it.</p>
-
- <p>If <var>file-path</var> is not an absolute path, the location specified
- will be relative to the value of
- <directive module="core">DefaultRuntimeDir</directive>.</p>
+ <p>Specifies the directory path and file name of the shared memory
+ cache file. If not set, anonymous shared memory will be used if the
+ platform supports it.</p>
</usage>
</directivesynopsis>
dbm:/path/to/datafile
</example>
- <p>If the path is not absolute then it is assumed to be relative to
- the <directive module="core">DefaultRuntimeDir</directive>.</p>
-
<p>Details of other shared object cache providers can be found
<a href="../socache.html">here</a>.
</p>
shmcb:/path/to/datafile(512000)
</example>
- <p>If the path is not absolute then it is assumed to be relative to
- the <directive module="core">DefaultRuntimeDir</directive>.</p>
-
<p>Details of other shared object cache providers can be found
<a href="../socache.html">here</a>.
</p>
<description>File where the server records the process ID
of the daemon</description>
<syntax>PidFile <var>filename</var></syntax>
-<default>PidFile httpd.pid</default>
+<default>PidFile logs/httpd.pid</default>
<contextlist><context>server config</context></contextlist>
<modulelist><module>event</module><module>mpm_winnt</module>
<module>mpmt_os2</module><module>prefork</module><module>worker</module>
<p>The <directive>PidFile</directive> directive sets the file to
which the server records the process id of the daemon. If the
filename is not absolute then it is assumed to be relative to the
- <directive module="core">DefaultRuntimeDir</directive>.</p>
+ <directive module="core">ServerRoot</directive>.</p>
<example><title>Example</title>
<highlight language="config">
<description>Location of the file used to store coordination data for
the child processes</description>
<syntax>ScoreBoardFile <var>file-path</var></syntax>
-<default>ScoreBoardFile apache_runtime_status</default>
+<default>ScoreBoardFile logs/apache_runtime_status</default>
<contextlist><context>server config</context></contextlist>
<modulelist><module>event</module><module>mpm_winnt</module>
<module>prefork</module><module>worker</module></modulelist>
disk (using file-based shared memory). Specifying this directive causes
Apache httpd to always create the file on the disk.</p>
- <p>If <var>file-path</var> is not an absolute path, the location specified
- will be relative to the value of
- <directive module="core">DefaultRuntimeDir</directive>.</p>
-
<example><title>Example</title>
<highlight language="config">
ScoreBoardFile /var/run/apache_runtime_status
/* Where the main/parent process's pid is logged */
#ifndef DEFAULT_PIDLOG
-#define DEFAULT_PIDLOG "httpd.pid"
+#define DEFAULT_PIDLOG DEFAULT_REL_RUNTIMEDIR "/httpd.pid"
#endif
#if defined(NETWARE)
int id;
} hm_slot_server_t;
-/* default name of heartbeat data file, created in the configured
- * runtime directory when mod_slotmem_shm is not available
- */
-#define DEFAULT_HEARTBEAT_STORAGE "hb.dat"
-
#ifdef __cplusplus
}
#endif
* Log the current pid of the parent process
* @param p The pool to use for processing
* @param fname The name of the file to log to. If the filename is not
- * absolute then it is assumed to be relative to DefaultRuntimeDir.
+ * absolute then it is assumed to be relative to ServerRoot.
*/
AP_DECLARE(void) ap_log_pid(apr_pool_t *p, const char *fname);
* Remove the pidfile.
* @param p The pool to use for processing
* @param fname The name of the pid file to remove. If the filename is not
- * absolute then it is assumed to be relative to DefaultRuntimeDir.
+ * absolute then it is assumed to be relative to ServerRoot.
*/
AP_DECLARE(void) ap_remove_pid(apr_pool_t *p, const char *fname);
/**
* Retrieve the pid from a pidfile.
* @param p The pool to use for processing
- * @param filename The name of the file containing the pid. If the filename
- * is not absolute then it is assumed to be relative to DefaultRuntimeDir.
+ * @param filename The name of the file containing the pid. If the filename is not
+ * absolute then it is assumed to be relative to ServerRoot.
* @param mypid Pointer to pid_t (valid only if return APR_SUCCESS)
*/
AP_DECLARE(apr_status_t) ap_read_pid(apr_pool_t *p, const char *filename, pid_t *mypid);
/* Scoreboard file, if there is one */
#ifndef DEFAULT_SCOREBOARD
-#define DEFAULT_SCOREBOARD "apache_runtime_status" /* within DEFAULT_REL_RUNTIMEDIR */
+#define DEFAULT_SCOREBOARD "logs/apache_runtime_status"
#endif
/* Scoreboard info on a process is, for now, kept very brief ---
*context = ctx = apr_pcalloc(p, sizeof *ctx);
if (arg && *arg) {
- ctx->data_file = ap_runtime_dir_relative(p, arg);
+ ctx->data_file = ap_server_root_relative(p, arg);
if (!ctx->data_file) {
return apr_psprintf(tmp, "Invalid cache file path %s", arg);
}
return NULL;
}
- ctx->data_file = path = ap_runtime_dir_relative(p, arg);
+ ctx->data_file = path = ap_server_root_relative(p, arg);
cp = strrchr(path, '(');
cp2 = path + strlen(path) - 1;
hm_ctx_t *ctx = (hm_ctx_t *) apr_palloc(p, sizeof(hm_ctx_t));
ctx->active = 0;
- ctx->storage_path = ap_runtime_dir_relative(p, DEFAULT_HEARTBEAT_STORAGE);
+ ctx->storage_path = ap_server_root_relative(p, "logs/hb.dat");
/* TODO: Add directive for tuning the update interval
*/
ctx->interval = apr_time_from_sec(HM_UPDATE_SEC);
return err;
}
- ctx->storage_path = ap_runtime_dir_relative(p, path);
+ ctx->storage_path = ap_server_root_relative(p, path);
return NULL;
}
}
if (file) {
- st->cache_file = ap_runtime_dir_relative(st->pool, file);
+ st->cache_file = ap_server_root_relative(st->pool, file);
}
else {
st->cache_file = NULL;
{
lb_hb_ctx_t *ctx = (lb_hb_ctx_t *) apr_palloc(p, sizeof(lb_hb_ctx_t));
- ctx->path = ap_runtime_dir_relative(p, DEFAULT_HEARTBEAT_STORAGE);
+ ctx->path = ap_server_root_relative(p, "logs/hb.dat");
return ctx;
}
return err;
}
- ctx->path = ap_runtime_dir_relative(p, path);
+ ctx->path = ap_server_root_relative(p, path);
return NULL;
}
if (name[0] == ':')
fname = name;
else
- fname = ap_runtime_dir_relative(pool, name);
+ fname = ap_server_root_relative(pool, name);
/* first try to attach to existing slotmem */
if (next) {
if (name[0] == ':')
fname = name;
else
- fname = ap_runtime_dir_relative(pool, name);
+ fname = ap_server_root_relative(pool, name);
}
else
return APR_ENOSHMAVAIL;
tmp = s->error_fname;
apr_file_printf(out, "Main ErrorLog: \"%s\"\n", tmp);
if (ap_scoreboard_fname) {
- tmp = ap_runtime_dir_relative(p, ap_scoreboard_fname);
+ tmp = ap_server_root_relative(p, ap_scoreboard_fname);
apr_file_printf(out, "ScoreBoardFile: \"%s\"\n", tmp);
}
ap_dump_mutexes(p, s, out);
AP_DECLARE(void) ap_remove_pid(apr_pool_t *p, const char *rel_fname)
{
apr_status_t rv;
- const char *fname = ap_runtime_dir_relative(p, rel_fname);
+ const char *fname = ap_server_root_relative(p, rel_fname);
if (fname != NULL) {
rv = apr_file_remove(fname, p);
return;
}
- fname = ap_runtime_dir_relative(p, filename);
+ fname = ap_server_root_relative(p, filename);
if (!fname) {
ap_log_error(APLOG_MARK, APLOG_STARTUP|APLOG_CRIT, APR_EBADPATH,
NULL, APLOGNO(00097) "Invalid PID file path %s, ignoring.", filename);
return APR_EGENERAL;
}
- fname = ap_runtime_dir_relative(p, filename);
+ fname = ap_server_root_relative(p, filename);
if (!fname) {
ap_log_error(APLOG_MARK, APLOG_STARTUP|APLOG_CRIT, APR_EBADPATH,
NULL, APLOGNO(00101) "Invalid PID file path %s, ignoring.", filename);
void ap_mpm_dump_pidfile(apr_pool_t *p, apr_file_t *out)
{
apr_file_printf(out, "PidFile: \"%s\"\n",
- ap_runtime_dir_relative(p, ap_pid_fname));
+ ap_server_root_relative(p, ap_pid_fname));
}
const char *ap_mpm_set_max_requests(cmd_parms *cmd, void *dummy,
/* The config says to create a name-based shmem */
if (ap_scoreboard_fname) {
/* make sure it's an absolute pathname */
- fname = ap_runtime_dir_relative(pconf, ap_scoreboard_fname);
+ fname = ap_server_root_relative(pconf, ap_scoreboard_fname);
if (!fname) {
ap_log_error(APLOG_MARK, APLOG_CRIT, APR_EBADPATH, ap_server_conf, APLOGNO(00003)
"Fatal error: Invalid Scoreboard path %s",
else if (rv == APR_ENOTIMPL) {
/* Make sure it's an absolute pathname */
ap_scoreboard_fname = DEFAULT_SCOREBOARD;
- fname = ap_runtime_dir_relative(pconf, ap_scoreboard_fname);
+ fname = ap_server_root_relative(pconf, ap_scoreboard_fname);
return create_namebased_scoreboard(global_pool, fname);
}
* are looking to use
*/
if (file) {
- *mutexfile = ap_runtime_dir_relative(pool, file);
+ *mutexfile = ap_server_root_relative(pool, file);
if (!*mutexfile) {
return APR_BADARG;
}
}
#endif
- return ap_runtime_dir_relative(p,
+ return ap_server_root_relative(p,
apr_pstrcat(p,
mxcfg->dir,
"/",
}
if (mxcfg->dir)
- dir = ap_runtime_dir_relative(p, mxcfg->dir);
+ dir = ap_server_root_relative(p, mxcfg->dir);
apr_file_printf(out, "Mutex %s: dir=\"%s\" mechanism=%s %s\n", name, dir, mech,
mxcfg->omit_pid ? "[OmitPid]" : "");