Password Protection With .htaccess

Questions and discussion regarding the IT behind caves.org

Moderators: vtdarrell, Moderators

Password Protection With .htaccess

Postby driggs » Dec 15, 2008 3:22 am

I've got a website hosted on grotto2.caves.org, and I'd like to add a "members only" section, protected with a password. The Apache AuthUserFile directive requires either an absolute pathname or a relative pathname from the web root... neither of which I can discern from my FTP account.

Can anyone tell me the correct path to use for locating my AuthUserFile? :shrug:
User avatar
driggs
NSS Hall Of Fame Poster
 
Posts: 495
Joined: Sep 12, 2005 9:40 pm
Location: State of Jefferson
Name: David A. Riggs
NSS #: 56189
Primary Grotto Affiliation: Monongahela
  

Re: Password Protection With .htaccess

Postby Alex Sproul » Dec 15, 2008 11:15 pm

driggs wrote:Can anyone tell me the correct path to use for locating my AuthUserFile? :shrug:


Sure, if you'll tell me what page(s) you're talking about. :shrug: BTW, there is no longer a 'grotto1' or 'grotto2' since we moved to our own dedicated server -- the host for everyone is simply 'caves.org'...

Mail me direct: webmaster@caves.org

Alex
Alex Sproul
NSS 8086RL/OS
User avatar
Alex Sproul
Frequent Poster
 
Posts: 91
Joined: Sep 7, 2005 12:58 pm
Location: Greenville, VA
Name: Alex Sproul
NSS #: 8086RL/OS
  

Re: Password Protection With .htaccess

Postby vtdarrell » Dec 17, 2008 5:57 pm

I'm posting the answer here for general reference.

The Apache DocumentRoot for www.caves.org is /var/www/vhosts/caves.org/httpdocs/

so the command in your .htaccess file is something like

AuthUserFile /var/www/vhosts/caves.org/httpdocs/grotto/mongrotto/.htpasswd

Also, grotto1.caves.org, grotto2.caves.org, and ftp.caves.org are are aliases for www.caves.org. We maintained those subdomains as aliases so that people's FTP access would not break after the move to our new server. So, any of those names is fine for your FTP host.

Lastly, sorry for the delay... I'm subscribed to this thread, so I should have been notified about your post. I wasn't.
Darrell Wells
NSS IT Chairman
NSS# 55359
User avatar
vtdarrell
NSS IT Chair
 
Posts: 27
Joined: Nov 10, 2007 9:29 am
Location: Blacksburg, Va
Name: Darrell Wells
NSS #: 55359
  

Re: Password Protection With .htaccess

Postby driggs » Dec 17, 2008 7:02 pm

Thanks Darrel, that worked perfectly! :clap:

I owe you a :beer30: !
User avatar
driggs
NSS Hall Of Fame Poster
 
Posts: 495
Joined: Sep 12, 2005 9:40 pm
Location: State of Jefferson
Name: David A. Riggs
NSS #: 56189
Primary Grotto Affiliation: Monongahela
  


Return to IT Forum

Who is online

Users browsing this forum: No registered users