服务器软件版本查看总结

发表于: lnmpa | 作者: darkmi | 日期: 2017/07/28 08:00
字号:

如何查看linux的版本

方法一:

[root@test bin]# uname -a
Linux test.priv 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

方法二:

[root@test bin]# cat /proc/version 
Linux version 2.6.32-431.el6.x86_64 (mockbuild@c6b8.bsys.dev.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC) ) #1 SMP Fri Nov 22 03:15:09 UTC 2013

说明:
/proc文件系统,它不是普通的文件系统,而是系统内核的映像,也就是说,该目录中的文件是存放在系统内存之中的,它以文件系统的方式为访问系统内核数据的操作提供接口。而我们使用命令“uname -a“的信息也是从该文件获取的,当然用方法二的命令直接查看它的内容也可以达到同等效果。另外,加上参数”a“是获得详细信息,如果不加参数为查看系统名称。

方法三:

[root@test bin]# cat /etc/issue
CentOS release 6.5 (Final)
Kernel \r on an \m

方法四:

[root@test bin]# cat /etc/redhat-release
CentOS release 6.5 (Final)

如何查看mysql的版本

方法一:使用命令行模式进入mysql会看到最开始的提示符

[root@test ~]# mysql -u root -p 
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1378261
Server version: 5.6.27-log MySQL Community Server (GPL)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

方法二:

mysql> status
--------------
mysql  Ver 14.14 Distrib 5.6.27, for linux-glibc2.5 (x86_64) using  EditLine wrapper

Connection id:          1378261
Current database:
Current user:           root@localhost
SSL:                    Not in use
Current pager:          stdout
Using outfile:          ''
Using delimiter:        ;
Server version:         5.6.27-log MySQL Community Server (GPL)
Protocol version:       10
Connection:             Localhost via UNIX socket
Server characterset:    utf8
Db     characterset:    utf8
Client characterset:    utf8
Conn.  characterset:    utf8
UNIX socket:            /tmp/mysql.sock
Uptime:                 75 days 35 min 28 sec

Threads: 43  Questions: 294878351  Slow queries: 285707  Opens: 93586  Flush tables: 1  Open tables: 1024  Queries per second avg: 45.490
--------------

如何查看redis的版本

方法一:

[root@test bin]# /usr/local/redis/bin/redis-server -v
Redis server v=3.0.2 sha=00000000:0 malloc=jemalloc-3.6.0 bits=64 build=4a9f67dba821eea5

或者:

[root@test bin]# /usr/local/redis/bin/redis-server --version
Redis server v=3.0.2 sha=00000000:0 malloc=jemalloc-3.6.0 bits=64 build=4a9f67dba821eea5

方法二:

首先通过redis-cli连接到redis:

[root@test bin]# /usr/local/redis/bin/redis-cli

然后输入info命令,可以看到redis的版本信息:

127.0.0.1:6379> info
# Server
redis_version:3.0.2
redis_git_sha1:00000000
redis_git_dirty:0
redis_build_id:4a9f67dba821eea5
redis_mode:standalone
os:Linux 2.6.32-431.el6.x86_64 x86_64

info命令输出的内容比较多,此处只展示了与redis版本相关的信息。

如何查看Tomcat的版本

首先进入tomcat的bin目录,ls一下,可以看到该目录里有一个 version.sh 脚本:

[root@test bin]# ls
bootstrap.jar                 configtest.sh        setenv.sh             tool-wrapper.bat
catalina.bat                  daemon.sh            shutdown.bat          tool-wrapper.sh
catalina.sh                   digest.bat           shutdown.sh           version.bat
catalina-tasks.xml            digest.sh            startup.bat           version.sh
commons-daemon.jar            hs_err_pid16987.log  startup.sh
commons-daemon-native.tar.gz  setclasspath.bat     tomcat-juli.jar
configtest.bat                setclasspath.sh      tomcat-native.tar.gz

运行该脚本可以查看tomcat的版本号:

[root@test bin]# ./version.sh 
Using CATALINA_BASE:   /usr/local/apache-tomcat-8.0.36
Using CATALINA_HOME:   /usr/local/apache-tomcat-8.0.36
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-8.0.36/temp
Using JRE_HOME:        /usr/local/java/jre
Using CLASSPATH:       /usr/local/apache-tomcat-8.0.36/bin/bootstrap.jar:/usr/local/apache-tomcat-8.0.36/bin/tomcat-juli.jar
Server version: Apache Tomcat/8.0.36
Server built:   Jun 9 2016 13:55:50 UTC
Server number:  8.0.36.0
OS Name:        Linux
OS Version:     2.6.32-431.el6.x86_64
Architecture:   amd64
JVM Version:    1.8.0_66-b17
JVM Vendor:     Oracle Corporation

如何查看activeMQ的版本

[root@test bin]# ./activemq --version
INFO: Loading '/opt/apache-activemq-5.13.2//bin/env'
INFO: Using java '/usr/local/java/bin/java'
Java Runtime: Oracle Corporation 1.8.0_66 /opt/jdk1.8.0_66/jre
  Heap sizes: current=62976k  free=61664k  max=932352k
    JVM args: -Xms64M -Xmx1G -Djava.util.logging.config.file=logging.properties -Djava.security.auth.login.config=/opt/apache-activemq-5.13.2/conf/login.config -Dactivemq.classpath=/opt/apache-activemq-5.13.2//conf:/opt/apache-activemq-5.13.2//../lib/: -Dactivemq.home=/opt/apache-activemq-5.13.2/ -Dactivemq.base=/opt/apache-activemq-5.13.2/ -Dactivemq.conf=/opt/apache-activemq-5.13.2//conf -Dactivemq.data=/opt/apache-activemq-5.13.2/data
Extensions classpath:
  [/opt/apache-activemq-5.13.2/lib,/opt/apache-activemq-5.13.2/lib/camel,/opt/apache-activemq-5.13.2/lib/optional,/opt/apache-activemq-5.13.2/lib/web,/opt/apache-activemq-5.13.2/lib/extra]
ACTIVEMQ_HOME: /opt/apache-activemq-5.13.2
ACTIVEMQ_BASE: /opt/apache-activemq-5.13.2
ACTIVEMQ_CONF: /opt/apache-activemq-5.13.2/conf
ACTIVEMQ_DATA: /opt/apache-activemq-5.13.2/data

ActiveMQ 5.13.2
For help or more information please see: http://activemq.apache.org

倒数第二行,可以看到ActiveMQ的版本号为5.13.2 。

如何查看nginx的版本

[darkmi@darkmi-desk ~]$sudo nginx -V
Password:
nginx version: nginx/1.6.2
built by clang 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
TLS SNI support enabled
configure arguments: --prefix=/usr/local/Cellar/nginx/1.6.2 --with-http_ssl_module --with-pcre --with-ipv6 --sbin-path=/usr/local/Cellar/nginx/1.6.2/bin/nginx --with-cc-opt='-I/usr/local/Cellar/pcre/8.36/include -I/usr/local/Cellar/openssl/1.0.1j_1/include' --with-ld-opt='-L/usr/local/Cellar/pcre/8.36/lib -L/usr/local/Cellar/openssl/1.0.1j_1/lib' --conf-path=/usr/local/etc/nginx/nginx.conf --pid-path=/usr/local/var/run/nginx.pid --lock-path=/usr/local/var/run/nginx.lock --http-client-body-temp-path=/usr/local/var/run/nginx/client_body_temp --http-proxy-temp-path=/usr/local/var/run/nginx/proxy_temp --http-fastcgi-temp-path=/usr/local/var/run/nginx/fastcgi_temp --http-uwsgi-temp-path=/usr/local/var/run/nginx/uwsgi_temp --http-scgi-temp-path=/usr/local/var/run/nginx/scgi_temp --http-log-path=/usr/local/var/log/nginx/access.log --error-log-path=/usr/local/var/log/nginx/error.log --with-http_gzip_static_module

切换主题切换主题
返回顶部