如何查看Debian机器上安装了Apache的哪个版本?
有这样做的命令吗?
如何查看Debian机器上安装了Apache的哪个版本?
有这样做的命令吗?
当前回答
另一种方法是在基于debian的系统上检查包(包括Apache)安装的版本,我们可以使用:
apt-cache policy <package_name>
例如Apache
apt-cache policy apache2
它将显示如下内容(查看Installed行):
$ apt-cache policy apache2
apache2:
Installed: (none)
Candidate: 2.2.22-1ubuntu1.9
Version table:
2.2.22-1ubuntu1.9 0
500 http://hk.archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
500 http://security.ubuntu.com/ubuntu/ precise-security/main amd64 Packages
2.2.22-1ubuntu1 0
500 http://hk.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
其他回答
试试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
对我来说,这适用于Debian 6(挤压):
Linux www809 2.6.26-2-xen-686 #1 SMP Wed Sep 21 09:56:47 UTC 2011 i686 GNU/Linux
我必须走上正确的道路:
/usr/local/apache/bin** $ **./apachectl -v
./apachectl:第71行:ulimit:打开文件:不能修改limit:不允许操作 服务器版本:Apache/2.2.21 (Unix) 服务器构建:2011年12月17日19:57:53
用sudo试试
apachectl -V
-bash: apachectl: command not found
sudo apachectl -V
Server version: Apache/2.4.6 (Debian)
Server built: Aug 12 2013 18:20:23
Server's Module Magic Number: 20120211:24
Server loaded: APR 1.4.8, APR-UTIL 1.5.3
Compiled using: APR 1.4.8, APR-UTIL 1.5.2
Architecture: 32-bit
Server MPM: prefork
threaded: no
forked: yes (variable process count)
Server compiled with....
bla bla....
另一种方法是在基于debian的系统上检查包(包括Apache)安装的版本,我们可以使用:
apt-cache policy <package_name>
例如Apache
apt-cache policy apache2
它将显示如下内容(查看Installed行):
$ apt-cache policy apache2
apache2:
Installed: (none)
Candidate: 2.2.22-1ubuntu1.9
Version table:
2.2.22-1ubuntu1.9 0
500 http://hk.archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
500 http://security.ubuntu.com/ubuntu/ precise-security/main amd64 Packages
2.2.22-1ubuntu1 0
500 http://hk.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages