LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-27-2007, 12:04 AM   #1
Icantprintinlinux
LQ Newbie
 
Registered: Oct 2007
Posts: 15

Rep: Reputation: 0
apache private dir


hey in my apache server I want to make a /var/www/private folder
and I want it to prompt a username and password using the authentication that is built into apache. I just don't know how to do that lol :P
 
Old 10-27-2007, 01:51 AM   #2
KrazyKanuk
Member
 
Registered: Sep 2007
Location: St. Catharines, Ontario
Distribution: Slackware 15/64 bit
Posts: 115

Rep: Reputation: 15
check out .htaccess files so what you do is "cd /var/www/private" and then (pico|vi|nano or some other editor) .htaccess and make it look like this
Code:
AuthType Basic
AuthUserFile /full path to/.htpasswd
AuthName SomeName
require valid-user
satisfy any
then do
htpasswd -bc /full path to/.htpasswd <username> <password>
 
Old 10-27-2007, 02:05 AM   #3
Icantprintinlinux
LQ Newbie
 
Registered: Oct 2007
Posts: 15

Original Poster
Rep: Reputation: 0
Sweet thanks, but how do i use the .htaccess file, I know it is in every directory but i went "vi .htaccess" and it thinks it's a new file, is that correct?
 
Old 10-27-2007, 02:12 AM   #4
KrazyKanuk
Member
 
Registered: Sep 2007
Location: St. Catharines, Ontario
Distribution: Slackware 15/64 bit
Posts: 115

Rep: Reputation: 15
It is a new file that you are creating with code that I supplied (or similar). It is not in every directory if you put it in /var/www/private it is in that directory and every directory below it.
 
Old 10-27-2007, 10:21 AM   #5
esaym
Member
 
Registered: Nov 2006
Distribution: Lots of Debian
Posts: 165

Rep: Reputation: 32
Not hard. I don't know it off of the top of my head but the info is easily found on google: http://www.google.com/search?hl=en&s...ss&btnG=Search

Also you will want to use ssl to create a secure connection because the password and user name is sent in clear text. I used this tutorial and found it worked out really well for me: http://ubuntuforums.org/showthread.php?t=4466
 
  


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
Use an other dir for apache files Rindert Linux - General 4 05-22-2006 11:19 AM
Apache Home Dir Nige General 1 02-24-2004 04:10 PM
apache 2 dir browsing Spaz17 Linux - Software 4 10-22-2003 03:00 PM
errormsg: mkdtemp:private socket dir: no space left on device (?) s7nner Linux - General 2 06-10-2003 08:46 PM
poblem with apache and private public_html keevitaja Linux - Newbie 0 08-16-2002 11:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:44 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