如何查看Apache的版本?
时间:2019-11-20 08:53:27 来源:igfitidea点击:
如何查看正在运行的Apache是什么版本的?
使用httpd查看Apache的版本
httpd 是Apache服务器主程序:
# httpd -v
输出示例:
Server version: Apache/2.4.6 (CentOS) Server built: Apr 2 2020 13:13:23
查看编译到Apache中的模块:
# httpd -l
输出示例:
Compiled in modules: core.c mod_so.c http_core.c
没有列出使用LoadModule指令包含的动态加载的模块。
要列出已加载的静态模块和共享模块,使用下面命令:
# httpd -M
输出示例:
Loaded Modules: core_module (static) so_module (static) http_module (static) access_compat_module (shared) actions_module (shared) alias_module (shared) allowmethods_module (shared) auth_basic_module (shared) auth_digest_module (shared) authn_anon_module (shared)
查看httpd的版本和构建参数
执行命令:
# httpd -V
输出示例:
Server version: Apache/2.2.3
Server built: Oct 28 2008 07:22:45
Server's Module Magic Number: 20051115:3
Server loaded: APR 1.2.7, APR-Util 1.2.7
Compiled using: APR 1.2.7, APR-Util 1.2.7
Architecture: 64-bit
Server MPM: Prefork
threaded: no
forked: yes (variable process count)
Server compiled with....
-D APACHE_MPM_DIR="server/mpm/prefork"
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=128
-D HTTPD_ROOT="/etc/httpd"
-D SUEXEC_BIN="/usr/sbin/suexec"
-D DEFAULT_PIDLOG="logs/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_LOCKFILE="logs/accept.lock"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"
Apache的配置文件位置
Apache的配置文件为httpd.conf(通常位于/etc/httpd目录中)。
在Redhat ,CentOS和Fedora 中Apache配置文件位置
# vi /etc/httpd/conf/httpd.conf
在Debian和Ubuntu中Apache配置文件位置
# vi /etc/apache2/apache2.conf
在FreeBSD中Apache配置文件的位置:
# vi /usr/local/etc/apache22/httpd.conf

