Web Server Configuration
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Iron Speed
 
Go Back   Dev Articles Community ForumsWeb DesignWeb Server Configuration

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old April 29th, 2003, 04:01 PM
JSBN JSBN is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 8 JSBN User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Post .htaccess/.htpasswd

Ok, i am trying to set .htaccess/.htpasswd files up so that i can protect an area on my server. My server is Apache (php enabled) running of a windows XP system. However, when i tried testing the restricted area, it didn't prompt me for my password, or username. It actually just let me into that part of the server.

Last edited by JSBN : April 29th, 2003 at 04:04 PM.

Reply With Quote
  #2  
Old April 29th, 2003, 04:53 PM
infamous-online infamous-online is offline
Moderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Posts: 404 infamous-online User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 m 10 sec
Reputation Power: 7
Re: .htaccess/.htpasswd

Quote:
Originally posted by JSBN
Ok, i am trying to set .htaccess/.htpasswd files up so that i can protect an area on my server. My server is Apache (php enabled) running of a windows XP system. However, when i tried testing the restricted area, it didn't prompt me for my password, or username. It actually just let me into that part of the server.



hmmm did you create the .htpasswd using the ms-dos screen and post the code you have in your .htaccess file so i can help
__________________
Apache Expert

Reply With Quote
  #3  
Old April 30th, 2003, 04:46 PM
JSBN JSBN is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 8 JSBN User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
No, i did not create the files in msdos.
Note: having some problems posting the file's code (cant post the word after limit... wow this is really messed up) : /
File: .htaccess
-------------------------
AuthUserFile http://localhost/password/.htpasswd
AuthGroupFile /dev/null
AuthName JSBN
AuthType Basic

<Limit >
require user JSBN
</Limit>
------------------------


File: .htpasswd
------------------
JSBN: sTO2XypJZkwpc
-----------------

Last edited by JSBN : April 30th, 2003 at 04:53 PM.

Reply With Quote
  #4  
Old April 30th, 2003, 08:13 PM
avit avit is offline
Not Yet Perfect
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: Squamish, BC
Posts: 111 avit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via ICQ to avit
Try:
Code:
AuthType Basic
AuthName JSBN
AuthUserFile /WEBROOT/password/.htpasswd
Require user JSBN

I haven't seen http:// used for AuthUserFile before... I don't know if it works that way (?). I do believe it just takes a filesystem path. Also, I don't have limit tags in mine, and it works...

Reply With Quote
  #5  
Old April 30th, 2003, 10:00 PM
infamous-online infamous-online is offline
Moderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Posts: 404 infamous-online User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 m 10 sec
Reputation Power: 7
Quote:
Originally posted by JSBN
No, i did not create the files in msdos.
Note: having some problems posting the file's code (cant post the word after limit... wow this is really messed up) : /
File: .htaccess
-------------------------
AuthUserFile http://localhost/password/.htpasswd
AuthGroupFile /dev/null
AuthName JSBN
AuthType Basic

<Limit >
require user JSBN
</Limit>
------------------------


File: .htpasswd
------------------
JSBN: sTO2XypJZkwpc
-----------------


AuthName "My Secured Page"
AuthUserFile /mysite/videos/.htpasswd
AuthType Basic
require valid-user

this is what you need to change your code to. theres no need to put the limit tag there

Reply With Quote
  #6  
Old May 1st, 2003, 03:55 PM
JSBN JSBN is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 8 JSBN User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy

It's still not working

Reply With Quote
  #7  
Old May 1st, 2003, 07:05 PM
avit avit is offline
Not Yet Perfect
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: Squamish, BC
Posts: 111 avit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via ICQ to avit
Have you checked your httpd/error_log ? What does it say?

Check your httpd.conf to see if you have Overrides enabled:
Code:
# This controls which options the .htaccess files in directories can
# override. Can also be "All", or any combination of "Options", "FileInfo", 
# "AuthConfig", and "Limit"
#
    AllowOverride All

Specifically you want AuthConfig, but you could simply allow All instead.

Reply With Quote
  #8  
Old May 1st, 2003, 08:57 PM
infamous-online infamous-online is offline
Moderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Posts: 404 infamous-online User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 m 10 sec
Reputation Power: 7
Quote:
Originally posted by JSBN
It's still not working


only 2 guess that 1. you didnt change the line to allowoveride none to allowoveride all or 2. you didn't create the htpasswd or created it incorrectly

Reply With Quote
  #9  
Old May 2nd, 2003, 11:28 AM
JSBN JSBN is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 8 JSBN User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
thx for the suggestions, i'll try them all out
oh, what is the proper way to make the .htpasswd file?

Reply With Quote
  #10  
Old May 2nd, 2003, 03:21 PM
JSBN JSBN is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 8 JSBN User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
k,
Quote:
# This controls which options the .htaccess files in directories can
# override. Can also be "All", or any combination of "Options", "FileInfo",
# "AuthConfig", and "Limit"
#
AllowOverride All


Isn't even part of the file :/

Reply With Quote
  #11  
Old May 2nd, 2003, 04:29 PM
infamous-online infamous-online is offline
Moderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Posts: 404 infamous-online User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 m 10 sec
Reputation Power: 7
Quote:
Originally posted by JSBN
thx for the suggestions, i'll try them all out
oh, what is the proper way to make the .htpasswd file?


look in your bin folder and look to see if you have a file called htpasswd.

once you see it open the ms-dos screen type in cd\ and press enter then type in of course change the path to reflect your own

c:\apache2\bin\htpasswd -c .htpasswd jsbn

press enter and you should be presented with an enter the password line, type what you want in there and press enter and the re-enter it and it will pause for a minute to create the file in the bin directory.

now let me explain the script

-c means to create the .htpasswd file and the second .htpasswd in the file is the name of the file that will be created and jsbn is the member who will be required in order to gain access to the password protected directory.

you will always need to use this line when creating the .htpasswd file

c:\apache2\bin\htpasswd -c .htpasswd jsbn

hopefully this helps

Reply With Quote
  #12  
Old May 2nd, 2003, 04:47 PM
avit avit is offline
Not Yet Perfect
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: Squamish, BC
Posts: 111 avit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via ICQ to avit
Exclamation

Quote:
Originally posted by asp_man

you will always need to use this line when creating the .htpasswd file

c:\apache2\bin\htpasswd -c .htpasswd jsbn

hopefully this helps


Caution: Note that you must omit the -c if you are only adding a name to the same htpasswd file. Otherwise all of your passwords will be overwritten with a newly created file.

JSBN, If you don't have AllowOverride in your httpd.conf, then that's most likely your problem. It should be listed within your <Directory> tag for the webroot. Check to make sure it's really not there, then add it in as AllowOverride All

Reply With Quote
  #13  
Old May 3rd, 2003, 08:09 PM
JSBN JSBN is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 8 JSBN User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
still not working
- i made the .htpasswd file properly, and i changed AllowOverride None to All

Reply With Quote
  #14  
Old May 3rd, 2003, 08:29 PM
infamous-online infamous-online is offline
Moderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Posts: 404 infamous-online User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 m 10 sec
Reputation Power: 7
Wink

Quote:
Originally posted by JSBN
still not working
- i made the .htpasswd file properly, and i changed AllowOverride None to All


can you post the code from your .htaccess file cause i think the problem is in that file so post it when you can k.

Reply With Quote
  #15  
Old May 3rd, 2003, 08:34 PM
JSBN JSBN is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 8 JSBN User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
ok, i got it working, after having problems with restarting the server, i restarted my comp, went back into the config file, and oddly enough, all the code for that area was changed... i am still confused about that part, anyways, i re-changed the AllowOverride, and it works. THX ALOT for every one's help, all u guys r awsome

THx again, JSBN

Reply With Quote
  #16  
Old May 4th, 2003, 03:45 AM
infamous-online infamous-online is offline
Moderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Posts: 404 infamous-online User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 m 10 sec
Reputation Power: 7
Cool

Quote:
Originally posted by JSBN
ok, i got it working, after having problems with restarting the server, i restarted my comp, went back into the config file, and oddly enough, all the code for that area was changed... i am still confused about that part, anyways, i re-changed the AllowOverride, and it works. THX ALOT for every one's help, all u guys r awsome

THx again, JSBN


glad we could help another fellow apache user

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsWeb DesignWeb Server Configuration > .htaccess/.htpasswd


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Linear Mode Linear Mode