mirror of
https://github.com/LCTT/TranslateProject.git
synced 2024-12-29 21:41:00 +08:00
commit
96f2d08dc2
@ -1,26 +1,24 @@
|
|||||||
translating---geekpi
|
如何在Linux中检查Apache的模块已经加载
|
||||||
|
|
||||||
How to Check Which Apache Modules are Enabled/Loaded in Linux
|
|
||||||
============================================================
|
============================================================
|
||||||
|
|
||||||
In this guide, we will briefly talk about the Apache web server front-end and how to list or check which Apache modules have been enabled on your server.
|
本篇中,我们会简要地讨论Apache服务器前端以及如何列出已经启用的Apache模块。
|
||||||
|
|
||||||
Apache is built, based on the principle of modularity, this way, it enables web server administrators to add different modules to extend its primary functionalities and [enhance apache performance][5] as well.
|
Apache基于模块构成,因此它可以让web管理员可以添加不同的模块来扩展主要的功能及[增强性能][5]。
|
||||||
|
|
||||||
Some of the common Apache modules include:
|
常见的Apache模块有:
|
||||||
|
|
||||||
1. mod_ssl – which offers [HTTPS for Apache][1].
|
1. mod_ssl – 提供了[HTTPS功能][1]。
|
||||||
2. mod_rewrite – which allows for matching url patterns with regular expressions, and perform a transparent redirect using [.htaccess tricks][2], or apply a HTTP status code response.
|
2. mod_rewrite – 可以用正则表达式匹配url样式,并且使用[.htaccess技巧][2]来进行透明转发,或者用于HTTP状态码回应。
|
||||||
3. mod_security – which offers you to [protect Apache against Brute Force or DDoS attacks][3].
|
3. mod_security – 用于[保护Apache免于暴力破解或者DDoS攻击][3]。
|
||||||
4. mod_status – that allows you to [monitor Apache web server load and page statics][4].
|
4. mod_status - 用于[监测Apache的负载及页面统计][4]。
|
||||||
|
|
||||||
In Linux, the apachectl or apache2ctl command is used to control Apache HTTP server interface, it is a front-end to Apache.
|
在Linux中apachectl或者apache2ctl用于控制Apache服务器,是Apache的前端。
|
||||||
|
|
||||||
You can display the usage information for apache2ctl as below:
|
你可以用下面的命令显示apache2ctl的使用信息:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ apache2ctl help
|
$ apache2ctl help
|
||||||
OR
|
或者
|
||||||
$ apachectl help
|
$ apachectl help
|
||||||
```
|
```
|
||||||
apachectl help
|
apachectl help
|
||||||
@ -49,21 +47,21 @@ Options:
|
|||||||
-t : run syntax check for config files
|
-t : run syntax check for config files
|
||||||
```
|
```
|
||||||
|
|
||||||
apache2ctl can function in two possible modes, a Sys V init mode and pass-through mode. In the SysV init mode, apache2ctl takes simple, one-word commands in the form below:
|
apache2ctl可以工作在两种模式下,SysV init模式和直通模式。在SysV init模式下,apache2ctl用下面的命令形式:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ apachectl command
|
$ apachectl command
|
||||||
OR
|
或者
|
||||||
$ apache2ctl command
|
$ apache2ctl command
|
||||||
```
|
```
|
||||||
|
|
||||||
For instance, to start Apache and check its status, run these two commands with root user privileges by employing the [sudo command][6], in case you are a normal user:
|
比如要启动并检查它的状态,以防你是普通用户,使用[sudo命令][6]来以root用户权限来运行这两个命令:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ sudo apache2ctl start
|
$ sudo apache2ctl start
|
||||||
$ sudo apache2ctl status
|
$ sudo apache2ctl status
|
||||||
```
|
```
|
||||||
Check Apache Status
|
检查Apache状态
|
||||||
```
|
```
|
||||||
tecmint@TecMint ~ $ sudo apache2ctl start
|
tecmint@TecMint ~ $ sudo apache2ctl start
|
||||||
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1\. Set the 'ServerName' directive globally to suppress this message
|
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1\. Set the 'ServerName' directive globally to suppress this message
|
||||||
@ -99,35 +97,35 @@ Scoreboard Key:
|
|||||||
"I" Idle cleanup of worker, "." Open slot with no current process
|
"I" Idle cleanup of worker, "." Open slot with no current process
|
||||||
```
|
```
|
||||||
|
|
||||||
And when operating in pass-through mode, apache2ctl can take all the Apache arguments in the following syntax:
|
当在直通模式下,apache2ctl可以用下面的语法带上所有Apache的参数:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ apachectl [apache-argument]
|
$ apachectl [apache-argument]
|
||||||
$ apache2ctl [apache-argument]
|
$ apache2ctl [apache-argument]
|
||||||
```
|
```
|
||||||
|
|
||||||
All the Apache-arguments can be listed as follows:
|
可以用下面的命令列出所有的Apache参数:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ apache2 help [On Debian based systems]
|
$ apache2 help [在基于Debian的系统中]
|
||||||
$ httpd help [On RHEL based systems]
|
$ httpd help [在RHEL的系统中]
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Check Enabled Apache Modules
|
#### 检查启用的Apache模块
|
||||||
|
|
||||||
Therefore, in order to check which modules are enabled on your Apache web server, run the applicable command below for your distribution, where `-t -D DUMP_MODULES` is a Apache-argument to show all enabled/loaded modules:
|
因此,为了检测你的Apache服务器启动了哪些模块,在你的发行版中运行适当的命令,`-t -D DUMP_MODULES`是一个Apache参数用于显示所有启用的模块:
|
||||||
|
|
||||||
```
|
```
|
||||||
--------------- On Debian based systems ---------------
|
--------------- 在基于Debian的系统中 ---------------
|
||||||
$ apache2ctl -t -D DUMP_MODULES
|
$ apache2ctl -t -D DUMP_MODULES
|
||||||
OR
|
或者
|
||||||
$ apache2ctl -M
|
$ apache2ctl -M
|
||||||
```
|
```
|
||||||
|
|
||||||
```
|
```
|
||||||
--------------- On RHEL based systems ---------------
|
--------------- 在RHEL的系统中 ---------------
|
||||||
$ apachectl -t -D DUMP_MODULES
|
$ apachectl -t -D DUMP_MODULES
|
||||||
OR
|
或者
|
||||||
$ httpd -M
|
$ httpd -M
|
||||||
$ apache2ctl -M
|
$ apache2ctl -M
|
||||||
```
|
```
|
||||||
@ -158,14 +156,14 @@ Loaded Modules:
|
|||||||
....
|
....
|
||||||
```
|
```
|
||||||
|
|
||||||
That’s all! in this simple tutorial, we explained how to use the Apache front-end tools to list enabled/loaded apache modules. Keep in mind that you can get in touch using the feedback form below to send us your questions or comments concerning this guide.
|
就是这样!在这篇简单的教程中,我们解释了如何使用Apache前端工具来列出启动的apache模块。记住你可以在下面的反馈表中给我们留下你的问题或者留言。
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
via: http://www.tecmint.com/check-apache-modules-enabled
|
via: http://www.tecmint.com/check-apache-modules-enabled
|
||||||
|
|
||||||
作者:[Aaron Kili][a]
|
作者:[Aaron Kili][a]
|
||||||
译者:[译者ID](https://github.com/译者ID)
|
译者:[geekpi](https://github.com/geekpi)
|
||||||
校对:[校对者ID](https://github.com/校对者ID)
|
校对:[校对者ID](https://github.com/校对者ID)
|
||||||
|
|
||||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||||
@ -177,3 +175,5 @@ via: http://www.tecmint.com/check-apache-modules-enabled
|
|||||||
[4]:http://www.tecmint.com/monitor-apache-web-server-load-and-page-statistics/
|
[4]:http://www.tecmint.com/monitor-apache-web-server-load-and-page-statistics/
|
||||||
[5]:http://www.tecmint.com/apache-performance-tuning/
|
[5]:http://www.tecmint.com/apache-performance-tuning/
|
||||||
[6]:http://www.tecmint.com/su-vs-sudo-and-how-to-configure-sudo-in-linux/
|
[6]:http://www.tecmint.com/su-vs-sudo-and-how-to-configure-sudo-in-linux/
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user