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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
03-14-2006, 11:52 AM
|
#1
|
LQ Newbie
Registered: Mar 2006
Posts: 8
Rep:
|
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.
|
|
|
03-14-2006, 11:58 AM
|
#2
|
LQ Guru
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298
Rep:
|
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.
|
|
|
03-14-2006, 12:10 PM
|
#3
|
Member
Registered: Aug 2003
Location: Montpellier, France, Europe, World, Solar System
Distribution: Debian Sarge, Fedora core 5 (i386 and x86_64)
Posts: 262
Rep:
|
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
|
|
|
03-14-2006, 01:03 PM
|
#4
|
LQ Newbie
Registered: Mar 2006
Posts: 8
Original Poster
Rep:
|
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.
|
|
|
03-14-2006, 11:42 PM
|
#5
|
Member
Registered: Feb 2003
Location: St. Louis
Distribution: RedHat 8
Posts: 262
Rep:
|
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>
|
|
|
03-15-2006, 11:08 AM
|
#6
|
LQ Newbie
Registered: Mar 2006
Posts: 8
Original Poster
Rep:
|
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/?
|
|
|
All times are GMT -5. The time now is 10:06 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|