Username & password (.htpasswd & .htaccess)
Posted by: Rirre (---.tbcn.telia.com)
Date: January 15, 2009 08:07PM

Hi,

I can't really fix this.
Public can still login as admin in my page.
I have put in a .htaccess which look like this:

AuthType Basic
AuthName "Restricted Directory"
AuthUserFile C:/wamp/www/HLTV/includes/admin/.htpasswd
require valid-user



and .htpasswd

admin:*****


It doesn't work...
Anyone which know how to fix this?
I have restart Apache a few times now.



Edited 1 time(s). Last edit at 01/15/2009 08:08PM by Rirre.

Options: ReplyQuote
Re: Username & password (.htpasswd & .htaccess)
Posted by: yfastud (Moderator)
Date: January 16, 2009 12:34AM

Quote

admin:*****
is it really a bunch of * in your htpasswd? btw, where do you save htaccess and where you try to protect?

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: Username & password (.htpasswd & .htaccess)
Posted by: Rirre (---.tbcn.telia.com)
Date: January 16, 2009 08:52AM

no, i have Password Generator for .htaccess file.
[www.kxs.net]

In same directory as .htpasswd and they both exist in C:/wamp/www/HLTV/includes/admin
C:/wamp/www/HLTV/index.php this is public, index site when you enter http:// website.com/HLTV and I have put in a "Admin Login" link there (redirected to C:/wamp/www/HLTV/includes/admin), the problem is everyone can login as admin, i want this directory to be admin protected with username & password.
I won't publish my link here since I don't want anyone here to login as admin and abuse my site.



Edited 1 time(s). Last edit at 01/16/2009 08:57AM by Rirre.

Options: ReplyQuote
Re: Username & password (.htpasswd & .htaccess)
Posted by: yfastud (Moderator)
Date: January 16, 2009 02:08PM

most Password Generator websites are for *nix, and wamp is for win and you must use either plain text or MD5 encryption for password, so use plain text such as admin:test to check; if work, then use md5 to encrypt it ;-)

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: Username & password (.htpasswd & .htaccess)
Posted by: Rirre (---.tbcn.telia.com)
Date: January 16, 2009 09:33PM

Didn't work either (Plain text or MD5).

admin:test

and

admin:098f6bcd4621d373cade4e832627b4f6 (MD5)

I tried both in .htaccess and .htpasswd



Edited 6 time(s). Last edit at 01/16/2009 09:52PM by Rirre.

Options: ReplyQuote
Re: Username & password (.htpasswd & .htaccess)
Posted by: yfastud (Moderator)
Date: January 17, 2009 12:29AM

Plain text must work no matter what system you have *nix or win, so either your htaccess has hidden txt extension or you put it in wrong place, so try this
1. create folder test and folder protected in folder www
2. open notepad and paste these lines below:
AuthType Basic
AuthName "My Protected Area"
AuthUserFile c:/wamp/www/protected/.htpasswd
Require valid-user
3. save in folder test as ".htaccess" Note: Make sure to enclose filename in double quote
4. create and save a dummy index.html in same folder test
5. create a test htpasswd file w/ this line
admin:test
6. save in folder protected as ".htpasswd" Note: Make sure to enclose filename in double quote
7. check w/ "[localhost];

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: Username & password (.htpasswd & .htaccess)
Posted by: Rirre (---.tbcn.telia.com)
Date: January 17, 2009 12:36AM

This is getting Really annoying :@
Well, i don't know if its hidden or not. I did make a mistake before to open it Always with Notepad.
I have fix that in the Control Panel.
But I can't see .htaccess name longer, only the file name, not same such .htpasswd name as you can see.
I don't know how to fix it.

.htaccess
AuthType Basic
AuthName "My Protected Area"
AuthUserFile C:/wamp/www/test/protected/.htpasswd
Require valid-user

.htpasswd
admin:test

Pictures:
[img296.imageshack.us] - test folder
[img170.imageshack.us] - protected folder
[img515.imageshack.us] - localhost/test
[img181.imageshack.us] - localhost/test/protected



Edited 5 time(s). Last edit at 01/17/2009 01:18AM by Rirre.

Options: ReplyQuote
Re: Username & password (.htpasswd & .htaccess)
Posted by: Rirre (---.tbcn.telia.com)
Date: January 17, 2009 01:23AM

EDIT: Ah!
Figured it out! grinning smiley
in Apache httpd file
I modified this line:
<Directory "C:/wamp/www/">

    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # [httpd.apache.org]
    # for more information.
    #
    Options Indexes FollowSymLinks

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride None

    #
    # Controls who can get stuff from this server.
    #
#   onlineoffline tag - don't remove
    Order Allow,deny
    Allow from all

</Directory>
AllowOverride None
to
AllowOverride All
Now it works smiling smiley
Thx for helping!

Options: ReplyQuote
Re: Username & password (.htpasswd & .htaccess)
Posted by: yfastud (Moderator)
Date: January 17, 2009 02:08AM

that's weird :-( since it's supposed to be All by default

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: Username & password (.htpasswd & .htaccess)
Posted by: Rirre (---.tbcn.telia.com)
Date: January 17, 2009 10:25PM

Ok, anyway, was a good way to check tongue sticking out smiley

Options: ReplyQuote


Sorry, only registered users may post in this forum.