Friday, May 17, 2013
Hyper Text Access(htaccess)
In this post we will see how to protect Document Root directory on web servers running the Apache Web Server software.
What is htaccess ?
- htaccess stands for hypertext access.
- .htaccess is a configuration file for use on web servers running the Apache Web Server software.This is the default name of the Apache directory-level configuration file.
This .htaccess file can be used to create security restrictions for directories(/var/www). One of the common use of .htaccess is to require user authentication in order to secure certain web pages.
Content of htaccess file ?
AuthType Basic
AuthName “Restricted web page”
AuthUserFile /etc/apache2/.htpasswd
require valid-user
Implementation .htaccess ?
Step 1: Create an .htaccess file similar to the one above.
Step 2: Create the .htpasswd file containing usernames & password necessary for the authentication.
Step 3: Place .htaccess in the directory we wish users to validate before accessing the content.
Step 4: Tell httpd to allow user authentication via .htaccess files.
Step 5: Restart the server.
Step 6: Test the results.
Once we are authenticated then it’s displaying the indexes of 2 different websites. If we further move through then it will display the webpages of respective websites.
http://192.168.56.102/Website1
http://192.169.56.102/Website2
In the forthcoming posts we will discuss about securing web servers in detail with step by step examples.
If you have queries about this any topic just leave a reply !!
No comments:
Post a Comment