[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Setting up a Web Directory for a User

Posted on 2004-11-30
4
Medium Priority
?
320 Views
Last Modified: 2012-05-05
Hi Linux friends,

I would like to set up web directories for the users in my Linux server.  I already have Apache running.  Am I supposed to create a "homepage" directory in the user's home directory and access the web directory with http://localhost/~username ?  Please advise.

Thank you so much,


Jazon from Jacksonville, FL
0
Comment
Question by:piratepatrol
4 Comments
 
LVL 18

Assisted Solution

by:arantius
arantius earned 600 total points
ID: 12710146
piratepatrol,
You need to use mod_userdir
http://httpd.apache.org/docs-2.0/mod/mod_userdir.html

Most default apache installations have this set up properly.  There will need to be a directory, often called public_html, in the user's home directory, then yes, /~username/ .
0
 
LVL 38

Accepted Solution

by:
wesly_chen earned 600 total points
ID: 12710313
Hi,

   Here is my /etc/httpd/conf/httpd.conf for your reference:
-------------------------------
<Directory /home/*/public_html>     <=========== the path may vary
     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>
UserDir /home/*/public_html     <=== path may vary
UserDir disabled
UserDir enabled piratepatrol  <=== add your users here
--------------------

    So users put their homepages under ~username/public_html, then you can browse them through
http://localhost/~username 

Regards,

Wesly
0
 
LVL 1

Assisted Solution

by:tykeal
tykeal earned 600 total points
ID: 12711155
Yes, however, permissions into the directory tree need to be set so that other has execute.

chmod o+x /home/<user>
chmod o+x /home/<user>/public_html

If other doesn't have execute on the directory then apache can't descend into it to look for files.

Anything in the public_html tree needs to also be o+r for permissions.
0
 
LVL 3

Author Comment

by:piratepatrol
ID: 12712354
You guys are so helpful.  Thank you so much.  150 points for each of you.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
I have written articles previously comparing SARDU and YUMI.  I also included a couple of lines about Easy2boot (easy2boot.com).  I have now been using, and enjoying easy2boot as my sole multiboot utility for some years and realize that it deserves …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses
Course of the Month18 days, 16 hours left to enroll

834 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