Walking in Light with Christ - Faith, Computing, Diary |
Posted: 20 Jul 2012 08:10 AM PDT I’m running a two servers for a couple of home hosted websites. One of the servers is serving as Apache host1 and has configured MySQL running on it and the second is used just for database host2 – (has another MySQL configured on it). Sometimes due to electricity problems or CPU overheats the active MySQL host at host2 gets stoned and stops working causing the 2 WordPress based websites and One joomla site inaccessible. When I’m at home, this is not a problem as I have physical access to the servers and if somethings gets messy I fix it quickly. The problem comes, whether I’m travelling or in another city far from home and there is no-one at home to give the hanged host hard reboot …. Lately the problems with hang-ups of host2 happaned 3 times or so for 2 weeks, as a result the websites were inaccessible for hours and since there is nobody to reboot the server for hours; the websites keep hanging until the DB host is restarted ;;;; To work-around this I came with the idea to write a tiny shell script to check if host2 is ping-able in order to assure the Database host is not down and then if script determines host2 (mysql) host is down it changes wp-config.php (set to use host2) to a wp-config.php (which I have beforehand configured to use) host1. Using the script is a temporary solution, since I have to actually find the real hang-up causing troubles, but at least it saves me long downtimes. Here is a download link to the script I called change_blog_db.sh .
The script is written in a way so if it determins host2 is reachable a copy of wp-config.php and Joomla’s configuration.php tuned to use host2 is copied over the file config originals. In order to use the script one has to configured the head variables script section, e.g.:
You will have to manually prepare;;; wp-config-localhost.php, wp-config-192.168.0.2.php ,configuration-192.168.0.2.php, wp-config-localhost.php to be existing files configured to with proper host1 and host2 IP addresses. Related PostsThis posting includes an audio/video/photo media file: Download Now |
You are subscribed to email updates from Walking in Light with Christ - Faith, Computing, Diary To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google Inc., 20 West Kinzie, Chicago IL USA 60610 |
1 Komentar
MGM: Play online for free - DrMCD
BalasEnjoy the 오산 출장안마 best 영주 출장안마 free casino games at 공주 출장안마 the best slots online! Choose from over 400 영주 출장샵 of the 경상남도 출장안마 hottest slots and table games. All you have to do is sign up for
Penulisan markup di komentar