Solved

How to create home directories

Posted on 2001-09-12
5
202 Views
Last Modified: 2010-03-04
Hello,
I have installed apache 1.3.20 on my RedHat 7.1 Linux Machine.
I want to know does apache automatically assigns each user of the computer his home directory or I have to create home directory for each user on the system.

For example if a new user abc is added to the system his home directory /home/abc is created by the system. I want that he should be able to access files in /home/abc directory using url like http://localhost/~abc.
How I can do this?

SSruprai
0
Comment
Question by:Sukhwinder Singh
  • 3
  • 2
5 Comments
 
LVL 1

Accepted Solution

by:
Zook earned 50 total points
ID: 6478877
All you have to do is editing these example lines in your httpd.conf

#
# UserDir: The name of the directory which is appended onto a user's home
# directory if a ~user request is received.
#
<IfModule mod_userdir.c>
    UserDir public_html
</IfModule>

#
# Control access to UserDir directories.  The following is an example
# for a site where these directories are restricted to read-only.
#
<Directory /home/*/public_html>
    AllowOverride FileInfo AuthConfig Limit
    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
    <Limit GET POST OPTIONS PROPFIND>
        Order allow,deny
        Allow from all
    </Limit>
    <LimitExcept GET POST OPTIONS PROPFIND>
        Order deny,allow
        Deny from all
    </LimitExcept>
</Directory>


If you dont want to have a subdirectory "public_html" you could try the lines
UserDir
or
UserDir .

(Haven't tried it, but it should work.)

Keep in mind that the files and all the directories below have to be readable for the user under which apache runs. That normally means they have to be world readable. Apache does not use the permissions of the refering user.

If it doesn't work, make sure you habe mod_userdir installed.

cu
Zook
0
 

Author Comment

by:Sukhwinder Singh
ID: 6480948
It means I have to make entry in httpd.conf for every user manually. And where should I create public_html.

For example if I have a user abc and its home directory is /home/abc where public_html should be created and what entry has to be made in httpd.conf and with what url this directory will be accessed. e.g. http://localhost/~abc

If I am wrong please explain with an example assuming a user name abc.
0
 

Author Comment

by:Sukhwinder Singh
ID: 6481356
Hello,
     Thank you very much for your help every thing is working. I didn't get it first time. I know that I don't have to add any user name to httpd.conf but please explain what /home/*/public_html means?

SSRuprai
0
 
LVL 1

Expert Comment

by:Zook
ID: 6503376
Sorry for the delay - I was on vacation.


The * in /home/*/public_html is just resolved to the user name, implying that the user's homedir has the name of the user. You can of course also use another path like /usr/local/home/*/public_www or just /home/*

The "public_www" can be created by adding it to /etc/skel (see "man useradd").

cu
Zook

0
 

Author Comment

by:Sukhwinder Singh
ID: 6504186
thank u very much for your help

SS
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction As you’re probably aware the HTTP protocol offers basic / weak authentication, which in combination with the relevant configuration on your web server, provides the ability to password protect all or part of your host.  If you were not…
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question