Archive for February, 2014


Sometimes the cpanel script to restart tomcat /scripts/restartsrv_tomcat will not work.

For that I found directly running tomcat startup file as user root will get the tomcat working.

How to start tomcat:

/usr/local/jakarta/tomcat/bin/startup.sh

How to stop tomcat:

/usr/local/jakarta/tomcat/bin/startup.sh

Thats all 🙂

Note: If you want to disable it completely, you have to recompile the easyapache and uncheck the tomcat.


In some situations, we need to check the uptime for MySQL in your server. The following command will give you the MySQL version along with the uptime of MySQL process.

Method 1:

# mysqladmin  version

For example:

root@server [~]# mysqladmin version

mysqladmin Ver 8.42 Distrib 5.1.72, for unknown-linux-gnu on x86_64
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Server version 5.1.72-cll
Protocol version 10
Connection Localhost via UNIX socket
UNIX socket /var/lib/mysql/mysql.sock
Uptime: 5 days 1 hour 28 min 23 sec

Method II:

# mysqladmin  ver

For example:

#mysqladmin ver

mysqladmin Ver 8.42 Distrib 5.1.72, for unknown-linux-gnu on x86_64
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

..

..

Server version 5.1.72-cll
Protocol version 10
Connection Localhost via UNIX socket
UNIX socket /var/lib/mysql/mysql.sock
Uptime: 5 days 1 hour 29 min 27 sec

Method III:

Switch into mysql and type \s

For example:

mysql> \s
————–
mysql Ver 14.14 Distrib 5.1.72, for unknown-linux-gnu (x86_64) using readline 5.1

Connection id: 75809
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ”
Using delimiter: ;
Server version: 5.1.72-cll MySQL Community Server (GPLv2)
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: latin1
Db characterset: latin1
Client characterset: latin1
Conn. characterset: latin1
UNIX socket: /var/lib/mysql/mysql.sock
Uptime: 5 days 1 hour 30 min 22 sec

Threads: 3 Questions: 3363916 Slow queries: 48 Opens: 29366 Flush tables: 1 Open tables: 1800 Queries per second avg: 7.690
————–