Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

htacess question...... 2

Status
Not open for further replies.

coldfused

Technical User
Jan 27, 2001
2,442
US
Ok Guys setting some protected files..

created the .htaccess file inside folder set to be protected folder.

created the .htpasswd file inside the folder to hold the password information.

Set both .htaccess and .htpasswd files to 644.

Set password folder to 711.

Didn't set permissions on the protected files folder, it's default is 755.

Now I placed just a gif file in the folder with the .htaccess file to test. I type in the url to goto the file and I get this error:

Error 403! Access denied
The directory or file you tried to access has been blocked from public access. Please try again, or inform the webmaster if you believe this is an error.


Now my question is should I not be promted to enter a user name and password to get to this file instead of the error message. However I never created a user name and password input page, do I need to do this and make it the index page for the .htaccess page? Or does the server automatically do this for you when you try to enter?

Guys please set me straight and get me going on this, first one so sorry for being dumb.
logo.gif


carlsatterwhite@orlandomediasolutions.com
 
Hi mate,

I'm a bit rusty with permissions as I use Windows servers now so I am not sure about them, try setting them all to 755 until you troubleshoot this.

The prompt for the password is server generated, you dont have to do anything other than add an htaccess for authentication.

Possibly, your syntax in your htaccess is denying all access, post it here and we can see if it is correct.

Hope this helps Wullie

- Send your e-mail to santa!! [santa]

The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell
 
AuthUserFile      AuthGroupFile /dev/null
     AuthName ABC Web Log In
     AuthType Basic

     <Limit GET>
          require user NAME
</Limit>

Changed the actual name of the site and user name of course, trust you wullie, but not most..Nothing there yet, but dont want to go back and change everything once were done.
logo.gif


carlsatterwhite@orlandomediasolutions.com
 
Hi mate,

The AuthName sometimes requires to be surrounded by quotes, though this is not always the case, try it without if this doesnt work.

The htpasswd file cannot be called by a browser and therefor needs the full server path and not a url.

AuthUserFile /full/path/to/public_html/password_files/.htpasswd
AuthGroupFile /dev/null
AuthName &quot;Virts Web Log In&quot;
AuthType Basic

<Limit GET POST>
require valid-user
</Limit>


If this doesn't work, then let me know.

Hope this helps Wullie

- Send your e-mail to santa!! [santa]

The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell
 
I also mean't to mention that the require valid-user authenticates anyone that is listed in that password file.

If you want to use only certain people from a file then you need to use the line that you originally had.

For the sake of making this easy for you in the future, you are better to keep the valid-user and keep separate password files for each area. This allows you to see at a glance what users are allowed into each directory.

Hope this helps Wullie

- Send your e-mail to santa!! [santa]

The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell
 
is it

require valid-username

or

require valid-Name
logo.gif


carlsatterwhite@orlandomediasolutions.com
 
ok cool, posted that before your second reply to that..

be back in a few, let ya know..

Carl
logo.gif


carlsatterwhite@orlandomediasolutions.com
 
Hi mate,

I am not sure if we were posting together so you may not have read my last post.

require valid-user means allow all users that exist within that password file.

require user wullie would anly allow the user wullie to enter, no matter how many people were listed in that password file.

Hope this helps Wullie

- Send your e-mail to santa!! [santa]

The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell
 
Yeh I got that last post, however the changes we made still gave me the same error..

Would you do this if you have time, walk me through the steps(exactly please) as if you were doing this yourself, to make sure I did everything I should have done.
logo.gif


carlsatterwhite@orlandomediasolutions.com
 
Hi mate,

I have already written an FAQ on this in the Apache forum but I am not sure whether this would help you or not as it doesnt look like this is your own server. faq65-1830

If not, let me know and I will write out details when I get time.

Hope this helps Wullie

- Send your e-mail to santa!! [santa]

The pessimist complains about the wind. The optimist expects it to change.
The leader adjusts the sails. - John Maxwell
 
No this is not my server, but thanks for your time.

I'll keep trying till I work it out..
logo.gif


carlsatterwhite@orlandomediasolutions.com
 
Set all your related folder permissions to 755, and if it works, then restrict them til it doesn't, then restore to most restrictive working set. Newposter
&quot;Good judgment comes from experience. Experience comes from bad judgment.&quot;
 
Also, if you have access to your raw server logs then read the error log to see if that gives any clues. If it shows an error, post it here and we can explain what it means.

If you don't have access, ask your host to either give you access or tell you the paths to the logs so that you can parse them with a script.

Hope this helps Wullie

- Send your e-mail to santa!! [santa]

The pessimist complains about the wind. The optimist expects it to change.
The leader adjusts the sails. - John Maxwell
 
Will do wullie..

I have checked and double checked these files and nothing is wrong with the way I have it set up. SO, I will look into giving the host a call tomorrow morning. It is actually new my jobs host so I haven't deal't with them much. But I will call in the morning and ask a million questions..

Will post tomorrow and let ya know!

Thanks again.....
logo.gif


carlsatterwhite@orlandomediasolutions.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top