Page 1 of 1

[SOLVED] Virtual Host 403 Access forbidden

PostPosted: 18. May 2009 12:37
by Ms_Sutani
Hi,

I'm trying out lampp for the first time, and it seems really nice, but I can't get virtual hosts working for this project I'm working on.
I am running the project outside of /opt/lampp/htdocs. It's in my /home/mssutani/projects directory.

Every time I try and go to my virtualhost I get a 403 error: Access forbidden.

I have edited my httpd-vhosts.conf file and I have allowed Virtual hosts in httpd.conf.

I even tried chmoding all my files and directory 777 but I still get Access forbidden.

I did some searching on this messageboard and found people with similar issues but no solutions.

Re: Virtual Host 403 Access forbidden

PostPosted: 18. May 2009 13:00
by Wiedmann
Every time I try and go to my virtualhost I get a 403 error: Access forbidden.

1st.: read the error.log what's the reason for an "access forbidden".

Re: Virtual Host 403 Access forbidden

PostPosted: 18. May 2009 14:49
by Ms_Sutani
The reason is:

[error] [client 127.0.0.1] (13)Permission denied: access to / denied

I just noticed that as soon as I enabled virtual hosts I can nolonger get into the xampp pages from http://localhost

Re: Virtual Host 403 Access forbidden

PostPosted: 18. May 2009 14:57
by Wiedmann
It's in my /home/mssutani/projects directory.
Code: Select all
[error] [client 127.0.0.1] (13)Permission denied: access to / denied

Your Apache user must have at least read access to:
/
/home/
/home/mssutani/
/home/mssutani/projects/

Re: Virtual Host 403 Access forbidden

PostPosted: 18. May 2009 15:17
by Ms_Sutani
Hmmm, I'm not sure who my apache user is. How do I find out? Generally when I'm using ubuntu it's www-data, but I'm stuck in a different distro right now and I don't know who the user is.

Also, why can't I get to the xampp pages as soon as I start virtual hosts?
Now if I go to http://localhost/xampp I get the same 403 error. It works when I turn comment out virtual hosts in the httpd.conf file.

Thanks for your help so far!

Re: Virtual Host 403 Access forbidden

PostPosted: 18. May 2009 15:25
by Wiedmann
I'm not sure who my apache user is.

The Apache user (group) is defined in "httpd.conf".

Also, why can't I get to the xampp pages as soon as I start virtual hosts?

Maybe there is no vhost for the old DocumentRoot?

Re: Virtual Host 403 Access forbidden

PostPosted: 18. May 2009 15:41
by Ms_Sutani
Maybe there is no vhost for the old DocumentRoot?


Ah, So enabling virtual host disables the default /htdocs/project from being hosted as http://localhost/project?

I think this may have done the trick! I just changed the user and group to my own user and group. I still ahve to set everything up to verify it worked properly...
and also right now I made everything read-write-executable because i was trying to figure out what was going wrong. I'll need to set the correct permissions... but so far so good!

Thank you!

Re: Virtual Host 403 Access forbidden

PostPosted: 18. May 2009 15:53
by Wiedmann
Ah, So enabling virtual host disables the default /htdocs/project from being hosted as http://localhost/project?

Let me say yes. (of course, this depends on, how you define your vhosts.)

[SOLVED] Re: Virtual Host 403 Access forbidden

PostPosted: 18. May 2009 16:37
by Ms_Sutani
I just wanted to confirm that specifying the user and group in http.conf did work for me.

I don't see a way to mark this thread as solved so, I'm trying to make it very clear incase other people run into this problem.

Thanks!

Re: [SOLVED] Virtual Host 403 Access forbidden

PostPosted: 08. May 2010 11:59
by rvrijbroek
This worked for me with windows 7 and version 1.7.3
in httpd.conf i've added the # in the directory to have it work with vhosts.
My vhosts were located outside of the root folder...

#
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
# First, we configure the "default" to be a very restrictive set of
# features.
#
<Directory />
# Options FollowSymLinks
# AllowOverride None
# Order deny,allow
# Deny from all
</Directory>