28 November 2010

.htaccess file Part 2:Provide Password protection to directories in a Website

In my previous post, I had given a brief explanation of .htaccess file and it's uses which is commonly used by web masters.
If you haven’t read it till now. Have a look

Click Here

Today I will explain you How to give Password protection to directories using .htaccess file?

Password protection of directories in a website is the most popular use of .htaccess file. Many web hosts provide an inbuilt support for this, but many don’t.In that case you can use .htaccess file for giving protection to your directories.

We can give Password protection to a directory using .htaccess in two steps which are as follow.

1:-The very first step is to add following lines of code to your .htaccess file in the directory which you want to protect.

AuthName "Area Name"
AuthType Basic
AuthUserFile /fullpathto/.htpasswd
Require valid-user

1:- AuthName- Here we will specify area which we want to protect, we can give it any name of our choice. For example “Admin Area”.
2:-AuthUserFile- Here we will provide a full path to .htpasswd file which will store usernames and passwords.
3:- AuthType and Require will remain same as it is


2:-Creation of .htpasswd file

The .htpasswd File stores all the usernames and passwords which are allowed to access the specific directory.This file should be placed anywhere outside the root directory or you can also place it inside the root directory ,but former will ensure more security

After you create .htpasswd file ,you must enter the usernames and passwords. The usernames and passwords should be entered in following format:

username:password


where the password is the encrypted format of the password.


For multiple users, we can add extra lines to this file in the same format as shown above.

Now whenever you try to access a specific directory then your browser will show you a pop up dialog box, where you have to enter your username and password in order to access it

If you don't understand any part then feel free to ask

27 November 2010

.htaccess file !!!!!!Create your own custom error Pages

Today through this Post of mine, I will make you aware of a very important file which is commonly used by web developers or web administrators named “.htaccess file”.
Now one of the obvious question that comes into our mind is
What is .htaccess file?
It is just a text file that consists of a few simple instructions and has power to improve your website, through this file you can change settings of your web servers, even you can also have your own custom 404 error pages.
(Please refer Wikipedia to know more about 404 error pages)


.htaccess can do following things for you

1:- Password protection of folders for eg admin folder.

2:-Banning users with certain IP addresses.

3:- Only allowing users with certain IP addresses etc.

The next question that can come in your mind is Will my Host support it?
There is a general rule for this, if your server runs on UNIX or LINUX, or any other version of Apache web server it will support .htaccess, but in most cases it depends on your hosts. Many hosts support .htaccess file but don’t allow users to use it and many hosts don’t, However you can check yourself also that whether it supports .htaccess file or not, for that just upload your own .htaccess file and see if it works or simply asks your webhost.

Brief description of various functions of .htaccess file.


1:- Custom Error Pages

The very first use of the .htaccess file is that you can also create our own custom error pages i.e. instead of using host's error pages we can show our own error pages.

More specifically, say if a user try to access a certain file which is currently not available, then we can create our own file say ‘manish.html’ which we want to show at that time, just upload it to root directory of your website and add the following code to .htaccess file and upload it to web server

ErrorDocument 404 /manish.html

Note :To know more about Custom Error Pages, Please refer Wikipedia.

2:- Deny/Allow Certain IP Addresses

In some situations, you may want to only allow people with specific IP addresses to access your site

So you can block an IP address by using:

deny from 000.000.000.000

where 000.000.000.000 is the IP address.

You can allow an IP address by using:

allow from 000.000.000.000

where 000.000.000.000 is the IP address.

These are few common uses of .htaccess file which i have learned so far, still there is still one important function of .htaccess file i.e. Password protection of certain folders which I will post in my next post so stay tuned. :)

Please leave your comments if you like this

14 November 2010

Make animations using Microsoft PowerPoint

Today through this post, I will give you one of the easiest way of creating animated gif
Generally you use PowerPoint to make presentations, but have you ever wondered that you can even create some animated gif images using it?
Seems strange huh???
Not a problem read further you will learn how????? :)
First you need a gif animator, here I am using UnFreez .you can download it free from Internet

Let us start by simple animation

1:-First Open Microsoft PowerPoint. Select font size,family, color of your choice .Use the text box in PowerPoint to make HELLO. Right-click on the edge of the text box surrounding it, and select “Save as picture”. Save it as a “gif” to your Desktop. By default, it will be named “Hello.gif". Make sure it is saved as gif otherwise it will not work



2:-Next, Type CEANS. Right-click on the edge of the text box surrounding it, and select “Save as picture”. Save it to your Desktop as “Helloceans.gif”.


The last gif you need to make is blank gif .For that delete all the words and Right-click on the edge of the text box and save it to the Desktop as “blank.gif”.


Now if you have downloaded the gif animator, Run the UnFreez animator . Find the gifs you have saved on your Desktop and drag each one into the window of the Unfreez animator starting with Picture1 until you have all 3 gifs in the animator.
See below

Select the speed you want your animated gif to play by raising the number on the Frame Delay. I have selected 70 (as you increase no,its speed will decrease) .You can also select the option to loop continuously or play once.
Click on “Make Animated GIF”. Save it to your Desktop as “helloceans.gif”. now open “helloceans.gif “ in your browser
Similarly you can create more animations using this trick .just give some time and you can rock
Please post your comments if you like it

13 November 2010

Reported Attack site

Few months ago , when I was visiting one of my favorite website named www.crazyengineers.com from Mozilla Firefox ,I got some message like ‘Reported attack site’ it was also showing that this website is trying to install programs
that steal your personal information,

Below is the screen shot of this message

I was surprised to see this message because few hours ago everything was fine but suddenly Firefox had blocked access to this website even Google too, but after few days this issue was fixed.Few days ago I was just searching about something on google and again got same message so this time I thought to find the solution of this problem ?
I searched a lot on Google about this problem and find following reasons and solutions for this problem.

While browsing the search results in Google if you have seen seen the message – This site may harm your computer? then let me inform you. It is a message coming from a website called StopBadware which tries to warn and save your computers data from malware
In that case, Visit the Google safe browsing section which lists all the information about your website ie whether they are suspicious or not
Use the following link

http://www.google.com/safebrowsing/diagnostic?site=www.example.com


(replace example.com with your site name to get results)
Reasons :-

Sometimes because of wrong file permissions on your website or when you have easy passwords for your FTP accounts, your websites can be compromised after which hackers can add some malicious links within your content using iFrames. So you have to make sure that your website is secure to visit.if your website would be reported as attacked then google can completely block access to your website which may lead to huge fall in your visitors even 100%.
Check out this link to know about essential steps to be taken out for this
Cleaning your site

Steps to remove this warning:-

As i already said,Once the warning is shown for your website, Google will block the visitors from entering into the site. You need to get this warning removed by Google as soon as possible and for this the very first step would be to remove the malicious links, hackers codes or any other stuff which was the cause of this warning. Once you are sure that you have found the problem and removed those codes you need to proceed to the next step of contacting Google.

Check out this following link to know more
Request a malware review of your site

Hope this small post will help you in future when you will also be a website owner