Solved

How to create home directories

Posted on 2001-09-12
5
197 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
thank u very much for your help

SS
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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…
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

744 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now