LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-14-2006, 11:52 AM   #1
realthor
LQ Newbie
 
Registered: Mar 2006
Posts: 8

Rep: Reputation: 0
how to get apache to look in users' home dirs?


I try to set up a local webserver on my debian-based linux and i started with installing Apache2. My concern is that i neither understand what should i do nor know how to do it.
First i would like you to tell me how to set apache to look for users' websites in their home directories. I know apache should look for any /home/*/public_html/ but mine doesn't.
I noticed that i haven't in my mods-loaded the userdir.load and userdir.conf. So, suspecting this was the problem, i simlinked them from mods-available and they got simlinked allright. But no effect...i guess: how should i write in the browser to access a user's webpage? I tried localhost/home/user/ but browser (or apache?)sais the /home/user/ does not exist...What's the correct path to look for?
PS: writting in browser localhost does it's job by the way;

Last edited by realthor; 03-14-2006 at 11:53 AM.
 
Old 03-14-2006, 11:58 AM   #2
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
If you are sure you have the userdir module and its enabled in your httpd.conf, you can access pages in you users home directory by doing something like http://localhost/~username/file.html. You need to make sure that the user has created a subdirectory called public_html and changed the permissions to 755. The files in public_html are the ones that will be accessed by the webserver.
 
Old 03-14-2006, 12:10 PM   #3
zeitounator
Member
 
Registered: Aug 2003
Location: Montpellier, France, Europe, World, Solar System
Distribution: Debian Sarge, Fedora core 5 (i386 and x86_64)
Posts: 262

Rep: Reputation: 30
public_html is the default name for user dir which can then be accessed through url:

http://host.serv.com/~username

Make sure UserDir is not disabled (which is the default usually) even if the module is loaded and that it is not set to an other directory name
 
Old 03-14-2006, 01:03 PM   #4
realthor
LQ Newbie
 
Registered: Mar 2006
Posts: 8

Original Poster
Rep: Reputation: 0
how can i see if it's loaded?

i made the simlink in the mods-loaded but i don't know if it loads it...(how can i check that besides writting the adress in the browser)
and second...what i should look for in my httpd.conf to see if it's enabled...i'm at work right now and i don't have a httpd.conf in front of me to check.
Third, the user's home dir is also mine but i wanted to be able to work as a user not as a root when i test my pages as i dislike having my files elsewhere but /home/user/...my case /home/thor/. I even changed in the sites-available the original /var/www/ to /home/thor/www/ .
oh, and i,ve made a /public_html in my user folder but how to change the permissions to 755?

By the way 10x for the quick response, i really appreciate it.

Last edited by realthor; 03-14-2006 at 01:28 PM.
 
Old 03-14-2006, 11:42 PM   #5
cojo
Member
 
Registered: Feb 2003
Location: St. Louis
Distribution: RedHat 8
Posts: 262

Rep: Reputation: 31
realthor,

1. you need to create a public_html directory like this /home/thor/public_html.
2. change the permission to 755 like this "chmod 755 /home/thor/public_html"
3. make sure your httpd.conf have these lines enable:

LoadModule userdir_module modules/mod_userdir.so

<IfModule mod_userdir.c>
UserDir public_html
</IfModule>
 
Old 03-15-2006, 11:08 AM   #6
realthor
LQ Newbie
 
Registered: Mar 2006
Posts: 8

Original Poster
Rep: Reputation: 0
i've made as root such a folder with konqueror, i don't nkow what permissions does it have but seemingly making those simlinks from mods-available do mods-enabled for the userdir.conf and userdir.load solved the problem. I can access users' webpages writting in the browser localhost/~thor/ which shows me it works.

Now, that i've read a little more about apache and stuff, i am in doubt. The sites i develop are going to be tested on this machine, i don't intend to put them online from here but how is it more convenient, to work as a user or as root on them. I am a little confused, apache should start as a root daemon. It starts and goes on working. The things i do for my websites do not interfere with it. So what's the difference in having my sites in /var/www/ than let's say /home/thor/www/?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
403 when trying to browse users' home pages with apache and mandriva 10.1 Niklas5000 Mandriva 3 03-14-2006 01:40 PM
apache, .htaccess in diffrent dirs.. rincewind Linux - Software 5 03-07-2005 08:47 AM
Backing Up Home Dirs before upgrade Thin Mandriva 6 02-02-2005 12:44 AM
give users access to home dirs jonas73 Linux - Newbie 2 03-16-2004 02:42 AM
vsftpd: restricting users to home dirs groovin Linux - Security 6 11-25-2002 05:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration