How to create home directories

Posted on 2001-09-12
Last Modified: 2010-03-04
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?

Question by:Sukhwinder Singh
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2

Accepted Solution

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

# 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
        Order allow,deny
        Allow from all
        Order deny,allow
        Deny from all

If you dont want to have a subdirectory "public_html" you could try the lines
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.


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.

Author Comment

by:Sukhwinder Singh
ID: 6481356
     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?


Expert Comment

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").



Author Comment

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


Featured Post

Create the perfect environment for any meeting

You might have a modern environment with all sorts of high-tech equipment, but what makes it worthwhile is how you seamlessly bring together the presentation with audio, video and lighting. The ATEN Control System provides integrated control and system automation.

Question has a verified solution.

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

If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

688 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