Sunday, November 13, 2011

Tips Protection Web Pages With. Htaccess and. Htpasswd

Sometimes  after we do a website online, it seems there are certain links  that others do not
should know. And of course the link was a bit special.:). Maybe its contents secret ato as the user who
become a member who can access these links. With. Htaccess and. Htpasswd can be in
do. Here will be explained how a directory is the key to
the file. htaccess and. htpasswd.

References.
1. http://www.webmaster-toolkit.com/htaccess-generator.shtml
2. http://www.xs4all.nl/ ~ remcovz / htpasswd.html
3. http://www.topsubmit.de/dienste/tools/htaccess-generator/
4. http://www.eye-create.com/htaccess.html

Things that  need.
Apache modules, PHP and its modules.

Create a  htpasswd file.
The first step is we have to specify the directory where are we going to protectionism. Well here
my example it is / home / azmy / public_html / azmy.
Go to the directory;
[root @ proxy root] # cd / home / azmy / public_html / azmy
Create a htpasswd file;
[root @ proxy azmy] # htpasswd-c / etc / .htpasswd azmy

New password:
Re-type new password:
Updating password for user azmy
[root  @ proxy azmy] #
Can also: htpasswd-c. Htpasswd azmy, but the default is to us while accessing the directory current.
htpasswd-c / etc / .htpasswd azmy This means we create the htpasswd file in the directory / etc and
as well as create a user and password for azmy.
If we have made a htpasswd file then for the addition of new users we do not need anymore
make htpasswd file but enough with the command:
[root @ proxy azmy] # htpasswd / etc / .htpasswd admin

New password:
Re-type new password:
Updating password for user admin
[root @ proxy azmy] #
And do not forget to add the user admin. Htaccess file it.

Create File. Htaccess
[root @ proxy azmy] # vi. htaccess
AuthUserFile / etc / .htpasswd
AuthGroupFile / dev / null
AuthName "Restricted Access"
AuthType Basic
<limit GET>
azmy require user admin
</ limit>
[root @ proxy azmy] #
For RedHat 9.0 or Fedora Core, httpd.conf configuration used in the menu:
<Directory />
Options FollowSymLinks
# AllowOverride None
AllowOverride All
</ Directory>
<Directory "/direktory/web/anda">
Options Indexes FollowSymLinks
# AllowOverride None <- comment this line
AllowOverride FileInfo AuthConfig <- add this line
Order allow, deny
Allow from all
</ Directory>

Restart  Apache.
[root @ proxy azmy] # / etc / rc.d / init.d / httpd restart

Open Browsers.
Restart  Apache.
[root @ proxy azmy] # / etc / rc.d / init.d / httpd restart
Open Browsers.
http://www.azmy.tk/azmy/
Then the box will appear that will ask you to enter user and password.
Please try and mengoprek own ..:)
-= End. Htaccess and. Htpasswd =-
Criticism and suggestions please to: abang_ojex@yahoo.com
Then the box will appear that will ask you to enter user and password.
Please try and mengoprek own ..:)
-= End. Htaccess and. Htpasswd =-
Criticism and suggestions please to: denisciala@rocketmail.com
Tips Protection Web Pages With. Htaccess and. Htpasswd

RELATED POST:

No comments:

Post a Comment