LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 06-15-2004, 01:37 PM   #1
ashembers
LQ Newbie
 
Registered: May 2004
Location: Milwaukee
Distribution: Debian, RedHat
Posts: 4

Rep: Reputation: 0
Apache forwarding users to their homedirs


Hi there!

I am fairly new to Apache, but would like to make a simple HTTP download server using either myown PHP or the nice WebFileBrowser script set.

Here are my questions:

1) Would someone be good enough to point me in the direction of where I can make a decent login page?

2) I also need a pointer about where I can find more info about how Apache forwards a user to their home directory.

Thanks for your time!

Dan
 
Old 06-15-2004, 02:09 PM   #2
Donboy
Member
 
Registered: Aug 2003
Location: Little Rock, Arkansas
Distribution: RH, Fedora, Suse, AIX
Posts: 736

Rep: Reputation: 31
I think you want to look at using userdir options in apache. Just look for the httpd.conf file somewhere on your machine. Edit this file. Look for the section that talks about userdir's. You should also search the apache website. There is a nice howto on there that explains how to setup userdir's so you can enter a URL like http://yourdomain.com/~yourname and it will take the browser to a user's home directory.
 
Old 06-15-2004, 03:39 PM   #3
tjmalone
LQ Newbie
 
Registered: Jun 2004
Posts: 10

Rep: Reputation: 0
home dirs

each user needs a foler public_html,

in the /etc/http/conf/http.conf

set servername to the server name.

put a hash, in front of disable user_dir,
delete the one in front of enable user_dir

restart httpd

then each user must do these two steps.
then for each user chmod 711 user_home_dir
then for each users publiv_html chmod 755 -R public_thml
 
Old 06-16-2004, 06:44 PM   #4
ashembers
LQ Newbie
 
Registered: May 2004
Location: Milwaukee
Distribution: Debian, RedHat
Posts: 4

Original Poster
Rep: Reputation: 0
OK, I see that. Thanks - that will work.

So how do users log in? Keep in mind, I'd like to make a login page of some sort.
 
Old 06-17-2004, 12:48 AM   #5
Donboy
Member
 
Registered: Aug 2003
Location: Little Rock, Arkansas
Distribution: RH, Fedora, Suse, AIX
Posts: 736

Rep: Reputation: 31
Well, that's another can of worms. Shown below is the method I'm using. I'm absolutely sure somebody will come along behind me with another method that is better or simpler, but this is just what I'm using because its convenient for me and I can use an automated script to make these whenever I need.

First, create a file (called .htaccess) that looks like this...

Code:
AuthUserFile /path/to/your/.htpasswd
AuthGroupFile /dev/null
AuthName "Whatever You Want"
AuthType Basic

<Limit GET>
require user yourusername
#END
</Limit>
Put the above file in the directory where you want password protection. The /path/to/your should be the location of where you want to store the password file that we will create later. This can be in the same location as the .htaccess file, but many people recommend it be placed somewhere outside the document root. Personally, I think this kind of security isn't very strong and should not be used if you're trying to secure something extremely important like bank account info. If you're going to secure something that important, you really need to use SSL with this too. The "yourusername" should be whatever username you want people to enter when they login.

Now create another new file (mine is called "crypt_pass.pl") and put this inside...

Code:
#!/usr/bin/perl

($password, $salt) = @ARGV;
$password or die "usage: mycrypt password [salt]\n";
$salt = "cc" unless $salt;
$cryptpw = crypt($password,$salt);
print "$cryptpw";
This script will take your input and encrypt it. What it outputs is the encrypted version of whatever you input. Usage is like this. "./crypt_pass.pl password". What the script returns is an encrypted version of "password".

Now take the output and use it in another file... This file is called .htpasswd....

[code]
yourusername:cryptedoutput
[code]

Where "yourusername" is whatever you used in the .htaccess file above and "cryptedoutput" is whatever crypt_pass.pl generated for you.

I really recommend searching for info about .htaccess and .htpasswd and see how other people suggest doing it. LIke I said, there are a lot of ways you can do this, and there are bound to be ways that are better or simpler for you.
 
Old 06-17-2004, 10:16 AM   #6
ashembers
LQ Newbie
 
Registered: May 2004
Location: Milwaukee
Distribution: Debian, RedHat
Posts: 4

Original Poster
Rep: Reputation: 0
Donboy,

OMG, that is a lot of thought you have just given me. Can I buy you a pizza? I will try it out & let you know how it goes...
 
  


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
port forwarding apache from 80 to 8080 chess Linux - General 11 09-27-2005 03:21 PM
Port Forwarding for Apache IlyaZ Linux - Networking 14 05-15-2005 05:41 AM
Help with apache server dir and port forwarding leemoreau Linux - Software 13 03-25-2005 10:56 AM
When used as forwarding proxy apache doesn't recognize aborted downloads. da_kidd_er Linux - Networking 0 02-01-2005 10:56 PM
seperate apache, port forwarding kires Linux - General 2 04-24-2002 01:37 AM


All times are GMT -5. The time now is 10:40 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration