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

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

我很抱歉问这个问题,但我真的是个菜鸟,搜索也没有帮助。.so
和 .c mods 之间有什么区别?

接下来,再次为如此广泛、通用且可能难以确定的问题道歉,我将不胜感激所有建议,
我有一台小型 VPS(4 x 四核、3GB RAM、Xen、CentOS 6 64 位、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.

我想我不需要这个。

我将非常感激您的指导。谢谢。

答案1

我不确定我是否会将其称为小型 VPS,但无论如何 ;)。

您对 Linux 有多熟悉?我认为您可以将 Web 服务器切换到 nginx,这样可以节省大量资源。

至于模块:不要管 auth 模块。我知道 auth basic 是您在 cPanel/WHM 中密码保护目录时使用的模块。其他模块大多看起来很重要。我自己会保留其他模块,以避免破坏任何功能。

我只是假设 cPanel 编译的内容可能在某个地方需要;无论是在您的站点中还是在 cPanel/WHM UI 中。

相关内容