logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Need htpasswd help, probably pretty easy answer.
Author
nob4uask



Joined: 19 Aug 2010
Posts: 15

PostPosted: Tue 31 Aug '10 2:25    Post subject: Need htpasswd help, probably pretty easy answer. Reply with quote

Morn all (Over Here).

First I would really like to thank glsmith for helping me get my configuration set up.

Now to the issue. I have basic authorization used on my website which works great. I created a sub directory but want to restrict access to that for only certain members that log on. I tried adding the sub directory to the httpd file but didn't seem to work. Maybe I had it in the wrong place. Any help would be appreciated.

I am new to this so please be a little patient and thorough on your explanations.
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Tue 31 Aug '10 19:11    Post subject: Reply with quote

G'day,

I'm not sure there is a wrong place for a <Directory> container but maybe so. Post us the part of your config concerning the issue.
Back to top
nob4uask



Joined: 19 Aug 2010
Posts: 15

PostPosted: Tue 31 Aug '10 20:56    Post subject: httpd info Reply with quote

lol... glsmith, you would fit in just fine over in Oz land.

Below bold is what is in my httpd file. It is pretty generic but that is all I need for what I am doing. This site is so that a few of us Dallas Cowboys fans can go someplace to watch the game and chat without the usual public site issues. Please don't tell me that you are a Giants, Eagles, Redskins or 49rs fan, you might try to sabotage my site...lol

My site & files are in F:/Cowboys Website. I have a sub-directory called Mods that has a page that opens in another window for the Moderators to discuss site business. There is a link on the Main site that opens up the Mod Page but the password thingy doesn't pop up.

If there is a better way to do this then please let me know, but as usual make sure you explain like I am reading "Apache for Dummies"..lol

Be safe.


DocumentRoot "F:/Cowboys Website"

<Directory />
Options FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all
</Directory>

<Directory "F:/Cowboys Website">

Options Indexes FollowSymLinks
AuthType Basic
AuthName "Restricted Files"
AuthBasicProvider file
AuthUserFile "F:/Cowboys Website/htpasswd"
Require valid-user
AllowOverride None
Order allow,deny
Allow from all

</Directory>

<Directory "F:/Cowboys Website/Mods">

Options Indexes FollowSymLinks
AuthType Basic
AuthName "Restricted Files"
AuthBasicProvider file
AuthUserFile "F:/Cowboys Website Mods/htpasswd"
Require valid-user
AllowOverride None
Order allow,deny
Allow from all

</Directory>
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Tue 31 Aug '10 22:32    Post subject: Reply with quote

OK, I see nothing wrong here.

One question, when you first http:// to the site, do you have to login? In other words, is it working there since you are also requiring Auth in /Cowbows Website?

No, fair weather Charger fan, we hate anyone we are playing that week ... we always hate Broncos & Raiders ... lol
Back to top
nob4uask



Joined: 19 Aug 2010
Posts: 15

PostPosted: Wed 01 Sep '10 0:02    Post subject: Reply with quote

A charger fan... Hmmm. I always wanted Norv to make it being an ex-cowboy coach so as long as they aren't playing the Cowboys I kinda like to see them win.

If you go to http://thegang.game-host.org:4562 then you get the initial login. Once inside of the site there is a link that goes to a page in the sub folder \Mods. That is where it doesn't ask for a password.
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Wed 01 Sep '10 0:35    Post subject: Reply with quote

OK ... and that is why, once you're logged in, your logged in. Just cause you go up the directory tree has no bearing since the Auths are identical.

If the one in F:/Cowboys Website/Mods is just the folks that have access to Mods, you need do nothing.

You may want to test by adding a test user to F:/Cowboys Website/.htpasswd and not in the one in mods. Then login to the site using the test user and try clicking your link .. you should get the UN/PW prompt since the test user was not added to the htpasswd file Mods is looking at.

Another thing I just noticed .... make the file names

(dot)htpasswd______ -> .htpasswd

Why? Cause in httpd.conf you will find a Directory container/block that denies viewing of the .ht* files, without the (dot) as the first character, the files do not match the rule and therefor could be read by anyone with access to the site. It may not matter in this situation but a good habit to get into.

Some editors (Notepad especially) will not want to save the file with this name. Enclosing the filename in quotes ".htpasswd" then clicking the save button and it will work. Windows will also not let you change the filename this way either, so you will have to open it in an editor and save under the new filename, then delete the old undotted file.


Last edited by glsmith on Wed 01 Sep '10 1:07; edited 3 times in total
Back to top
nob4uask



Joined: 19 Aug 2010
Posts: 15

PostPosted: Wed 01 Sep '10 14:25    Post subject: Problem Solved. Reply with quote

Even glsmith.

Once again, your the man.

Thanx for the help, especially how to change the name to .htpasswd. After I posted this morning and left for the day I started thinking the same thing. I added another member and they can only access the main site.

I'm sure I will have other questions in the future.

Off the subject, if you have problems getting any Charger games let me know. I might just be able to help you with that soon.
Back to top


Reply to topic   Topic: Need htpasswd help, probably pretty easy answer. View previous topic :: View next topic
Post new topic   Forum Index -> Apache