Setting up a Web Directory for a User

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
LVL 3
piratepatrolAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

arantiusCommented:
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
wesly_chenCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
tykealCommented:
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
piratepatrolAuthor Commented:
You guys are so helpful.  Thank you so much.  150 points for each of you.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.