Solved

How to create home directories

Posted on 2001-09-12
5
199 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
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…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

930 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

12 Experts available now in Live!

Get 1:1 Help Now