Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
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.
|
|
10-12-2010, 07:59 PM
|
#1
|
Member
Registered: Sep 2010
Location: Washington state, USA
Distribution: Ubuntu among others
Posts: 75
Rep:
|
Trouble setting up Apache per-user directories
Hello all,
I've got an older PC loaded with a basic server install of Ubuntu 10.04.1 LTS. I installed LAMP via tasksel, and webmin as well. Access over the LAN to the server ip address shows the default 'It works!' page on port 80, I can get to the phpmyadmin page, I can get into webmin, etc. What I *can't* seem to do is get per-user directories working.
I enabled the Userdir module via webmin, created the /home/monte/public_html directory, populated it with a simple index.html file, changed the ownership of the directory to monte:www-data, set the permissions of the directory (and the files inside) to 0775... and I still get a "403 Forbidden: You don't have permission to access /~monte on this server" message when I try to navigate to server-ip/~monte.
Any ideas or suggestions would be most welcome.
TIA,
Monte
|
|
|
10-12-2010, 08:38 PM
|
#2
|
LQ Newbie
Registered: Jul 2008
Location: Bangalore, India
Posts: 6
Rep:
|
Hi,
Please check the access log and error log of the apache service.... Access log will show the exact directory that is being accessed... Also verfiy your virtual host entry...
If you can't troubleshoot, plz paste the error messages in the access log file here..
-Karthik
|
|
|
10-12-2010, 08:45 PM
|
#3
|
Member
Registered: Sep 2010
Location: Washington state, USA
Distribution: Ubuntu among others
Posts: 75
Original Poster
Rep:
|
Hmmm... looks like I need to set my user directory permissions to 0751 (not the default on Ubuntu, apparently) to allow read access of the files by apache2. Is there a better way to do this? Given the choice I'd rather the user home directory itself have 0700 permissions, and finagle group memberships to make this work... is that a realistic goal and how should I proceed - add users to the www-data group, etc.?
Monte
|
|
|
03-13-2011, 03:29 PM
|
#4
|
LQ Newbie
Registered: Mar 2011
Location: Upstate New York
Distribution: Ubuntu
Posts: 1
Rep:
|
I ran into the same problem. Rather than changing the permissions of my user directory, I created a directory within /var/www specifically for per-user directories. Then I created a directory for each user (easy for me, since currently I'm the only user) with that user as the owner and group. Then I created a link in my user directory from that per-user directory, and called the link public_html, so it creates roughly the same effect from the user's perspective, but without the security problems of changing the permissions for the user directory.
sudo mkdir /var/www/users/
sudo mkdir /var/www/users/someUserDir
sudo chown someUser:someUser someUserDir
sudo chmod 751 /var/www/users/someUserDir
sudo ln -s /var/www/users/SomeUserDir /home/someUser/public_html
At this point, if you're "someUser," you can simply treat the public_html as if it's a directory, and the permissions problem goes away. I don't know that this is the best way to do it--I'd certainly be open to suggestions for a more elegant solution.
--Sam
|
|
|
All times are GMT -5. The time now is 05:19 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
|
|