Rice Blogger

Malaysia Internet Marketing, Blogging Tips, SEO, Make Money Online and Internet Entreprenuer. 2

Archive for the ‘Blogging Tips’ Category

VPS Hosting – My next learning curve

Posted by Adi Wong On July - 25 - 2011

For three years I have been working with the unix environment at my 9 to 5 job, it has help me in many ways as a webmaster as well. I would very much recommend any webmaster to have some basic knowledge in unix/linux command line. I have just bought myself some low end VPS to learn all about unmanage webhosting server.

Holding the root is not something new, also I have successfully setup a Ubuntu LAMP previously, so it should be a piece of cake. Not knowing that currently I am working with a low end VPS, therefore I decided not to install any control panel and phpmyadmin. I have moved my personal dormant domain, adiwong.com to the webhosting. It comes with one IPv4, so typing 46.23.67.254 will bring you directly to my server, woohoo!

It is up with Apache (comes default), MySQL (needed some upgrade) and PHP (installed). So my website is up, will restore the original website in days to come. Next plan is to try doing multi-domain with one IP that is given to me. Some OS hardening as this unmanaged service is quite scary as there is no backup and they will do no security. Will come out with a plan whereby I will schedule some backup so that I could restore them when needed.

Website Uptime to your Email

Posted by Adi Wong On July - 6 - 2010

I have always believe in website uptime affecting our SEO ranking and reduces the return visitor. This is one of the very important criteria when you pick a webhosting and not the price. I am using this service from AreMySitesUp, as poor as many of you out there, I am using the free service with 5 domain name. This is fine with me, the only downside for the free account is that this website will delete inactive users, because I do not need to check the website for my status, I tend not to login to the website.

Anyhow, I think it is a nice service to share. Let me know if you use other service for monitoring your website uptime.

Site: http://aremysitesup.com

Export Large MySQL to Move your WordPress

Posted by Adi Wong On June - 18 - 2010

Other than files, you need to also move your database. If you are use to the GUI, you know that there is limitation exporting and importing. This is especially true when you have a large database. Through phpmyadmin, it is also a lot slower compare to method whereby you export large MySQL via SSH.

The command:-

mysqldump -u [username] -p [DB name] | gzip > [dbname].sql.gz

It will prompt for password, type in the password for this access to the database. You will get a file name exactly like what you have typed at the end of above command ([dbname].sql.gz).

Use an ftp program to download the file.

Because the file is compress, you are downloading it even faster, and you can un-compress it on your new webhosting.

To Import the large MySQL

gzip [dbname].sql.gz

then

mysql -u [username] -p [DB name] < [dbname].sql

** If you uses a different username and DB name in your new webhost, use the new value in the bracket

I hope this this will actually make moving your wordpress or your website to another webhosting much easier.

Moving WordPress to Another Host via SSH

Posted by Adi Wong On March - 22 - 2010

This trick actually works well with most php scripts. There is lots of benefit to this rather than ftp out the file from your old host then ftp back all the files to new host. The better I would suggest is to zip your folder for the particular domain whereby you can use the following command:-

tar -zcvf zipfilename.tar.gz foldername/

ie. You moving a domain at riceblogger.com/. use command: tar -zcvf riceblogger.tar.gz riceblogger.com/

then move the zip file to your new host via ftp. To extract .tar.gz, you use this command

tar -zxvf riceblogger.tar.gz

I had no other choice to expore these command because I have a classifieds that contain few thousands of picture in a folder, with Filezilla, I could only display 2000, and I kept missing pictures. With zipping, I can download and upload much faster.

There is also ways to extract large MySQL via SSH. I will post them later. Since I start learning more SSH for my 9 to 6 job, I found it so useful, and it also helps in my experience as a webmaster/blogger/internet marketer. Not to forget my previous post Upgrading WordPress via SSH, it is still useful when we want to install a new blog, or the automatic upgrade is not working.

Detect and Prevent Image Bandwidth Stealing

Posted by Adi Wong On August - 5 - 2009

An important task as a webmaster is to prevent your resources to be stolen or your website to be hacked. I had both of this experience now after finding one of my blog got 280gb of bandwidth used on the month of June 2009 and even at 2rd week of July it is already at 350+gb of bandwidth used. Fortunately and unfortunately, I did not even get any warning email and no service disconnection from my Hostgator Shared Hosting account.

This is the stats with around 1k users a day. You can confirm someone is stealing your bandwidth when you see a sudden of increase in bandwidth usage and also see that your image bandwidth is taking a whole chunk of your bandwidth (my case was 96% of the 400+ gb at the end of the month)

image-hotlinking

Immediatelly I use .htaccess to prevent image hotlinking by adding the code below into the .htaccess file:-

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?website\.com/ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*\.(jpe?g|gif|bmp|png|jpg)$ /no-hotlinking-image.jpe [L]

I know that there is draw back on this but this is the quickest and most popular method to solve this problem and as you see the bandwidth drop pretty quickly after 13 July. After that I have reduce the size of  my no-hotlinking-image.jpe to a bare minimal and also remember to include some advertisements on the image.

To find out who is stealing your image bandwidth you can check out the raw access logs. This is where I look for at cpanel admin. Download the logs and if you see some image being load on other url other than yours, visit them and you should see your image (no-hotlinking-image.jpe) display on their page.

detect-image-bandwidth-stealing