summaryrefslogtreecommitdiffstats
path: root/docs/manual
diff options
context:
space:
mode:
authorJoe Orton <jorton@apache.org>2020-04-23 10:26:26 +0200
committerJoe Orton <jorton@apache.org>2020-04-23 10:26:26 +0200
commita42f3692b1b975ba05a8e678bafe463707e7e5df (patch)
treea8a5e9dbdd39f78248454ba5de524a230f3a3436 /docs/manual
parentconfig: allow for environment variable substitution fallback to default value. (diff)
downloadapache2-a42f3692b1b975ba05a8e678bafe463707e7e5df.tar.xz
apache2-a42f3692b1b975ba05a8e678bafe463707e7e5df.zip
Add optional options= argument to Listen to add listener-specific
socket options. Reimplement "use_specific_errors" listener flag under generic ap_listen_rec flags field holding all listener-specific options. * include/ap_listen.h: Add AP_LISTEN_* flags. (ap_listen_rec): Rename use_specific_errors to flags. * server/listen.c (make_sock): Set APR_SO_FREEBIND if AP_LISTEN_FREEBIND flag is set on listener; set APR_SO_REUSEPORT unconditionally if AP_LISTEN_REUSEPORT is set. (alloc_listener): Take flags argument. (ap_setup_listeners): Set AP_LISTEN_SPECIFIC_ERRORS flag here. (ap_set_listener): Parse optional options=... argument, catch typos and fail if protocol name contains a "=". (ap_duplicate_listeners): Duplicate flags. Submitted by: jkaluza, Lubos Uhliarik <luhliari redhat.com>, jorton PR: 61865 Github: closes #114 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1876865 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'docs/manual')
-rw-r--r--docs/manual/mod/mpm_common.xml22
1 files changed, 20 insertions, 2 deletions
diff --git a/docs/manual/mod/mpm_common.xml b/docs/manual/mod/mpm_common.xml
index ecf242aa72..be8a2ff5b2 100644
--- a/docs/manual/mod/mpm_common.xml
+++ b/docs/manual/mod/mpm_common.xml
@@ -182,12 +182,13 @@ of the daemon</description>
<name>Listen</name>
<description>IP addresses and ports that the server
listens to</description>
-<syntax>Listen [<var>IP-address</var>:]<var>portnumber</var> [<var>protocol</var>]</syntax>
+<syntax>Listen [<var>IP-address</var>:]<var>portnumber</var> [<var>protocol</var>] [options=<var>flag</var>[,<var>flag..</var>]]</syntax>
<contextlist><context>server config</context></contextlist>
<modulelist><module>event</module><module>worker</module>
<module>prefork</module><module>mpm_winnt</module>
<module>mpm_netware</module><module>mpmt_os2</module>
</modulelist>
+<compatibility>The optional <code>options=</code> argument is available in httpd 2.5.1 and later.</compatibility>
<usage>
<p>The <directive>Listen</directive> directive instructs Apache httpd to
@@ -254,8 +255,25 @@ Listen 192.170.2.5:8000
Listen 192.170.2.1:8443 https
</highlight>
+ <p>The optional <var>options=flag,flag...</var> argument can be
+ used to enable certain socket options for the listening port.
+ These options are not required for most configurations and should
+ be used with care. Availability of each flag varies across
+ operating systems. The available <em>flag</em>s are:</p>
+
+ <ul>
+ <li><code>freebind</code>: The <code>IP_FREEBIND</code> socket
+ option is enabled, allowing a Listen directive to be used for an
+ address which is not (yet) available on the system. (Linux
+ only)</li>
+
+ <li><code>reuseport</code>: The <code>SO_REUSEPORT</code> socket
+ option is enabled, allowing a Listen directive to bind to a port
+ which may already be in use by another process.</li>
+ </ul>
+
<note><title>Error condition</title>
- Multiple <directive>Listen</directive> directives for the same ip
+ Multiple <directive>Listen</directive> directives for the same IP
address and port will result in an <code>Address already in use</code>
error message.
</note>