Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Servers & Networking
FedoraForum Search

Forgot Password? Join Us!

Servers & Networking Discuss any Fedora server problems and Networking issues such as dhcp, IP numbers, wlan, modems, etc.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 22nd March 2006, 01:24 AM
paul_mat Offline
Registered User
 
Join Date: Mar 2005
Posts: 55
Password protect apache home directories

hi there,

i'm trying to get it so that when you access

http://www.example.com/~usera

you are asked for a password & username, if it's not the username/password of usera then they are denied.
__________________
If you were waiting for the opportune moment, that was it...

Townsville Linux Users Group
http://tlug.dnho.net/

Open Source How To Guides (My Website)
http://www.opensourcehowto.org/

My ServerSetup Scripts
http://www.opensourcehowto.org/uploads/serversetup/
Reply With Quote
  #2  
Old 22nd March 2006, 01:31 AM
daverj Offline
Registered User
 
Join Date: Jan 2006
Location: Denver, CO USA
Posts: 670
Shouldn't be too hard. Simply create a login page.

Dave
Reply With Quote
  #3  
Old 22nd March 2006, 01:37 AM
paul_mat Offline
Registered User
 
Join Date: Mar 2005
Posts: 55
do you mind giving me a little more information on that? such as an example, a link to a page explaining it? or just tell me what you mean?

at the moment if a user goes to http://www.example.com/~username they can access there home directory, with no password.

i need to prevent anyone from being able to access that page other than the user?
__________________
If you were waiting for the opportune moment, that was it...

Townsville Linux Users Group
http://tlug.dnho.net/

Open Source How To Guides (My Website)
http://www.opensourcehowto.org/

My ServerSetup Scripts
http://www.opensourcehowto.org/uploads/serversetup/
Reply With Quote
  #4  
Old 22nd March 2006, 02:46 AM
daverj Offline
Registered User
 
Join Date: Jan 2006
Location: Denver, CO USA
Posts: 670
What exactly happens when someone hits http://www.example.com/~username? Is a directory listing presented? Is a webpage presented? If it is a webpage, then creating a login form will do it. If it is a directory listing, then I am not sure how to do this since behind the scenes it is (most likely) the apache user that accesses the directory. You could still have a login form, but then you would need to programatically generate the directory contents. Not sure yet how to do that, but it shouldn't be too hard with PHP or Perl.

Dave

Last edited by daverj; 22nd March 2006 at 02:58 AM.
Reply With Quote
  #5  
Old 22nd March 2006, 03:39 AM
paul_mat Offline
Registered User
 
Join Date: Mar 2005
Posts: 55
yes, it is a directory listing.

At the moment i can make it so when visiting www.example.com/~usera you have to be a valid ldap user.

http://www.yourhowto.org/content/view/47/9/ - this is how i have set this up

now i want to make it so only the user who own the home directory can access it, not all valid users
__________________
If you were waiting for the opportune moment, that was it...

Townsville Linux Users Group
http://tlug.dnho.net/

Open Source How To Guides (My Website)
http://www.opensourcehowto.org/

My ServerSetup Scripts
http://www.opensourcehowto.org/uploads/serversetup/
Reply With Quote
  #6  
Old 22nd March 2006, 04:47 AM
Spoon! Offline
Registered User
 
Join Date: Aug 2005
Location: Hell
Posts: 758
To password protect a directory (or file or whatever), read this: http://httpd.apache.org/docs/2.2/howto/auth.html
Reply With Quote
  #7  
Old 22nd March 2006, 07:25 AM
paul_mat Offline
Registered User
 
Join Date: Mar 2005
Posts: 55
thanks spoon!

off that website i came to this

http://httpd.apache.org/docs/2.2/mod...thz_owner.html

but i'm not sure if i have the mod_authz_owner

can someone tell me how to find out if i do?

if someone here has ever used this mod or knows how to use it with ldap
can they tell me about it.

this is my current setup and it's not working, it's just denying me access

<Directory /home/*/public_html>
AuthType Basic
AuthName "Case Network ID"
AuthLDAPURL "ldap://127.0.0.1/ou=people,dc=fedora,dc=directory,dc=server"
AuthLDAPBindDN "uid=root,ou=people,dc=fedora,dc=directory,dc=serv er"
AuthLDAPBindPassword "password"
Satisfy All
require file-owner
</Directory>

when i change it to

require valid-user it works

PS: go the tick! i always loved his battle cry! Spoon!!
__________________
If you were waiting for the opportune moment, that was it...

Townsville Linux Users Group
http://tlug.dnho.net/

Open Source How To Guides (My Website)
http://www.opensourcehowto.org/

My ServerSetup Scripts
http://www.opensourcehowto.org/uploads/serversetup/
Reply With Quote
Reply

Tags
apache, directories, home, password, protect

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
creative zen password protect help Wiles Using Fedora 0 17th June 2008 01:01 AM
Apache & Serving web pages from user's home directories TheOlster Servers & Networking 2 10th May 2006 11:53 AM
openldap apache home directories paul_mat Servers & Networking 0 21st March 2006 01:34 PM
SELinux, vsftpd, home directories and apache GBH Security and Privacy 2 26th October 2005 01:08 PM


Current GMT-time: 06:17 (Tuesday, 21-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat