LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-14-2004, 12:40 PM   #1
mrtwice
Member
 
Registered: Feb 2002
Distribution: xubuntu 8.10
Posts: 225

Rep: Reputation: 31
.htaccess code for blocking CVS directories


I have a website that I use CVS to keep updated. I would like to block access to any of the administrative CVS directories. Could someone give me the code that I would need to put in my document root .htaccess file? I believe I would need to use the regex method and have something like CVS/*, but I could not figure out exactly which way would be the best.
 
Old 10-12-2004, 01:38 PM   #2
shaynesweeney
LQ Newbie
 
Registered: Oct 2004
Posts: 3

Rep: Reputation: 0
If you have a directory listing of this, the easiest way to block it from there is to assign a username to that dir. If that doesn't make sense ... here is an example of how I use this method so users of my directory listing see/can't see other 'per user' directories.

You need to make a wep password file, I called mine, 'web-passwd', then you need to move this to a web-safe directory, by saying "need to" that means, highly suggested.

Ok, now we have an empty file in a web-safe directory, now let's add a username and password to it.

From the command line in linux run this command (note, make sure you are in the same DIR as your 'web-passwd' file:

htpasswd web-passwd USERNAME

USERNAME being the username you wish to lock this down to.
The htpasswd program will prompt for a new passwd, go ahead and enter whatever you want.

Ok, all done?

Good.

Now ... go in to the CVS directory on your webserver, the one we are trying to block out.

Create the file .htaccess within this DIR ... have the contents look something similar to this:

require user USERNAME

Now go into the document root of the DIR listing and create another .htaccess:

AuthUserFile /home/web-safe/web-passwd
AuthName 'Private Area'
AuthType Basic


Apache will automatically hide that folder from the DIR listing because it knows that you are not logged in as your USERNAME ... it works for me!

Shayne
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
.htaccess files doesn't work in home directories rehtorisi Linux - Software 3 08-08-2005 08:02 AM
User Preferences: Use HTML code instead of vB code? (vB code is overrated) stefanlasiewski LQ Suggestions & Feedback 5 07-26-2005 01:37 AM
download source code of one parket with cvs kernelvn *BSD 8 06-21-2005 04:47 PM
Fedora Core 3: How to get the kernel source code into the relevant directories? Madhavikutty Fedora 5 03-10-2005 03:52 PM
video streaming in .htaccess password protected directories Houseofcyn Linux - Newbie 1 12-20-2004 02:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration