Apache-2.2

我的小型 VPS 需要哪些 Apache 模組?

  • October 28, 2012

我很抱歉這個問題,但我真的是一個菜鳥,搜尋沒有幫助

.so 和 .c mods 有什麼區別?

接下來,我再次為這樣一個廣泛的、通用的、可能難以確定的問題道歉,我將非常感謝

我有一個小型 VPS(4 x 四核,3GB RAM,Xen,CentOS 6 64- bit、Apache、cPanel、PHP、mySQL。腳本:WordPress、OpenCart、bbPress、phpBB、Menalto Gallery)。我正在嘗試擺脫所有我不需要/不使用的模組。請你能幫我確定我應該刪除哪些?

我的主人說:載入的 Apache 模組是:

在模組中編譯:

`core.c

Core Apache HTTP Server features that are always available`

對我來說似乎很清楚這是核心,因此是必需的。

http_core.c

不知道這是什麼。但我懷疑它與核心有關,因此打算不理會它。

`prefork.c

This Multi-Processing Module (MPM) implements a non-threaded, pre-forking web server that handles requests in a manner similar to Apache 1.3. It is appropriate for sites that need to avoid threading for compatibility with non-thread-safe libraries.`

再說一次,不知道這個胡言亂語是什麼意思。什麼是執行緒?什麼是執行緒安全庫?哪些庫是非執行緒安全的?

我之前的理解是 prefork 所做的是預載入一些程式碼,這樣就不需要在請求時載入它,因此可以快速處理請求。

但現在我很困惑。

保留還是放棄?

`mod_actions.c

This module has two directives. The Action directive lets you run CGI scripts whenever a file of a certain MIME content type is requested. The Script directive lets you run CGI scripts whenever a particular method is used in a request.`

好的,所以,我懷疑我需要這個,因為腳本確實處理文件的上傳、下載和管理,包括圖像/媒體和其他類型

`mod_alias.c

The directives contained in this module allow for manipulation and control of URLs as requests arrive at the server.`

好的,我很確定我需要那個。

`mod_asis.c

This module provides the handler send-as-is which causes Apache to send the document without adding most of the usual HTTP headers.

This can be used to send any kind of data from the server, including redirects and other special HTTP responses, without requiring a cgi-script or an nph script.`

嗯……不確定……有哪些有用/使用情況的例子?

`mod_auth_basic.c

mod_authn_default.c

mod_authn_file.c

This module allows the use of HTTP Basic Authentication to restrict access by looking up users in the given providers.`

不太清楚這意味著什麼以及它的用途。如果我禁用此功能,我的腳本將無法處理登錄/註銷功能嗎?這是指哪個特定的身份驗證?

`mod_authz_default.c

mod_authz_groupfile.c

mod_authz_host.c

mod_authz_user.c

The directives provided by mod_authz_host are used in <Directory>, <Files>, and <Location> sections as well as .htaccess files to control access to particular parts of the server.`

好的,我知道我需要 mod_authz_host。但是我的 VPS 上只有一個使用者。我需要 authz_default、authz_user 和 authz_groupfile 嗎?

`mod_autoindex.c

Generates directory indexes, automatically, similar to the Unix ls command or the Win32 dir shell command`

好的,所以,需要。

`mod_cache.c

Content cache keyed to URIs`

我懷疑這已由 mod_pagespeed 啟用,所以我將不理會它。

`mod_cgi.c

Any file that has the handler cgi-script will be treated as a CGI script, and run by the server, with its output being returned to the client.`

我懷疑這是非常需要的。

`mod_deflate.c

Compress content before it is delivered to the client` 是的,需要它。

`mod_dir.c

Provides for “trailing slash” redirects and serving directory index files`

我想這也是需要的。

`mod_expires.c

Generation of Expires and Cache-Control HTTP headers according to user-specified criteria`

是的,我需要這個。

`mod_filter.c

This module enables smart, context-sensitive configuration of output content filters. For example, apache can be configured to process different content-types through different filters, even when the content-type is not known in advance (e.g. in a proxy).`

說什麼?

`mod_imagemap.c

This module processes .map files, thereby replacing the functionality of the imagemap CGI program.`

還是不明白。在哪些情況下需要這樣做?

`mod_include.c

This module provides a filter which will process files before they are sent to the client. The processing is controlled by specially formatted SGML comments, referred to as elements. These elements allow conditional text, the inclusion of other files or programs, as well as the setting and printing of environment variables.`

聽起來像是可能需要的東西。

`mod_info.c

Provides a comprehensive overview of the server configuration`

不確定我是否需要這個。無論如何,我的 cPanel 中沒有可用的伺服器配置資訊嗎?

`mod_log_config.c

This module provides for flexible logging of client requests. Logs are written in a customizable format, and may be written directly to a file, or to an external program.`

聽起來很重要。想著就不管了。

`mod_logio.c

This module provides the logging of input and output number of bytes received/sent per request.`

聽起來像是會佔用大量儲存空間的東西。我需要嗎?

`mod_mem_cache.c

Content cache keyed to URIs`

再次懷疑 mod_pagespeed 的工作。不理它。

`mod_mime.c

mod_mime_magic.c

Associates the requested filename’s extensions with the file’s behavior (handlers and filters) and content (mime-type, language, character set and encoding)`

聽起來很重要。不理它。

`mod_negotiation.c

Content negotiation, or more accurately content selection, is the selection of the document that best matches the clients capabilities, from one of several available documents.`

聽起來很重要。不理它。

`mod_proxy.c

mod_proxy_ajp.c

mod_proxy_balancer.c

mod_proxy_connect.c

mod_proxy_ftp.c

mod_proxy_http.c

mod_proxy_scgi.c

HTTP/1.1 proxy/gateway server`

我有一個帶有 domain1.com 的網站,我也有另一個 domain2.com 映射到它。然後有子域,例如 de.domain3.com 和 fr.domain3.com 也作為附加域。我需要這些代理模組嗎?他們與域有什麼關係嗎?它們是用來做什麼的?

`mod_rewrite.c

Provides a rule-based rewriting engine to rewrite requested URLs on the fly`

WordPress、OpenCart 和 Menalto 都使用“漂亮的 URL”,所以這是必須的。

`mod_setenvif.c

The mod_setenvif module allows you to set internal environment variables according to whether different aspects of the request match regular expressions you specify.`

聽起來像是需要的東西。

`mod_so.c

Loading of executable code and modules into the server at start-up or restart time`

這可能是整個模組系統工作所必需的。

`mod_ssl.c

Strong cryptography using the Secure Sockets Layer (SSL) and Transport Layer Security (TLS) protocols`

我需要這個嗎?我什至在使用 SSL 嗎?

`mod_status.c

The Status module allows a server administrator to find out how well their server is performing. A HTML page is presented that gives the current server statistics in an easily readable form.`

這是多麼可有可無?是否有其他方法可以獲得相同的資訊?

`mod_suexec.c

Allows CGI scripts to run as a specified user and Group`

我想我需要這個,因為我的 PHP 處理程序是 suPHP

`mod_unique_id.c

Provides an environment variable with a unique identifier for each request`

這在哪些條件下很重要/有用?

`mod_userdir.c

his module allows user-specific directories to be accessed using the http://example.com/~user/ syntax.`

我想我不需要這個。

我將不勝感激任何指導。謝謝你。

我不確定我是否會稱其為小型 VPS,但無論如何;)。

您對 Linux 的體驗如何?我認為您可能可以將 Web 伺服器切換到 nginx 並節省大量資源。

至於模組:不要理會身份驗證模組。我知道 auth basic 是您在 cPanel/WHM 中密碼保護目錄時使用的模組。其他的看起來很重要。我自己會把其他人留在裡面,以避免破壞任何功能。

我只是假設某處可能需要編譯的cPanel;無論是在您的網站中還是在 cPanel/WHM UI 中。

引用自:https://serverfault.com/questions/443163