XAMPP DIRECTORY PROTECTION (.htaccess)

Problems with the Windows version of XAMPP, questions, comments, and anything related.

XAMPP DIRECTORY PROTECTION (.htaccess)

Postby amanda099 » 18. December 2009 20:03

Dear
I have XAMPP 1.7.2! on Windows XP Professional .
My XAMPP Directory appears unsecure. I open the page
http://localhost/security/xamppsecurity.php
what should I do to secure XAMPP Directory ?
Should I just provide a user and a password ? What are the check box and
(File: C:\xampp\security\xamppdirpasswd.txt) there for ?
Amanda
amanda099
 
Posts: 41
Joined: 02. September 2009 15:05

Re: XAMPP DIRECTORY PROTECTION (.htaccess)

Postby Izzy » 18. December 2009 21:16

amanda099 wrote:what should I do to secure XAMPP Directory ?
Should I just provide a user and a password ?
Yes, that will ensure anyone trying to access the xampp directory would need to know the username and password you set.
amanda099 wrote:What are the check box and
(File: C:\xampp\security\xamppdirpasswd.txt) there for ?
Putting a tick in the box will create a text file in the mentioned location with the username and password you set for the xampp directory, which is in itself a small security risk, but for those who can't remember passwords is the reason for this feature.

You could always move the text file to a more secure location on your PC if you still needed this text file to remind you of the password set for the xampp folder or simply don't tick the box if you can remember passwords easily or use a secured password manager installed on your PC for this purpose, especially if you have many passwords for many secured items to remember.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: XAMPP DIRECTORY PROTECTION (.htaccess)

Postby amanda099 » 18. December 2009 23:16

Izzy, Thank you for the useful instruction, I have learned a lot from you.
And what is the (.htaccess) in XAMPP DIRECTORY PROTECTION (.htaccess) there for ?
Amanda
amanda099
 
Posts: 41
Joined: 02. September 2009 15:05

Re: XAMPP DIRECTORY PROTECTION (.htaccess)

Postby Izzy » 18. December 2009 23:34

amanda099 wrote:And what is the (.htaccess) in XAMPP DIRECTORY PROTECTION (.htaccess) there for ?
A .htaccess file is like a mini httpd.conf file that is directory specific in nature and carries the instructions, in this XAMPP case, to ask for authentication before it will allow access to the xampp directory (folder) - authentication usually requires 2 files, a .htaccess file and a .htpasswd file but in the case of XAMPP DIRECTORY PROTECTION it renames the .htpasswd file to xampp.users file and it can be found in the \xampp\security folder and contains the user name and an encrypted password you set in the security page.

A .htaccess file is read by the server after the main httpd.conf file is read and so will override any directory specific instructions it may find in a .htaccess file.

You can open .htaccess and xampp.users (or .htpasswd) files in your text editor to read and/or edit their content.

Here are some links to the Apache Docs on this subject so you may familiorize yourself, but remember that in XAMPP all the hard work is done for you when you use the Security Page form:
http://httpd.apache.org/docs/2.2/howto/ ... .html#auth

http://httpd.apache.org/docs/2.2/programs/htpasswd.html
(Note the htpasswd referred in the above link is a binary command line file htpasswd.exe that is found in the \xampp\apache\bin folder and is used by XAMPP in this case to create an encrypted password to go in the .htpasswd (or xampp.users) file).

http://httpd.apache.org/docs/2.2/howto/auth.html

Let me know if you need more help but an Internet search for .htaccess and .htpasswd will give lots of useful relevant info.


BTW, if you ever need to reset or delete your password after forgetting it and being unable to access the XAMPP pages then follow the instructions in this link to delete your old user/pass and then recreate it using the Security page again:
viewtopic.php?f=16&t=38412
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: XAMPP DIRECTORY PROTECTION (.htaccess)

Postby amanda099 » 20. December 2009 14:05

Thank you for elaborating on your instructions . Very detailed indeed . I shall attempt to ponder and ruminate on this then proceed to tying it all together . Wish me luck.
amanda099
 
Posts: 41
Joined: 02. September 2009 15:05


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 67 guests