Home page Forum

Go Back   MyServerZone » My Server Discussion » Linux Servers » Debian

Reply
 
LinkBack Thread Tools Display Modes
Old 11-13-2008, 05:39 PM
Administrator
 
KING's Avatar
 
Join Date: Nov 2008
Posts: 23
Send a message via ICQ to KING Send a message via Yahoo to KING Send a message via Skype™ to KING
Default Debian creating .htaccess and .htpasswd files.

Today I will show you how is easy creating .htaccess and .htpasswd files to secure some websites folders.

Example:

We run apache and our files are located in /var/www/my-apache-files/secret-folder/

And we want to have password access to this /secret-folder/.

There how we do it:

Use Commands:

cd /var/

htpasswd -c .htpasswd username

New password:blablabla

Re-type new password:blablabla

This commands will create .htpasswd file in /var/.htpasswd

Now go to:

cd /var/www/my-apache-files/secret-folder/


Now we creating .htaccess file:

pico .htaccess

paste to file this lines:

Options +Indexes
AuthUserFile /var/.htpasswd
AuthName “SECRET ZONE”
AuthType Basic
<Limit GET POST>
require valid-user
</Limit>


Ctrl+X y

and we done
KING is offline   Reply With Quote
Sponsored Links
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:39 PM.