You are not logged in.

#1 2009-04-02 18:00:15

palobo
Member
From: Leiria, Portugal
Registered: 2009-03-21
Posts: 68

[SOLVED] 403 Error with vhost pointing to folder in home/user

Hi all.

I have my LAMP setup working well. I have two vhosts working just fine although they are pointing to folders under /srv/http.

When I try and create a vhost pointing to /home/user/Project/public_html I get a  403 error.

I searched through a few threads but none of the info seemed to help. Here is the relevant section of my httpd-vhosts.conf file:

<VirtualHost *:80>
    DocumentRoot "/home/pedro/Projects/JGD/public_html"
    ServerName jgd
    ServerAlias jgd
    <Directory /home/pedro/Projects/JGD/public_html>
       AllowOverride All
       Order allow,deny
       Allow from all
    </Directory>
</VirtualHost>

Any help is greatly appreciated.

Cheers,
P.

Last edited by palobo (2009-04-03 10:32:40)


" If it aint broke... Then you're not trying hard enough! "

Offline

#2 2009-04-02 18:11:13

rson451
Member
From: Annapolis, MD USA
Registered: 2007-04-15
Posts: 1,233
Website

Re: [SOLVED] 403 Error with vhost pointing to folder in home/user

Have you checked that the user running the web server has permissions all the way down to that directory?

Last edited by rson451 (2009-04-03 01:26:19)


archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson

Offline

#3 2009-04-02 19:53:56

palobo
Member
From: Leiria, Portugal
Registered: 2009-03-21
Posts: 68

Re: [SOLVED] 403 Error with vhost pointing to folder in home/user

Hey rson451. Thanks for the quick reply. Yeah, I've chmod to 777 and chown user:http and http:http. Always wih the same result unfortunately.

Cheers,
P.


" If it aint broke... Then you're not trying hard enough! "

Offline

#4 2009-04-02 21:53:32

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,223
Website

Re: [SOLVED] 403 Error with vhost pointing to folder in home/user

Can you temporarily move that directory to /srv/http and see if it works there?  Then we can know if it's the directory itself, or the directories where it's located...

Offline

#5 2009-04-02 22:04:22

palobo
Member
From: Leiria, Portugal
Registered: 2009-03-21
Posts: 68

Re: [SOLVED] 403 Error with vhost pointing to folder in home/user

fukawi2, it works just fine in /srv/http. I could easily add my user to http group and code directly there, but I got used to working this way and find it much easier, therefore I would like to solve this problem.

Cheers and thanks all for any help,
P.


" If it aint broke... Then you're not trying hard enough! "

Offline

#6 2009-04-02 22:33:22

pyther
Member
Registered: 2008-01-21
Posts: 1,395
Website

Re: [SOLVED] 403 Error with vhost pointing to folder in home/user

whats the permissions on your home folder?


Website - Blog - arch-home
Arch User since March 2005

Offline

#7 2009-04-02 23:21:00

palobo
Member
From: Leiria, Portugal
Registered: 2009-03-21
Posts: 68

Re: [SOLVED] 403 Error with vhost pointing to folder in home/user

For my home folder I've got 700 but for my Projects folder I've tried with 775 and 777 alike. Both produce the same results.


" If it aint broke... Then you're not trying hard enough! "

Offline

#8 2009-04-02 23:47:14

archlinuxsagi
Member
Registered: 2008-09-12
Posts: 259

Re: [SOLVED] 403 Error with vhost pointing to folder in home/user

palobo wrote:

For my home folder I've got 700 but for my Projects folder I've tried with 775 and 777 alike. Both produce the same results.

your /home/pedro folder need to be executable too not only the Project folder.
Please see http://wiki.archlinux.org/index.php/LAMP

Offline

#9 2009-04-03 01:14:27

rson451
Member
From: Annapolis, MD USA
Registered: 2007-04-15
Posts: 1,233
Website

Re: [SOLVED] 403 Error with vhost pointing to folder in home/user

If you want to take the easy way out and use http://example.tld/~pedro/projects/jgd/ etc... there is an apache module, mod_userdir, meant for that specifically.  I find it strange that your ServerName and ServerAlias are just jgd, but that's probably because I'm not too familiar with vhosts.


archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson

Offline

#10 2009-04-03 01:20:40

palobo
Member
From: Leiria, Portugal
Registered: 2009-03-21
Posts: 68

Re: [SOLVED] 403 Error with vhost pointing to folder in home/user

archlinuxsagi wrote:
palobo wrote:

For my home folder I've got 700 but for my Projects folder I've tried with 775 and 777 alike. Both produce the same results.

your /home/pedro folder need to be executable too not only the Project folder.
Please see http://wiki.archlinux.org/index.php/LAMP

Thanks. I will give that a try and report back my results.



rson451 wrote:

... I find it strange that your ServerName and ServerAlias are just jgd, but that's probably because I'm not too familiar with vhosts.

This is my development machine and therefore me being lazy find it easier to have multpile projects I'm working on as http://jgd rather than something along the lines of http://localhost/jgd. When the projects go live then they will have a proper name/alias.

Thanks all for your responses. I will let you know of the results.

Cheers,
P.


" If it aint broke... Then you're not trying hard enough! "

Offline

#11 2009-04-03 10:33:54

palobo
Member
From: Leiria, Portugal
Registered: 2009-03-21
Posts: 68

Re: [SOLVED] 403 Error with vhost pointing to folder in home/user

Thanks all for your help. Setting chmod to o+x on my home dir did the trick (as instructed in the wiki. I just missed that step :-S)

Cheers,
P.


" If it aint broke... Then you're not trying hard enough! "

Offline

Board footer

Powered by FluxBB