From a0d2eb082298d4776370954b8992c6a8e1432099 Mon Sep 17 00:00:00 2001 From: Isidore Wang Date: Fri, 13 Nov 2026 22:14:17 +0800 Subject: [PATCH 1/9] docs: add a Simplified Chinese translation of bind.xml. --- docs/manual/bind.xml.zh-cn | 229 +++++++++++++++++++++++++++++++++++++ 1 file changed, 229 insertions(+) create mode 100644 docs/manual/bind.xml.zh-cn diff --git a/docs/manual/bind.xml.zh-cn b/docs/manual/bind.xml.zh-cn new file mode 100644 index 00000000000..99687788a38 --- /dev/null +++ b/docs/manual/bind.xml.zh-cn @@ -0,0 +1,229 @@ + + + + + + + + + + 绑定指定地址与端口 + + +

配置Apache HTTP Server监听特定地址和端口。

+
+ + 虚拟主机 + DNS问题 + +
+ 概览 + + + + core + mpm_common + + + VirtualHost + Listen + + + + +

httpd在启动时会绑定到本地机器的某些端口和地址,以接受入站请求。 + 默认情况下,httpd会监听本地机器的所有地址。不过,有时可能需要对其进行配置, + 指定它监听哪些端口、仅监听哪些特定地址,或者同时指定端口和地址。 + 这通常会与虚拟主机功能结合使用,决定httpd如何响应发往 + 不同IP地址、主机名、端口的请求。

+ +

Listen指令用于指示服务器仅接受发往特定端口或 + 特定地址、端口组合的请求。如果仅在Listen处指定 + 端口,那么服务器将会在所有接口上监听此端口的请求。如果同时指定了IP地址和端口,那么服务器将会监听 + 指定端口和接口。也可以使用多个Listen指令指示服务器 + 监听多个地址和端口,服务器会响应任何来自列在Listen指令中 + 端口和地址的请求。

+ +

例如如果按下面的配置设置,服务器会接受所有接口中来自80、8000端口的连接:

+ + + +Listen 80 +Listen 8000 + + + +

通过下面的设置,可以让服务器在一个接口上监听80端口,在另一个接口上监听8000端口。

+ + + +Listen 192.0.2.1:80 +Listen 192.0.2.5:8000 + + + +

IPv6地址必须包含在下例所示的方括号内:

+ + + + Listen [2001:db8::a00:20ff:fea7:ccea]:80 + + + +

Overlapping Listen directives will result in a + fatal error which will prevent the server from starting up.

+ + + (48)Address already in use: make_sock: could not bind to address [::]:80 + + +

See the + discussion in the wiki for further troubleshooting tips.

+ +
+ +
+ +
+ Changing Listen configuration on restart + +

When httpd is restarted, special consideration must be made for + changes to Listen directives. During a restart, httpd keeps ports + bound (as in the original configuration) to avoid generating + "Connection refused" errors for any new attempts to connect to the + server. If changes are made to the set of Listen directives used + which conflict with the old configuration, configuration will fail + and the server will terminate.

+ +

For example, changing from configuration:

+ + + + Listen 127.0.0.1:80 + + + +

to the following may fail, because binding to port 80 across + all addresses conflicts with binding to port 80 on just + 127.0.0.1.

+ + + + Listen 80 + + + +

To have such configuration changes take effect, it is necessary + to stop and then start the server.

+ +
+ +
+ Special IPv6 Considerations + +

A growing number of platforms implement IPv6, and + APR supports IPv6 on most of these platforms, + allowing httpd to allocate IPv6 sockets, and to handle requests sent + over IPv6.

+ +

One complicating factor for httpd administrators is whether or + not an IPv6 socket can handle both IPv4 connections and IPv6 + connections. Handling IPv4 connections with an IPv6 socket uses + IPv4-mapped IPv6 addresses, which are allowed by default on most + platforms, but are disallowed by default on FreeBSD, NetBSD, and + OpenBSD, in order to match the system-wide policy on those + platforms. On systems where it is disallowed by default, a + special configure parameter can change this behavior + for httpd.

+ +

On the other hand, on some platforms, such as Linux and Tru64, the + only way to handle both IPv6 and IPv4 is to use + mapped addresses. If you want httpd to handle IPv4 and IPv6 connections + with a minimum of sockets, which requires using IPv4-mapped IPv6 + addresses, specify the --enable-v4-mapped + configure option.

+ +

--enable-v4-mapped is the default on all platforms except + FreeBSD, NetBSD, and OpenBSD, so this is probably how your httpd was + built.

+ +

If you want httpd to handle IPv4 connections only, regardless of + what your platform and APR will support, specify an IPv4 address on all + Listen directives, as in the + following examples:

+ + + +Listen 0.0.0.0:80 +Listen 192.0.2.1:80 + + + +

If your platform supports it and you want httpd to handle IPv4 and + IPv6 connections on separate sockets (i.e., to disable IPv4-mapped + addresses), specify the --disable-v4-mapped + configure option. --disable-v4-mapped is the + default on FreeBSD, NetBSD, and OpenBSD.

+
+ +
+ Specifying the protocol with Listen +

The optional second protocol argument of + Listen + is not required for most + configurations. If not specified, https is the default for + port 443 and http the default for all other ports. The + protocol is used to determine which module should handle a request, and + to apply protocol specific optimizations with the + AcceptFilter directive.

+ +

You only need to set the protocol if you are running on non-standard + ports. For example, running an https site on port 8443:

+ + + + Listen 192.170.2.1:8443 https + + +
+ +
+ How This Works With Virtual Hosts + +

The Listen directive does not implement + Virtual Hosts - it only tells the + main server what addresses and ports to listen on. If no + VirtualHost + directives are used, the server will behave + in the same way for all accepted requests. However, + VirtualHost + can be used to specify a different behavior + for one or more of the addresses or ports. To implement a + VirtualHost, the server must first be told to listen to the + address and port to be used. Then a + VirtualHost section + should be created for the specified address and port to set the + behavior of this virtual host. Note that if the + VirtualHost + is set for an address and port that the + server is not listening to, it cannot be accessed.

+
+
From 87ed51c2afb8d810014974be8fe49113b162365a Mon Sep 17 00:00:00 2001 From: Isidore Wang Date: Sat, 14 Nov 2026 10:12:29 +0800 Subject: [PATCH 2/9] Translating bind.xml, section id is reload. --- docs/manual/bind.xml.zh-cn | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/docs/manual/bind.xml.zh-cn b/docs/manual/bind.xml.zh-cn index 99687788a38..9d18f562b20 100644 --- a/docs/manual/bind.xml.zh-cn +++ b/docs/manual/bind.xml.zh-cn @@ -85,17 +85,16 @@ Listen 192.0.2.5:8000 -

Overlapping Listen directives will result in a - fatal error which will prevent the server from starting up.

+

重复的Listen指令会产生致命错误,从而导致服务器无法正常启动。

(48)Address already in use: make_sock: could not bind to address [::]:80 -

See the - discussion in the wiki for further troubleshooting tips.

+

请查阅wiki上的相关讨论 + 以进一步了解如何排查问题。

@@ -104,15 +103,12 @@ Listen 192.0.2.5:8000
Changing Listen configuration on restart -

When httpd is restarted, special consideration must be made for - changes to Listen directives. During a restart, httpd keeps ports - bound (as in the original configuration) to avoid generating - "Connection refused" errors for any new attempts to connect to the - server. If changes are made to the set of Listen directives used - which conflict with the old configuration, configuration will fail - and the server will terminate.

+

重启httpd时,需要特别注意与Listen指令相关的更改。 + 重启过程中,httpd会保持原有绑定端口(即原始配置中指示服务器绑定的端口)不变以避免其他客户端在尝试连接 + 服务器时出现“Connection refused”错误。如果修改后的Listen指令与原有配置冲突, + 那么服务器将会停止运行。

-

For example, changing from configuration:

+

例如下面的配置

@@ -120,9 +116,7 @@ Listen 192.0.2.5:8000 -

to the following may fail, because binding to port 80 across - all addresses conflicts with binding to port 80 on just - 127.0.0.1.

+

修改为下面的配置可能会失败,因为在所有IP地址绑定80端口与仅在127.0.0.1绑定端口相冲突。

@@ -130,8 +124,7 @@ Listen 192.0.2.5:8000 -

To have such configuration changes take effect, it is necessary - to stop and then start the server.

+

如果想要进行此类修改,就必须先停止服务器,然后再重新启动服务器。

From efc5da3da682622eee4572cf6ed587ea1f5191c9 Mon Sep 17 00:00:00 2001 From: Isidore Wang Date: Sat, 14 Nov 2026 11:00:35 +0800 Subject: [PATCH 3/9] Translating bind.xml, selction id is ipv6 --- docs/manual/bind.xml.zh-cn | 58 ++++++++++++++------------------------ 1 file changed, 21 insertions(+), 37 deletions(-) diff --git a/docs/manual/bind.xml.zh-cn b/docs/manual/bind.xml.zh-cn index 9d18f562b20..e80fc257e7c 100644 --- a/docs/manual/bind.xml.zh-cn +++ b/docs/manual/bind.xml.zh-cn @@ -129,38 +129,24 @@ Listen 192.0.2.5:8000
- Special IPv6 Considerations - -

A growing number of platforms implement IPv6, and - APR supports IPv6 on most of these platforms, - allowing httpd to allocate IPv6 sockets, and to handle requests sent - over IPv6.

- -

One complicating factor for httpd administrators is whether or - not an IPv6 socket can handle both IPv4 connections and IPv6 - connections. Handling IPv4 connections with an IPv6 socket uses - IPv4-mapped IPv6 addresses, which are allowed by default on most - platforms, but are disallowed by default on FreeBSD, NetBSD, and - OpenBSD, in order to match the system-wide policy on those - platforms. On systems where it is disallowed by default, a - special configure parameter can change this behavior - for httpd.

- -

On the other hand, on some platforms, such as Linux and Tru64, the - only way to handle both IPv6 and IPv4 is to use - mapped addresses. If you want httpd to handle IPv4 and IPv6 connections - with a minimum of sockets, which requires using IPv4-mapped IPv6 - addresses, specify the --enable-v4-mapped - configure option.

- -

--enable-v4-mapped is the default on all platforms except - FreeBSD, NetBSD, and OpenBSD, so this is probably how your httpd was - built.

- -

If you want httpd to handle IPv4 connections only, regardless of - what your platform and APR will support, specify an IPv4 address on all - Listen directives, as in the - following examples:

+ IPv6特别注意事项 + +

越来越多的平台开始支持IPv6,而APR在大多数平台上也都支持IPv6, + 这使得httpd可以分配IPv6套接字,并能够处理通过IPv6发送的请求。 + + 对于httpd管理员而言,有一个比较复杂的问题,即IPv6套接字是否能够同时处理IPv4和IPv6连接。 + 在大多数平台上,默认情况下可以使用IPv4映射的IPv6地址来在IPv6套接字上处理IPv4连接。但是由于 + FreeBSD、NetBSD、OpenBSD的系统策略,在这些平台上默认是禁止使用IPv4映射的IPv6地址的。对于禁止 + 使用IPv4映射的IPv6地址的系统上,可以使用一个特殊的configure参数来改变httpd的行为。

+ +

此外,在某些平台(例如Linux和Tru64)上则是只能使用IPv4映射的IPv6地址来同时处理IPv6和IPv4连接。 + 如果您希望使用尽可能少的套接字来处理IPv4和IPv6连接,请指定--enable-v4-mapped + configure选项以启用IPv4映射的IPv6地址。

+ +

除FreeBSD、NetBSD、OpenBSD外,所有平台都默认启用--enable-v4-mapped。

+ +

如果您希望httpd不考虑平台和APR支持的功能,只处理IPv4连接,请如下例所示,在所有Listen + 指令处指定IPv4地址。

@@ -169,11 +155,9 @@ Listen 192.0.2.1:80 -

If your platform supports it and you want httpd to handle IPv4 and - IPv6 connections on separate sockets (i.e., to disable IPv4-mapped - addresses), specify the --disable-v4-mapped - configure option. --disable-v4-mapped is the - default on FreeBSD, NetBSD, and OpenBSD.

+

如果您正在使用的平台支持,且您希望httpd通过独立的套接字处理IPv4和IPv6连接(即禁用IPv4映射的IPv6地址), + 请指定configure的--disable-v4-mapped选项。在FreeBSD、NetBSD、OpenBSD上, + --disable-v4-mapped是默认选项。

From db46c8e7df8634178cc58ef3b30324a54e0bf12e Mon Sep 17 00:00:00 2001 From: Isidore Wang Date: Sat, 14 Nov 2026 11:08:24 +0800 Subject: [PATCH 4/9] Translating bind.xml, section id is protocol. --- docs/manual/bind.xml.zh-cn | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/docs/manual/bind.xml.zh-cn b/docs/manual/bind.xml.zh-cn index e80fc257e7c..920d1cf26a7 100644 --- a/docs/manual/bind.xml.zh-cn +++ b/docs/manual/bind.xml.zh-cn @@ -161,18 +161,12 @@ Listen 192.0.2.1:80
- Specifying the protocol with Listen -

The optional second protocol argument of - Listen - is not required for most - configurations. If not specified, https is the default for - port 443 and http the default for all other ports. The - protocol is used to determine which module should handle a request, and - to apply protocol specific optimizations with the - AcceptFilter directive.

- -

You only need to set the protocol if you are running on non-standard - ports. For example, running an https site on port 8443:

+ 指定监听的协议 +

Listen指令中可选的第二个参数,大多数情况下不是必须的。 + 如果没有指定,443端口的默认协议是https,其他端口的默认协议则是http。该参数用于 + 确定由哪个模块处理请求,以及适用通过AcceptFilter指令设置的针对特定协议的优化。

+ +

只有在使用非标准端口时,才需要设置协议参数。例如,在8443端口上运行一个https网站。

From 8e5ebcde98e7f9c713c109288a9dbbefe12f973d Mon Sep 17 00:00:00 2001 From: Isidore Wang Date: Sat, 14 Nov 2026 11:18:51 +0800 Subject: [PATCH 5/9] Translating bind..xml, section id is virtualhost. bind.xml translated. --- docs/manual/bind.xml.zh-cn | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/docs/manual/bind.xml.zh-cn b/docs/manual/bind.xml.zh-cn index 920d1cf26a7..e86ece2eb11 100644 --- a/docs/manual/bind.xml.zh-cn +++ b/docs/manual/bind.xml.zh-cn @@ -176,25 +176,14 @@ Listen 192.0.2.1:80
- How This Works With Virtual Hosts - -

The Listen directive does not implement - Virtual Hosts - it only tells the - main server what addresses and ports to listen on. If no - VirtualHost - directives are used, the server will behave - in the same way for all accepted requests. However, - VirtualHost - can be used to specify a different behavior - for one or more of the addresses or ports. To implement a - VirtualHost, the server must first be told to listen to the - address and port to be used. Then a - VirtualHost section - should be created for the specified address and port to set the - behavior of this virtual host. Note that if the - VirtualHost - is set for an address and port that the - server is not listening to, it cannot be accessed.

+ 虚拟主机如何工作 + +

Listen指令本身不能实现虚拟主机的功能,它仅用于告知主服务器需要监听哪些地址和端口。 + 如果没有指定VirtualHost指令,那么服务器将以相同方式处理接收到的所有请求。 + 可以使用VirtualHost指令来为一个或多个特定的地址或端口给服务器设置不同的行为。 + 要实现虚拟主机,首先需要指示服务器监听所要使用的地址和端口。然后设置VirtualHost + 区块,为该虚拟主机设置相应的地址、端口,以及服务器处理请求时的行为。 + 注意,如果VirtualHost中指示的地址和端口并未被服务器监听,那么客户端无法访问虚拟主机。

From 7a0a080dd01abf3620003e0ba96e819f2238e1cd Mon Sep 17 00:00:00 2001 From: Isidore Wang Date: Sat, 14 Nov 2026 11:24:04 +0800 Subject: [PATCH 6/9] fix bind.xml.zh-cn --- docs/manual/bind.xml.zh-cn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/manual/bind.xml.zh-cn b/docs/manual/bind.xml.zh-cn index e86ece2eb11..e965327970e 100644 --- a/docs/manual/bind.xml.zh-cn +++ b/docs/manual/bind.xml.zh-cn @@ -85,7 +85,7 @@ Listen 192.0.2.5:8000 -

重复的

相互重叠或冲突的Listen指令会产生致命错误,从而导致服务器无法正常启动。

From ffd453c2c0e33208a6d4343f82ff6cf67e53940f Mon Sep 17 00:00:00 2001 From: Isidore Wang Date: Sat, 14 Nov 2026 11:25:19 +0800 Subject: [PATCH 7/9] fix bind.xml.zh-cn --- docs/manual/bind.xml.zh-cn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/manual/bind.xml.zh-cn b/docs/manual/bind.xml.zh-cn index e965327970e..fba24f316f5 100644 --- a/docs/manual/bind.xml.zh-cn +++ b/docs/manual/bind.xml.zh-cn @@ -46,7 +46,7 @@ -

httpd在启动时会绑定到本地机器的某些端口和地址,以接受入站请求。 +

httpd在启动时会到本地机器的某些端口和地址,以接受入站请求。 默认情况下,httpd会监听本地机器的所有地址。不过,有时可能需要对其进行配置, 指定它监听哪些端口、仅监听哪些特定地址,或者同时指定端口和地址。 这通常会与虚拟主机功能结合使用,决定httpd如何响应发往 @@ -104,7 +104,7 @@ Listen 192.0.2.5:8000 Changing Listen configuration on restart

重启httpd时,需要特别注意与Listen指令相关的更改。 - 重启过程中,httpd会保持原有绑定端口(即原始配置中指示服务器绑定的端口)不变以避免其他客户端在尝试连接 + 重启过程中,httpd会保持原有绑定端口(即原始配置中指示服务器绑定的端口)的绑定状态不变以避免其他客户端在尝试连接 服务器时出现“Connection refused”错误。如果修改后的Listen指令与原有配置冲突, 那么服务器将会停止运行。

From de9f262e18f02573fa19cbd93b7b3e8e0274cf18 Mon Sep 17 00:00:00 2001 From: He-TW Date: Sat, 14 Nov 2026 16:23:21 +0800 Subject: [PATCH 8/9] =?UTF-8?q?bind=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/manual/bind.xml.zh-cn | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/manual/bind.xml.zh-cn b/docs/manual/bind.xml.zh-cn index fba24f316f5..fffa2f59f3b 100644 --- a/docs/manual/bind.xml.zh-cn +++ b/docs/manual/bind.xml.zh-cn @@ -46,7 +46,7 @@ -

httpd在启动时会到本地机器的某些端口和地址,以接受入站请求。 +

httpd在启动时会绑定到本地机器的某些端口和地址,以接受入站请求。 默认情况下,httpd会监听本地机器的所有地址。不过,有时可能需要对其进行配置, 指定它监听哪些端口、仅监听哪些特定地址,或者同时指定端口和地址。 这通常会与虚拟主机功能结合使用,决定httpd如何响应发往 @@ -59,7 +59,7 @@ 监听多个地址和端口,服务器会响应任何来自列在Listen指令中 端口和地址的请求。

-

例如如果按下面的配置设置,服务器会接受所有接口中来自80、8000端口的连接:

+

例如,如果按下面的配置设置,服务器会接受所有接口中来自80、8000端口的连接:

@@ -124,7 +124,7 @@ Listen 192.0.2.5:8000 -

如果想要进行此类修改,就必须先停止服务器,然后再重新启动服务器。

+

如果想要此类修改生效,就必须先停止服务器,然后再重新启动服务器。

@@ -135,8 +135,8 @@ Listen 192.0.2.5:8000 这使得httpd可以分配IPv6套接字,并能够处理通过IPv6发送的请求。 对于httpd管理员而言,有一个比较复杂的问题,即IPv6套接字是否能够同时处理IPv4和IPv6连接。 - 在大多数平台上,默认情况下可以使用IPv4映射的IPv6地址来在IPv6套接字上处理IPv4连接。但是由于 - FreeBSD、NetBSD、OpenBSD的系统策略,在这些平台上默认是禁止使用IPv4映射的IPv6地址的。对于禁止 + 在大多数平台上,默认情况下可以使用IPv4映射的IPv6地址来在IPv6套接字上处理IPv4连接。为保持与 + FreeBSD、NetBSD、OpenBSD的系统策略一致,在这些平台上默认是禁止使用IPv4映射的IPv6地址的。对于禁止 使用IPv4映射的IPv6地址的系统上,可以使用一个特殊的configure参数来改变httpd的行为。

此外,在某些平台(例如Linux和Tru64)上则是只能使用IPv4映射的IPv6地址来同时处理IPv6和IPv4连接。 @@ -182,7 +182,7 @@ Listen 192.0.2.1:80 module="mpm_common">Listen指令本身不能实现虚拟主机的功能,它仅用于告知主服务器需要监听哪些地址和端口。 如果没有指定VirtualHost指令,那么服务器将以相同方式处理接收到的所有请求。 可以使用VirtualHost指令来为一个或多个特定的地址或端口给服务器设置不同的行为。 - 要实现虚拟主机,首先需要指示服务器监听所要使用的地址和端口。然后设置VirtualHost + 要实现虚拟主机功能,首先需要指示服务器监听所要使用的地址和端口。然后设置VirtualHost 区块,为该虚拟主机设置相应的地址、端口,以及服务器处理请求时的行为。 注意,如果VirtualHost中指示的地址和端口并未被服务器监听,那么客户端无法访问虚拟主机。

From e9269096293128f09430de98ab0eec2293114311 Mon Sep 17 00:00:00 2001 From: He-TW Date: Sat, 14 Nov 2026 16:31:11 +0800 Subject: [PATCH 9/9] add reviewer --- docs/manual/bind.xml.zh-cn | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/manual/bind.xml.zh-cn b/docs/manual/bind.xml.zh-cn index fffa2f59f3b..81cec9856d1 100644 --- a/docs/manual/bind.xml.zh-cn +++ b/docs/manual/bind.xml.zh-cn @@ -3,6 +3,7 @@ +