LinuxQuestions.org
Visit Jeremy's Blog.
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-24-2005, 09:19 AM   #1
KrGAce
Member
 
Registered: Dec 2004
Location: Vermont
Distribution: Ubuntu
Posts: 58

Rep: Reputation: 15
Limit Users Home Directory Size


Hello,

I am running SuSE Enterprise server here at a highschool, and teachers are currently posting files to their home directory and public_html as some have web pages. What I want to do, is limit the size of their home directory as some are starting to get out of hand. Is there a way to do this?

Also, In Apache, I am want to add a directory for files that other users can access and download. It only has to be one way (download, no upload) but I want the directory listing to show such as doman.com/downloadfiles I would like to know how to add this to Apache as well.



Thanks in advance for any help anyone can provide.






AceMan
 
Old 10-24-2005, 09:34 AM   #2
blindcoder
ROCK Linux
 
Registered: Dec 2003
Location: Berlin, Germany
Distribution: Crystal ROCK
Posts: 108

Rep: Reputation: 15
Re: Limit Users Home Directory Size

Quote:
Originally posted by KrGAce
I am running SuSE Enterprise server here at a highschool, and teachers are currently posting files to their home directory and public_html as some have web pages. What I want to do, is limit the size of their home directory as some are starting to get out of hand. Is there a way to do this?
I'm not sure if there's a more elegant way, but this might do:
Code:
dd if=/dev/zero of=/home/teacher1.filesystem bs=1M count=512
mkfs.ext2 /home/teacher1.filesystem
mount -o loop /home/teacher1.filesystem /home/teacher1
That way the user teacher1 would have a home directory of 512 MB size. I'm sure, some people will show more elegant ways

Quote:
Also, In Apache, I am want to add a directory for files that other users can access and download. It only has to be one way (download, no upload) but I want the directory listing to show such as doman.com/downloadfiles I would like to know how to add this to Apache as well.
Put this into your Apache's http.conf
Code:
<directory "/path/to/downloads">
Options Indexes
IndexOptions FancyIndexing
</directory>

HTH,
Benjamin
 
Old 10-24-2005, 09:37 AM   #3
KrGAce
Member
 
Registered: Dec 2004
Location: Vermont
Distribution: Ubuntu
Posts: 58

Original Poster
Rep: Reputation: 15
Thanks on the Apache issue, i will try that. On the home directory, what file am I editing to put that code in? Also, what if I wanted to make that Apache directory be passworded, how would/could I do that? Just firing some ideas out there, looking for possible solutions.



AceMan

Last edited by KrGAce; 10-24-2005 at 09:44 AM.
 
Old 10-24-2005, 09:43 AM   #4
blindcoder
ROCK Linux
 
Registered: Dec 2003
Location: Berlin, Germany
Distribution: Crystal ROCK
Posts: 108

Rep: Reputation: 15
Quote:
Originally posted by KrGAce
Thanks on the Apache issue, i will try that. On the home directory, what file am I editing to put that code in?
It is a series of commands to execute. I'll explain in more detail:
Code:
1: dd if=/dev/zero of=/home/teacher1.filesystem bs=1M count=512
2: mkfs.ext2 /home/teacher1.filesystem
3: mount -o loop /home/teacher1.filesystem /home/teacher1
Line 1 will create a file /home/teacher1.filesystem that is empty but 512 MB in size.
Line 2 will then create a filesystem in that file and
Line 3 will mount that filesystem on /home/teacher1/
This is a nice workaround for a few people but you'll get into trouble at around 16 people and when they request more space.
Also, you should probably mount the filesystem somewhere else first (like, /mnt/temporary, create that directory first), then copy all the teachers files there, unmount it and then mount it to /home/teacher1.
For a non-workaround solution you should really look somewhere else.
I know that there's a package called "quota" but I never used it myself.

HTH,
Benjamin
 
Old 10-24-2005, 09:48 AM   #5
KrGAce
Member
 
Registered: Dec 2004
Location: Vermont
Distribution: Ubuntu
Posts: 58

Original Poster
Rep: Reputation: 15
Okay,

I see what you mean. Is there a way now to password the directory in Apache, meaning the files couldn't be downloaded until the password was met, or do I even want to go this route. Thanks for your solutions.



AceMan
 
Old 10-24-2005, 09:59 AM   #6
blindcoder
ROCK Linux
 
Registered: Dec 2003
Location: Berlin, Germany
Distribution: Crystal ROCK
Posts: 108

Rep: Reputation: 15
Quote:
Originally posted by KrGAce
I see what you mean. Is there a way now to password the directory in Apache, meaning the files couldn't be downloaded until the password was met, or do I even want to go this route. Thanks for your solutions.
That's actually quite easy:
Create a file called .htaccess in the directory with the following content. I'll assume /home/www/private for the download directory:
Code:
AuthUserFile /home/www/private/.htpasswd
AuthGroupFile /dev/null
AuthName "Private Download Area at domain.com"
AuthType Basic

<LIMIT GET POST>
        require valid-user
</Limit>
Then, using the program htpasswd, you create the file /home/www/private/.htpasswd:
Code:
htpasswd -c /home/www/private/.htpasswd user1
htpasswd /home/www/private/.htpasswd user2
htpasswd /home/www/private/.htpasswd user3
and so on. In the Apache's httpd.conf file you need a line like this:
Code:
<directory "/home/www/private">
AllowOverride authConfig Limit
</directory>

HTH,
Benjamin
 
Old 10-24-2005, 10:48 AM   #7
KrGAce
Member
 
Registered: Dec 2004
Location: Vermont
Distribution: Ubuntu
Posts: 58

Original Poster
Rep: Reputation: 15
Thanks for all your help, I will give it a try. Many thanks,





AceMan
 
  


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
/home/directory size limit Smokey Slackware 2 11-04-2004 04:11 PM
How to LIMIT my HOME DIRECTORY SIZE??? juliann Linux - Networking 2 07-21-2004 10:08 AM
Mandrake /home directory size Limit problem psyientist Mandriva 9 05-14-2004 04:51 PM
Directory size limit macadam Linux - Newbie 3 09-22-2003 01:06 PM
Directory Size Limit?? _TK_ Linux - General 9 09-05-2002 10:38 AM


All times are GMT -5. The time now is 01:01 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration