Balandar's Thoughts

Monday, April 26, 2010

Handy Locations

Password File

/etc/passwd

Log Files

/var/log/

Installing Stuff

/usr/src is where you do work such as installing packages

Plesk Backups

/var/lib/psa/dumps/1/

Plesk Logs

/usr/local/psa/admin/logs

Sunday, April 25, 2010

Awstats Notes

Awstats for Plesk

Config files are located at /etc/awstats

To update stats on one domain run

/usr/local/psa/admin/sbin/statistics --calculate-one --domain-name=blabla.com

For all domains run

/usr/local/psa/admin/sbin/statistics --calculate-all

If there is an error run strace and then the command:

strace /usr/local/psa/admin/sbin/statistics

Saturday, April 24, 2010

find all files over a certain size

cd /
find / -type f -size +10000k -exec ls -lh {} \; | awk '{ print $5 ": " $9 }' |sort -n | mail -s "files over 10000k" cschwieterman@xxxxxxxxxxxxx.com

cd /
find / -type f -size +50000k -exec ls -lh {} \; | awk '{ print $5 ": " $9 }' |sort -n


Change the 10000k or 50000k to the size you need.

Friday, April 23, 2010

Update Plesk (not tested)

/usr/local/psa/admin/bin/autoinstaller --enable-xml-output --source-type=plesk --target=/root/psa --select-release-id=PLESK_8_6_0 --install-component=base

Thursday, April 22, 2010

Find all directories Over 1 GB

I use this often when my server reaches max capacity.

[root@localhost]# du -h / | grep ^[0-9.]*G

Wednesday, April 21, 2010

Plesk Logs

PSA Logs: /usr/local/psa/admin/logs/

Tuesday, April 20, 2010

Custom Commands

Here is a list of custom commands I usually create on linux based systems.

htr is a custom command that will restart apache
echo "service httpd restart" > /usr/bin/htr ; chmod 700 /usr/bin/htr

awstats is a custom command that will update ALL STATS for all sites that have a config file
echo "/usr/local/awstats/tools/awstats_updateall.pl now" > /usr/bin/awstats ; chmod 700 /usr/bin/awstats

mail-ps is a custom command to mail the current process list to statusupdate@xxxxxxx.net
echo "ps auxw | mail -s \"Server: Current Processes\" statusupdate@xxxxxxx.net" > /usr/bin/mail-ps ; chmod 700 /usr/bin/mail-ps

mail-netstat is a custom command to mail the current open port list to statusupdate@xxxxxxx.net
echo "netstat -nape | mail -s \"Server: Current Active Internet Connections\" statusupdate@xxxxxxx.net" > /usr/bin/mail-netstat ; chmod 700 /usr/bin/mail-netstat