In some situations,  our web server receive too many connections. The number is much higher than normal, that could be an issue with our code, or we are being attack. While waiting to find a solution, we need a solution to keep the service running. The easiest solution is to restart our web server when it’s go over our limit. We’ll keep the log what the server is running, then restart the server. Later on we can see our log and do the fine tuning. cnt=`ps -Af | grep apache2 | grep -v rotatelogs | grep -v grep | wc -l` now=`date +%Y-%m-%d_%H-%M` # changeRead More →

Below are the steps to fix this issue: 1. Shut down your old slave server and make a copy of the data directory to your new slave. Make sure you get the old slave’s master.info and relay-log.info files. Once you have a copy of the data directory, you can restart the old slave if desired. The rest of these steps are performed on the new slave. 2. Rename the master.info to master.info.oldslave and relay-log.info to relay-log.info.oldslave. 3. Edit /etc/my.cnf and add the line “skip-slave-start” (without the quotes) to the [mysqld] section. 4. Start the new slave. This will create new master.info and relay-log.info files. BecauseRead More →

Sendmail use “access” database to control who can use this email server to send email out. It’s easy, just edit this file /etc/mail/access   , but access is a database file, after you edit it you need to recreate database map makemap hash /etc/mail/access < /etc/mail/access   Put your control list in the at the end of the file: [email protected] REJECT cyberspammer.com REJECT TLD REJECT 192.168.0 RELAY 192.168.1 OK   REJECT: reject all email from that source RELAY: allow that IP range to use our server as a relay. OK: allow to send any email even though it’s blocked in some other rules.Read More →

I used to put this content in my .htaccess to treat .html as php file, but some how it’s no longer working in godaddy. AddType application/x-httpd-php .htm .html AddHandler x-httpd-php .htm .html I found a solution, use the below text: Options +ExecCGI AddHandler x-httpd-php5-cgi .html  Read More →