Archive for Tutorials

Web site Protection Tutorial

Web site Protection Tips:

The following links take you to different posts on this site.

* Step One: Protect folders by robots.txt – Stop search engine robots indexing Your private folders by ‘robots.txt’.

* Step Two: Protect folders by index file – Protect folders – Keep an INDEX file.

* Step Three: Protect folders by permissions – Folder protection – Directory and script file permissions.

* Step Four: Protect Your email addresses – Protect email address links – Stop email robots to get your email address.

* Step Five: Protect your downloads – Protect your downloads by password folder protection.

* Step Six: Protect your affiliate links – Affiliate link cloacking – Protect or hide your affiliate links.

* Step Seven: Protect Images – Image protection – Stop image hotlinking.

 

.

Related Posts:

Mysql database backup and restore – Easy to follow Tutorial.

All of us need to backup our mysql databases regularly to stop data loss or while moving the database from one site to another.

Here is a simple way to backup big databases through Telnet/SSH. Why using telnet? You can backup large databases using telnet which is not possible from Phpmyadmin interface where memory is an issue.

  • BACKING UP MYSQL DATABASE USING TELNET

STEP 1:

FTP into your web site where you want to backup the database. Create a folder named ‘backup’ (or any name you want) in your public_html directory. Chmod it to 777. (Note: If your server API is CGI, you will get ‘Internal server error’ with 777. So if this is your case, chmod it back to 755.)

STEP 2:

Telnet into your web site using Putty.

STEP 3:

At the command prompt type the backup query like this – (single line)

mysqldump -u mysite_User -ptest123 mysite_database 
> /home/path/to/backup_folder_name/backup.sql

Press ENTER.

  • Website – mysite.com
  • Database name – mysite_database
  • Database Username – mysite_User
  • Password – test123

If everything is OK, you will go to the command prompt again. Check your ‘backup’ folder. You will see backup.sql file.

Note: There is no space between -p and your password.

Tip: Copy the above command on a notepad and modify it with your details. Then copy and paste at command prompt.

STEP 4:

Download it to your computer in ASCII mode of your ftp software. (Not in AUTO mode.)

That’s it!!

  • RESTORING YOUR DATABASE

You need to restore the data into the database if you lost your data or if your database is corrupted.

STEP 1:

Create a folder ‘restore’ (or whatever you like) on your site. Upload the ‘backup.sql’ that is saved on your computer to this folder in ASCII mode.

STEP 2:

Login into your web host panel and go to Phpmyadmin. Select the database into which you want the data restored to. Delete ALL Tables. Remember, you need to restore data into the SAME database. So your database should be empty with no tables and no data.

STEP 3:

Now telnet into your web site as you did during database backup process above.

Run this command at command prompt – (single line)

mysql -u mysite_User -ptest123 mysite_database 
< /home/path/to/restore_folder_name/backup.sql

Press ENTER.

  • Website – mysite.com
  • Database name – mysite_database
  • Database Username – mysite_User
  • Password – test123

If everything is OK, you will go to the command prompt again. Check your phpmyadmin interface. All data will be restored into the database again.

Note: There is no space between -p and your password.

Tip: Copy the above command on a notepad and modify it with your details. Then copy and paste at command prompt..

Do a test practice on a test database first. Create a test database and import some data and try following above instructions.

Related Posts:

  • No Related Posts

How to Telnet server using Putty SSH client?

What is Putty?

Putty is a small windows program that is used to connect to your server using SSH or Telnet protocols. It is very small .exe program that need to be downloaded to your computer.

Where to download Putty?

http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

Scroll down a bit and download putty.exe file to your computer. Remember the folder where you have downloaded.

How to SSH into server using Putty?

Things You need:

* Your domain name (Like ‘host.yourhost.com’ or ‘ftp.webmasters-central.com’ or ip of the site or server ’11.111.111.11′)
* Your login and password to that domain. (Your ftp login information)
* Your host has enabled SSH for your web site.

  • STEP 1:

Open the Putty by double clicking on the icon.

1: Your website name or IP address of your website.

2: Don’t change anything in Port textbox. It will change to ’22′ automatically once you select ‘SSH’ radio button.

3: Select SSH radio button.

4: Save settings for future use – If you are going to use ssh/telnet to this website frequently, better to save the configuration for that website. So name this session anything you like. Save it by clicking on ‘Save’ button.

5: Once you save, the name goes into the textarea down below screen. When you next time open the Putty, the saved session can be selected, ‘Load’ it and click on ‘Open’ button.

6: Select ‘Only on clean exit’ radio button.

7: Once you are done, click on ‘Open’ button to open your telnet window.

  • STEP 2:

If this is your first telnet session into this server, you will get a warning screen. Click ‘Yes’ to continue.

1: login as: Type your username to your web host panel. Press ENTER. Your username is sent to your server.

2: Password: You are prompted to enter your password. Enter your password and press ENTER. You can not actually seen anything while you are entering the password.

3: Your last login details.

4: You will end up at ‘command line’. Remember the commandline looks different on different servers. You will see a cursor blinking at the command prompt.  I just typed ‘pwd’ command at the command prompt to know where I was. ‘pwd’ means ‘Present Working Directory’. It shows that I am in the root of the web site ‘/home/webmaste’.

Error messages:

* You will see a message like “Shell access in not enabled for your account.” Then you need to contact your webhost and ask them to enable SSH for your account.

* “Network Timeout”. Ask your host that the details you have entered like ip or port number etc are correct.

Related Posts:

  • No Related Posts