Translation

(itstool) path: sect3/para
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>.
142/1960
Context English Chinese (Simplified) (zh_CN) State
<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
<primary>Python</primary> <primary>Python</primary>
<primary>Django</primary> <primary>Django</primary>
<application>Django</application> is a BSD-licensed framework designed to allow developers to write high performance, elegant web applications quickly. It provides an object-relational mapper so that data types are developed as <application>Python</application> objects. A rich dynamic database-access <acronym>API</acronym> is provided for those objects without the developer ever having to write <acronym>SQL</acronym>. It also provides an extensible template system so that the logic of the application is separated from the <acronym>HTML</acronym> presentation. <application>Django</application>是以BSD授权的框架(Framework),指在让开发人员能快速的写出高效、优雅的网页应用程序。它提供了物件关联对应器(Object-relational mapper),所以各种数据型态可当做<application>Python</application>的物件来开发,且提供了丰富的动态数据库存取<acronym>API</acronym>给这些物件,让开发人员不再需要写<acronym>SQL</acronym>。它也同时提供了可扩充的样板系统,来让应用程序的逻辑与<acronym>HTML</acronym>呈现能够被拆开。
Django depends on <filename>mod_python</filename>, and an <acronym>SQL</acronym> database engine. In FreeBSD, the <package>www/py-django</package> port automatically installs <filename>mod_python</filename> and supports the <application>PostgreSQL</application>, <application>MySQL</application>, or <application>SQLite</application> databases, with the default being <application>SQLite</application>. To change the database engine, type <command>make config</command> within <filename>/usr/ports/www/py-django</filename>, then install the port. Django需要<filename>mod_python</filename>,以及一个<acronym>SQL</acronym>数据库引擎才能运作。在FreeBSD中的<package>www/py-django</package> Port会自动安装<filename>mod_python</filename>以及对<application>PostgreSQL</application>,<application>MySQL</application>或<application>SQLite</application>数据库的支持,预设为<application>SQLite</application>,要更改数据库引擎可在<filename>/usr/ports/www/py-django</filename>输入<command>make config</command>然后再安装该Port。
Once <application>Django</application> is installed, the application will need a project directory along with the <application>Apache</application> configuration in order to use the embedded <application>Python</application> interpreter. This interpreter is used to call the application for specific <acronym>URL</acronym>s on the site. <application>Django</application>安装完成之后,应用程序会需要一个项目目录并搭配<application>Apache</application>设定才能使用内嵌的<application>Python</application>直译器,此直译器会用来呼叫网站上指定<acronym>URL</acronym>的应用程序。

Loading…

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 指令中添加相同的行。
a month ago
Browse all component changes

Glossary

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

Source information

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