Translation

(itstool) path: note/para
English
There is a separate <filename role="port">mod_http2</filename> port that is available. It exists to deliver security and bug fixes quicker than the module installed with the bundled <filename role="port">apache24</filename> port. It is not required for <acronym>HTTP</acronym>2 support but is available. When installed, the <filename>mod_h2.so</filename> should be used in place of <filename>mod_http2.so</filename> in the <application>Apache</application> configuration.
255/4710
Context English Chinese (Simplified) (zh_CN) State
As before, the Apache configuration will need to be reloaded for the changes to take effect, even in cases where it was just a module install. 和之前一样,Apache的配置需要重新加载才能生效,即使在只是安装模块的情况下也是如此。
To perform a graceful restart to reload the configuration, issue the following command: 使用以下命令重启 Apache 来载入配置文件:
<prompt>#</prompt> <userinput>apachectl graceful</userinput> <prompt>#</prompt> <userinput>apachectl graceful</userinput>
Once the install is complete, there are two methods of obtaining the installed <acronym>PHP</acronym> support modules and the environmental information of the build. The first is to install the full <acronym>PHP</acronym> binary and running the command to gain the information: 安装完成后,有两种方法可以获得 <acronym>PHP</acronym> 支持模块信息和当前版本的编译参数。第一种是安装完整的 <acronym>PHP</acronym> 二进制程序并执行命令获取信息:
<prompt>#</prompt> <userinput>pkg install php74</userinput> <prompt>#</prompt> <userinput>pkg install php74</userinput>
<prompt>#</prompt> <userinput>php -i |less</userinput> <prompt>#</prompt> <userinput>php -i |less</userinput>
It is necessary to pass the output to a pager, such as the <command>more</command> or <command>less</command> to easier digest the amount of output. 在碰到大量输出文本时,可以将其重定向到分页器,比如 <command>more</command> 或 <command>less</command>,让阅读变得更方便。
Finally, to make any changes to the global configuration of <acronym>PHP</acronym> there is a well documented file installed into <filename role="directory">/usr/local/etc/php.ini</filename>. At the time of install, this file will not exist because there are two versions to choose from, one is <filename>php.ini-development</filename> and the other is <filename>php.ini-production</filename>. These are starting points to assist administrators in their deployment. 最后,如果需要修改<acronym>PHP</acronym>的全局配置信息,编辑 <filename role="directory">/usr/local/etc/php.ini</filename> 。安装时这个文件不存在,有两个版本可供选择,一个是 <filename>php.ini-development</filename> ,另一个是 <filename>php.ini-production</filename>。这两个文件可帮助管理员进行快速配置。
HTTP2 Support HTTP2 支持
<application>Apache</application> support for the <acronym>HTTP</acronym>2 protocol is included by default when installing the port with <command>pkg</command>. The new version of <acronym>HTTP</acronym> includes many improvements over the previous version, including utilizing a single connection to a website, reducing overall roundtrips of <acronym>TCP</acronym> connections. Also, packet header data is compressed and <acronym>HTTP</acronym>2 requires encryption by default. 使用 <command>pkg</command> 安装的 <application>Apache</application>,默认启用 <acronym>HTTP</acronym>2 协议支持。新版本的 <acronym>HTTP</acronym> 与之前的版本相比有许多改进,包括利用单个连接到网站,减少 <acronym>TCP</acronym> 握手次数。此外,数据包头数据已被压缩,<acronym>HTTP</acronym>2 默认需要加密。
When <application>Apache</application> is configured to only use <acronym>HTTP</acronym>2, web browsers will require secure, encrypted <acronym>HTTPS</acronym> connections. When <application>Apache</application> is configured to use both versions, <acronym>HTTP</acronym>1.1 will be considered a fall back option if any issues arise during the connection. 当 <application>Apache</application> 配置为只使用 <acronym>HTTP</acronym>2 时,网络浏览器将使用 <acronym>HTTPS</acronym> 协议。当<application>Apache</application> 被配置为使用两个版本时,如果在连接过程中出现任何问题,<acronym>HTTP</acronym> 1.1将被视为后备选项。
While this change does require administrators to make changes, they are positive and equate to a more secure Internet for everyone. The changes are only required for sites not currently implementing <acronym>SSL</acronym> and <acronym>TLS</acronym>. 虽然这一变化需要管理员做出,但它们是积极的,为每个人提供了一个更安全的互联网连接。只有目前没有使用<acronym>SSL</acronym>和<acronym>TLS</acronym>的网站才需要进行更改。
This configuration depends on the previous sections, including <acronym>TLS</acronym> support. It is recommended those instructions be followed before continuing with this configuration. 此配置与前述章节相关,例如 <acronym>TLS</acronym> 支持。建议在继续进行配置之前,先遵循这些说明。
Start the process by enabling the <acronym>http</acronym>2 module by uncommenting the line in <filename>/usr/local/etc/apache24/httpd.conf</filename> and replace the mpm_prefork module with mpm_event as the former does not support <acronym>HTTP</acronym>2. 取消<filename>/usr/local/etc/apache24/httpd.conf</filename>中相关行的注释来启用<acronym>http</acronym>2模块,用 pmm_event 替换 pmm_prefork 模块,因为前者不支持 <acronym>HTTP</acronym>2。
LoadModule http2_module libexec/apache24/mod_http2.so
LoadModule mpm_event_module libexec/apache24/mod_mpm_event.so
LoadModule http2_module libexec/apache24/mod_http2.so
LoadModule mpm_event_module libexec/apache24/mod_mpm_event.so
There is a separate <filename role="port">mod_http2</filename> port that is available. It exists to deliver security and bug fixes quicker than the module installed with the bundled <filename role="port">apache24</filename> port. It is not required for <acronym>HTTP</acronym>2 support but is available. When installed, the <filename>mod_h2.so</filename> should be used in place of <filename>mod_http2.so</filename> in the <application>Apache</application> configuration. <filename role="port">mod_http2</filename>模块也可提供 HTTP2 支持。它比<filename role="port">apache24</filename>更快地提供安全和错误修复。<acronym>HTTP</acronym>2 支持不需要它。安装时应使用<filename>mod_h2.so</filename>代替<application>Apache</application>配置中的<filename>mod_http2.so</filename>。
There are two methods to implement <acronym>HTTP</acronym>2 in <application>Apache</application>; one way is globally for all sites and each VirtualHost running on the system. To enable <acronym>HTTP</acronym>2 globally, add the following line under the ServerName directive: <application>Apache</application> 中有两种实现 <acronym>HTTP</acronym>2 的方法;一种是在全局范围内启用,系统上所有的 VirtualHost 都启用 HTTP2。要在全局范围内启用<acronym>HTTP</acronym>2,请在ServerName指令下添加以下行:
Protocols h2 http/1.1 Protocols h2 http/1.1
To enable <acronym>HTTP</acronym>2 over plaintext, use <acronym>h2</acronym> <acronym>h2c</acronym> <acronym>http</acronym>/1.1 in the <filename>httpd.conf</filename>. 为启用 <acronym>HTTP</acronym>2 over plaintext,在 <filename>httpd.conf</filename> 写入 <acronym>h2</acronym> <acronym>h2c</acronym> <acronym>http</acronym>/1.1。
Having the <acronym>h2c</acronym> here will allow plaintext <acronym>HTTP</acronym>2 data to pass on the system but is not recommended. In addition, using the <acronym>http</acronym>/1.1 here will allow fallback to the <acronym>HTTP</acronym>1.1 version of the protocol should it be needed by the system. 在这里使用<acronym>h2c</acronym>将允许纯文本<acronym>HTTP</acronym>2数据在系统中传递,但不建议使用。此外,在这里使用 <acronym>http</acronym>/1.1 将允许在系统需要时回退到 <acronym>HTTP</acronym>1.1 。
To enable <acronym>HTTP</acronym>2 for individual VirtualHosts, add the same line within the VirtualHost directive in either <filename>httpd.conf</filename> or <filename>httpd-ssl.conf</filename>. 为某个 VirtualHost 启用 <acronym>HTTP</acronym>2,请在 <filename>httpd.conf</filename> 或 <filename>httpd-ssl.conf</filename> 中的 VirtualHost 指令中添加相同的行。
Reload the configuration using the <command>apachectl</command> <parameter>reload</parameter> command and test the configuration either by using either of the following methods after visiting one of the hosted pages: 使用<command>apachectl</command> <parameter>reload</parameter>命令重新加载配置,并在访问其中一个托管页面后使用以下任一方法测试配置:
<prompt>#</prompt> <userinput>grep "HTTP/2.0" /var/log/httpd-access.log</userinput> <prompt>#</prompt> <userinput>grep "HTTP/2.0" /var/log/httpd-access.log</userinput>
This should return something similar to the following: 返回结果像这样:
192.168.1.205 - - [18/Oct/2020:18:34:36 -0400] "GET / HTTP/2.0" 304 -
192.0.2.205 - - [18/Oct/2020:19:19:57 -0400] "GET / HTTP/2.0" 304 -
192.0.0.205 - - [18/Oct/2020:19:20:52 -0400] "GET / HTTP/2.0" 304 -
192.0.2.205 - - [18/Oct/2020:19:23:10 -0400] "GET / HTTP/2.0" 304 -
192.168.1.205 - - [18/Oct/2020:18:34:36 -0400] "GET / HTTP/2.0" 304 -
192.0.2.205 - - [18/Oct/2020:19:19:57 -0400] "GET / HTTP/2.0" 304 -
192.0.0.205 - - [18/Oct/2020:19:20:52 -0400] "GET / HTTP/2.0" 304 -
192.0.2.205 - - [18/Oct/2020:19:23:10 -0400] "GET / HTTP/2.0" 304 -
The other method is using the web browser's built in site debugger or <command>tcpdump</command>; however, using either method is beyond the scope of this document. 另一种方法是使用Web浏览器内置的站点调试器或<command>tcpdump</command>;然而这两种方法都超出了本文的讨论范围。
Support for <acronym>HTTP</acronym>2 reverse proxy connections by using the <filename>mod_proxy_http2.so</filename> module. When configuring the ProxyPass or RewriteRules [P] statements, they should use h2:// for the connection. 通过<filename>mod_proxy_http2.so</filename>模块支持<acronym>HTTP</acronym>2反向代理连接。当配置 ProxyPass 或 RewriteRules [P] 语句时,应使用 h2:// 连接。
Dynamic Websites 动态网站
<primary>web servers</primary> <secondary>dynamic</secondary> <primary>web 服务器</primary> <secondary>dynamic</secondary>
In addition to <application>mod_perl</application> and <application>mod_php</application>, other languages are available for creating dynamic web content. These include <application>Django</application> and <application>Ruby on Rails</application>. 除了<application>mod_perl</application>与<application>mod_php</application>外,也有其他语言可用来建立动态网页内容,这包含了<application>Django</application>与<application>Ruby on Rails</application>。
Django Django

Loading…

There is a separate <filename role="port">mod_http2</filename> port that is available. It exists to deliver security and bug fixes quicker than the module installed with the bundled <filename role="port">apache24</filename> port. It is not required for <acronym>HTTP</acronym>2 support but is available. When installed, the <filename>mod_h2.so</filename> should be used in place of <filename>mod_http2.so</filename> in the <application>Apache</application> configuration.
<filename role="port">mod_http2</filename>模块也可提供 HTTP2 支持。它比<filename role="port">apache24</filename>更快地提供安全和错误修复。<acronym>HTTP</acronym>2 支持不需要它。安装时应使用<filename>mod_h2.so</filename>代替<application>Apache</application>配置中的<filename>mod_http2.so</filename>。
a month ago
Browse all component changes

Things to check

XML markup

XML tags in translation do not match source

Reset

Glossary

English Chinese (Simplified) (zh_CN)
No related strings found in the glossary.

Source information

Source string comment
(itstool) path: note/para
Source string location
book.translate.xml:58677
String age
2 months ago
Source string age
2 months ago
Translation file
books/zh_CN/handbook.po, string 9602