Plesk log rotate

Posted by alex almazan Mon, 31 Dec 2007 21:24:00 GMT

Behind the scenes multi domain log rotation enabling in Plesk
[root@server1 log]# mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7578332 to server version: 4.0.18-Max

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>  select a.*,b.name from log_rotation a join domains b on a.id=b.id where turned_on="true";

Process check

Posted by alex almazan Mon, 31 Dec 2007 21:19:39 GMT

THe following can help identify a hidden process. It compares active process output and /proc
# ls -d /proc/* |grep [0-9]|wc -l; ps ax |wc -l 

Differences indicate an bigger underlying issue and should be investigated.

SySctl & file-max

Posted by alex almazan Mon, 31 Dec 2007 21:14:00 GMT

A quick means of increasing this, or any sysctl variable
#echo 65536 > /proc/sys/fs/file-max
#sysctl -a | grep file-max >> /etc/sysctl.conf
#sysctl -p 

You can also change kernel parameters on the fly with switch ‘-w’

#sysctl -w vm.swappiness=0
This change will be reverted as this does not modify /etc/sysctl.conf. Edits to this file will implement reboot persistence.

Fuser

Posted by alex almazan Mon, 31 Dec 2007 21:11:55 GMT

The command ‘fuser’ can help identify processes and their ownership
fuser -n tcp 443

This will also identify the user and process bound to the specified port number.

Ports and LSOF

Posted by alex almazan Mon, 31 Dec 2007 21:08:26 GMT

This syntax is looking for a list of open files in regards to those affiliated with port 443. This is great for identifying rogue processes that are bound to the port and not permitting a clean restart of the Apache web server

lsof -n -P | grep LIST | grep 443 

Older posts: 1 2 3 ... 5