Linux history log

For the user that use the Linux, it will be important to know where is the history log file need to check

Shell command -line history

/root/.bash_history

or use the command

history

show the history by date

export HISTTIMEFORMAT='%F %T '
history

MySql query history

/root/.mysql_history

ClamAV commands

There is some command to trigger ClamAV in Linux server which is more easy to use back-end.

To scan all the file in the path

clamscan -r path

To scan all directories and sub directories recursive

clamav -ril /home/user/clamav.log

To scan all the server and provide report

clamscan -ir / -l cscanreport

Check Apache version by PHP

Beside use command to check the version, you can use the php script to check the php version. Why that so? So application do need to verify by php first before allow you to install the apps.

<?php

$ar = split("[/ ]",$_SERVER['SERVER_SOFTWARE']);
for ($i=0;$i<(count($ar));$i++)
{
switch(strtoupper($ar[$i]))
{
case 'APACHE':
$i++;
$Apache_Version = $ar[$i];
break;
case 'PHP':
$i++;
$PHP_Version = $ar[$i];
break;
case 'MOD_SSL':
$i++;
$MOD_SSL_Version = $ar[$i];
break;
case 'OPENSSL':
$i++;
$OPENSSL_Version = $ar[$i];
break;
}
}

Echo "Apache Version: $Apache_Version<br>\n";
Echo "PHP Version: $PHP_Version<br>\n";
Echo "mod_ssl Version: $MOD_SSL_Version<br>\n";
Echo "OpenSSL Version: $OPENSSL_Version<br>\n";

?>

4 Command Monitor Server (Linux)

top
Top command showing current process activity with exact command which currently running on your server.

ps
It display current running process

iostat
It shows average CPU Load, Disk Activity etc

vmstat
It showing system activity/Hardware & System Information.