Skip to main content

Find Apache Mysql and server uptime

You can find out the Apache webserver uptime by the below commands



===========

httpd fullstatus | grep uptime


--------------------------------------

ps -eo “%U %c %t”|grep httpd |grep -v grep|grep root


===========

Run the below command to see how long the Mysql server is up


===========

mysql> \s
--------------
mysql  Ver 14.14 Distrib 5.5.36, for Linux (x86_64) using readline 5.1

Connection id:        1372917
Current database:   
Current user:        root@localhost
SSL:            Not in use
Current pager:        stdout
Using outfile:        ''
Using delimiter:    ;
Server version:        5.5.36-cll MySQL Community Server (GPL)
Protocol version:    10
Connection:        Localhost via UNIX socket
Server characterset:    latin1
Db     characterset:    latin1
Client characterset:    utf8
Conn.  characterset:    utf8
UNIX socket:        /var/lib/mysql/mysql.sock
Uptime:            44 days 14 hours 19 min 25 sec

Threads: 4  Questions: 77643069  Slow queries: 0  Opens: 110654  Flush tables: 1  Open tables: 607  Queries per second avg: 20.150
--------------
===========

And it is easy to get the server uptime details

===========
root@vps [~]# uptime
 07:13:56 up 197 days, 15:11,  1 user,  load average: 0.00, 0.07, 0.07
===========


Comments

Popular posts from this blog

Modsecurity block rule for XMLRPC and wp-login attack

SecAction phase:1,nolog,pass,initcol:ip=%{REMOTE_ADDR},initcol:user=%{REMOTE_ADDR},id:5000134  <Locationmatch "/wp-login.php">  SecRule user:bf_block "@gt 0" "deny,status:401,log,id:5000135,msg:'ip address blocked for 5 minutes, more than 10 login attempts in 3 minutes.'"  SecRule RESPONSE_STATUS "^302" "phase:5,t:none,nolog,pass,setvar:ip.bf_counter=0,id:5000136"  SecRule RESPONSE_STATUS "^200" "phase:5,chain,t:none,nolog,pass,setvar:ip.bf_counter=+1,deprecatevar:ip.bf_counter=1/180,id:5000137"  SecRule ip:bf_counter "@gt 10" "t:none,setvar:user.bf_block=1,expirevar:user.bf_block=300,setvar:ip.bf_counter=0"  </Locationmatch>  SecAction phase:1,nolog,pass,initcol:ip=%{REMOTE_ADDR},initcol:user=%{REMOTE_ADDR},id:5000234  <Locationmatch "/xmlrpc.php">  SecRule user:bf_block "@gt 0" "deny,status:401,log,id:5000235,msg:'ip address blocked for 5 m...

Apache tuning documentation

Apache bench marking ======================= Things or checklist to be considered before the test     CPU: avoid power-saving mode. cpufreq-set -g performance.     File descriptors: raise the limit to (at least) the number of concurrent connections you wish to handle, using ulimit -n in your shell, or setrlimit(RLIMIT_NOFILE) in your server. Beware, some systems forbid you to raise the limit, you might need to investigate a bit to find how to unlock it.     Disable the logs of your server (you do not want to lose time logging thousands of requests instead of answering them).     Raise /proc/sys/net/somaxconn to the number of concurrent connections you want to handle. To understand why this is necessary, read the technical report or the excellent paper Measuring the Capacity of a Web Server (Banga and Druschel, Usenix 97). More on the fascinating topic of the accept() queue can be found in accept()able Strategies for Im...

Secure the server

1. Process resource monitor plugin PRM (from RFX Networks) monitors the process table on a given system and matches process id’s with set resource limits in the config file or per-process based rules. Process id’s that match or exceed the set limits are logged and killed; includes e-mail alerts, kernel logging routine and more. Install, remove, update and manage this feature in this section wget http://www.rfxn.com/downloads/prm-current.tar.gz      2.Linux Socket Monitor LSM is a bash scripted network socket monitor. It is designed to track changes to Network sockets and Unix domain sockets. Installation Download the tar file usign the below link: wget http://rfxnetworks.com/downloads/lsm-current.tar.gz Untar the file tar -zxvf lsm-current.tar.gz go inside the extracted folder cd lsm-0.* run the below command to install it ./install.sh LSM Testing /usr/local/sbin/lsm -c /usr/local/sbin/lsm -g 3. Install Co...