Blog

Simple website monitoring script

Install Curl

Ubuntu or other debian distributions

apt-get install curl

Centos or other Redhat based distributions 

yum install curl

Create a file and add below script to the file

TODAY=$(date)
curl -Is https://gkitsystems.com/ | head -n 1 > out.txt
if grep -q “200” out.txt; then
echo site is working fine;
else
code=`cat out.txt`
echo “your site http://gkitsystems.com/ is down at ‘$TODAY’ with ‘$code’ error.” | mail -s “Your Website gkitsystems.com is down” -aFrom:Monitor\<monitor@yourserver.com\> yourmail@domain.com
rm -rf out.txt
fi

Output

run the script manually

root@server:~/monitor/# sh monitoring.sh
site is working fine

Now we are going to make the website throw 403 error and test the script

edit apache configuration file and add below lines in between <Directory> </Directory> for the website

Order deny,allow
Deny from all

Restart apache after editing, you should get 403 error 

Lets run the script again manually

you should have a notification email in inbox now

revert back the apache configuration to get your site functioning

Note : Edit URL subject and mail id as required

Feel free to comment if you have any issues with the script

Migrate Emails using imapsync

 

Step1

 

Install imapsync on old or new server, you could also install it on your computer if your running Linux . Since imapsync establish connection between old and new imap server to sync the emails you could use any machine that can run imapsync to move emails from one server to another.

On Ubuntu

apt-get install imapsync

On Centos

yum install imapsync

 

Step 2

 

Run the below command replacing details that match your old and new server,Remember to create email account on new server so that there is a empty mailbox to sync with old server mail box

/usr/bin/imapsync \
–host1 old.imapserver.com –user1 username@yourdomain.com –password1 password-for-the-account \
–host2 new.imapserver.com –user2 username@yourdomain.com –password2  password-for-the-account

 

Having trouble moving emails to new server?, Let us move the emails to new server for you at just $40 per domain Get Started

Install ERPNext on Ubuntu 14.04 in 2 steps

Step  1

Download ERPNext Install Script with below command
wget https://raw.githubusercontent.com/frappe/bench/master/install_scripts/setup_frappe.sh

Step 2 

Run the script below to setup ERPNext production
sudo bash setup_frappe.sh –setup-production

Are you stuck or facing issues? . Let us install this for you  for $50 with one week after install support Get Started

Migrate SVN to another server in 4 simple Steps

Step 1

Install svn on the new server

Step 2

dump SVN repository on old server using below command

svnrdump dump -r0:HEAD http://server.domain.com:9000/svn/chat/source_codes > chat.svn_dump

Note : replace the url in example with the actual repo url you want to backup

Step 3

Create blank repo on new server using below command

svnadmin create /path/to/repository

Step 4

svnadmin load /path/to/repository < chat.svn_dump

 

Let us migrate the SVN server for you at $150 with one week after migration support Get Started

WordPress 404 not found

Check your apache configuration file and make sure AllowOverride is set to All for your web root directory.Skip this step if you are on a shared hosting

<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>

To

<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>

Check if Mod_Rewrite is enabled in apache. Ignore this step if you are on Shared Hosting

“apachectl -M” should list all the modules enabled in apache. If mod rewrite is missing enable following below steps

For Centos

edit /etc/httpd/conf.modules.d/00-base.conf and add or uncomment LodeModule rewrite_module modules/mod_rewrite.so

For Ubuntu

run “a2enmod rewrite” in terminal
Don’t forget to restart apache for changes to take effect

Check .htaccess file exist in webroot folder of wordpress install with below contents and make sure .htaccess file is owned by webserver user

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

Note : If you installed wordpress on subfolder, change “RewriteBase /” to “RewriteBase /subfoldername/”

Let us fix this for you at $75 with one week after fix support Get Started