Page41 of 42 1 39 40 41 42
2 04 2009

(dv) Dedicated-Virtual platform

#bigCat.Linux(" Comment.isBlank ")

(dv) Dedicated-Virtual platform\nHere are some paths to commonly used programs and locations on your (dv) server. Most of them are only available via SSH with root access. Before manipulating any of these files, it is highly suggested that you back up a copy of any file(s) you modify.\n\n * Perl: /usr/bin/perl\n * Python: /usr/bin/python\n * php: /usr/bin/php\n * php.ini: /etc/php.ini\n * my.cnf: /etc/my.cnf\n * httpd.conf: /etc/httpd/conf/httpd.conf\n * Apache error log: /var/log/httpd/error_log\n * Qmail log: /usr/local/psa/var/log/maillog\n * MySQL error log: /var/log/MySQLd.log\n * Sendmail: /usr/sbin/sendmail *\n\nNOTE:\n\nThis is actually a symlink to /var/qmail/bin/sendmail, but will work for CGI scripts that require a sendmail path, such as formmail's formmail.pl.\nDocument root:\n\n * /home/httpd/vhosts/mt-example.com/httpdocs [older (dv) 2.0 servers]\n * /var/www/vhosts/mt-example.com/httpdocs [newer (dv) 2.0 and 3.x servers]\n\nRaw access logs:\n\n * /home/httpd/vhosts/mt-example.com/statistics/logs [older (dv) 2.0 servers]\n * /var/www/vhosts/mt-example.com/statistics/logs [newer (dv) 2.0 and 3.x servers]\n\nUser email files:\n\n * /var/qmail/mailnames/\n\nSystem messages (shows things like login attempts, restart requests for services etc.):\n\n * /var/log/messages\n

2 04 2009

tail

#bigCat.Linux(" Comment.isBlank ")

tail -f -n100 error_log\n即时更新error_log的倒数100行全部内容\n-f 即时更新结果\n-n 行数\n

2 04 2009

crontab

#bigCat.Linux(" Comment.isBlank ")

crontab -l\nlist \ncrontab -e\nedit\n\n0,5,10,15,20,25,30,35,40,45,50,55 * * * * /etc/httpd/restart.sh >/dev/null 2>&1\n分钟 小时 日 月 星期 CMD\n\n修改完毕后重启crond\n/etc/init.d/crond restart

2 04 2009

重启apache的bash脚本

#bigCat.Linux(" for Comments = 2 ")
INFO=`netstat -ln | grep -P ":80"`\r\nDATE=`date`\r\nif [ "$INFO" == "" ]\r\nthen\r\n/etc/init.d/httpd restart\r\necho "$DATE shit happens" >> /var/log/httprestart.log\r\nps aux | mail -s mt17down httprestart@ooxx.me\r\nelse\r\necho "$DATE pass" >> /var/log/httprestart.log\r\nfi

\r\n\r\n\r\n\r\n

*/1 * * * * /root/httprestart.sh >/dev/null 2>&1

\r\n\r\n

2 04 2009

SSH显示连接数

#bigCat.Linux(" Comment.isBlank ")

netstat -ntu | awk '{print $5}' | tail --lines=+3 | cut -s -d: -f1 | sort | uniq -c | sort -n -b

Page41 of 42 1 39 40 41 42
Host: (miao) | Word: Press | Code: HTML5