如何查看Debian机器上安装了Apache的哪个版本?
有这样做的命令吗?
如何查看Debian机器上安装了Apache的哪个版本?
有这样做的命令吗?
当前回答
我使用红帽Linux和以下命令工作:
httpd -V
其他回答
工作在debian11靶心
/usr/sbin/apache2 -v
You can use apachectl -V or apachectl -v. Both of them will return the Apache version information! xgqfrms:~/workspace $ apachectl -v Server version: Apache/2.4.7 (Ubuntu) Server built: Jul 15 2016 15:34:04 xgqfrms:~/workspace $ apachectl -V Server version: Apache/2.4.7 (Ubuntu) Server built: Jul 15 2016 15:34:04 Server's Module Magic Number: 20120211:27 Server loaded: APR 1.5.1-dev, APR-UTIL 1.5.3 Compiled using: APR 1.5.1-dev, APR-UTIL 1.5.3 Architecture: 64-bit Server MPM: prefork threaded: no forked: yes (variable process count) Server compiled with.... -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=256 -D HTTPD_ROOT="/etc/apache2" -D SUEXEC_BIN="/usr/lib/apache2/suexec" -D DEFAULT_PIDLOG="/var/run/apache2.pid" -D DEFAULT_SCOREBOARD="logs/apache_runtime_status" -D DEFAULT_ERRORLOG="logs/error_log" -D AP_TYPES_CONFIG_FILE="mime.types" -D SERVER_CONFIG_FILE="apache2.conf" You may be more like using apache2 -V or apache2 -v. It seems easier to remember! xgqfrms:~/workspace $ apache2 -v Server version: Apache/2.4.7 (Ubuntu) Server built: Jul 15 2016 15:34:04 xgqfrms:~/workspace $ apache2 -V Server version: Apache/2.4.7 (Ubuntu) Server built: Jul 15 2016 15:34:04 Server's Module Magic Number: 20120211:27 Server loaded: APR 1.5.1-dev, APR-UTIL 1.5.3 Compiled using: APR 1.5.1-dev, APR-UTIL 1.5.3 Architecture: 64-bit Server MPM: prefork threaded: no forked: yes (variable process count) Server compiled with.... -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=256 -D HTTPD_ROOT="/etc/apache2" -D SUEXEC_BIN="/usr/lib/apache2/suexec" -D DEFAULT_PIDLOG="/var/run/apache2.pid" -D DEFAULT_SCOREBOARD="logs/apache_runtime_status" -D DEFAULT_ERRORLOG="logs/error_log" -D AP_TYPES_CONFIG_FILE="mime.types" -D SERVER_CONFIG_FILE="apache2.conf"
试试apachectl -V:
$ apachectl -V
Server version: Apache/2.2.9 (Unix)
Server built: Sep 18 2008 21:54:05
Server's Module Magic Number: 20051115:15
Server loaded: APR 1.2.7, APR-Util 1.2.7
Compiled using: APR 1.2.7, APR-Util 1.2.7
... etc ...
如果不成功,请使用sudo命令运行该命令。
或者,不那么直接地说:
nmap -A localhost -p
我尝试运行命令“httpd -V”和“apachectl -V”,但我无法执行,并得到错误:
-ksh: php: not found[没有这样的文件或目录]
然后我尝试了另一种方法。我进入服务器上的Apache目录,然后尝试执行命令:
./apachectl -v
这为我工作,并返回输出:
Server version: Apache/2.2.20 (Unix)
Server built: Sep 6 2012 17:22:16
我希望这能有所帮助。