Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hey, I just installed running Ap

Status
Not open for further replies.

frozenpeas

Technical User
Sep 13, 2001
893
CA
Hey,

I just installed Apache 2.0.40 and I have a few vhosts set up. When I try to access any of them I get a 403:

Code:
Forbidden
You don't have permission to access / on this server.

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.


--------------------------------------------------------------------------------

Apache/2.0.40 Server at [vhost1].com Port 80

Even if I try to hit it with the IP, I get the same error... it always defaults to the first vhost I have defined.

I've just migrated from 1.3 so I'm stumbling a bit.

Thanks.


 
put an index.html (or other defualt file such as the original index.shtml) in the document root of each virtual host.

You're getting this error because there's nothing there. If there's nothing there, apache will try to list the directory (which by default is not allowed) - therefore 403.

I just started working with virtual hosts myself and scratched my head for a while until I figured out this little tidbit.
 
Actually, I have an index file in there already.
 
If it defaults to the fist vhost, you may have a syntax error. Additionally, check permission settings in httpd.conf and linux, if you're running that. Newposter
"Good judgment comes from experience. Experience comes from bad judgment."
 
And "index.____" is listed in your DirectoryIndex directive? Sorry, that's the best that I can come up with without seeing your httpd.conf file.
 
I'm making progress. Each vhost is being recognized now. I overlooked adding 'www' infront of the server name.

I'm still getting the 403, though. I'm working on it.

My DirectoryIndex directive contains: index.html index.php index.htm index.shtml

Here is some of my httpd.conf:

Code:

Code:
### Section 3: Virtual Hosts

NameVirtualHost *

<VirtualHost *>
        DocumentRoot /home/domain/html
        ServerAdmin webmaster@domain.com
        ServerName [URL unfurl="true"]www.domain.com[/URL]
        ServerAlias domain.com
        TransferLog logs/domain_access_log
        ErrorLog logs/domain_error_log
<Directory &quot;/home/domain/html&quot;>
        Options FollowSymLinks
        AllowOverride All
</Directory>
<Directory &quot;/home/domain/html/cgi-bin&quot;>
        Options ExecCGI
        Allow from from all
        Order allow,deny
</Directory>
</VirtualHost>
Thanks.
 
But it must be permissions or something...

I serve the sites from the user account's home directory, like:

Code:
/home/domain/html

and the relative permissions are:

Code:
/drwxr-xr-x/drwx------/drwxrwxr-x

Thanks again.

 
Code:
<Directory &quot;/home/domain/html&quot;>
        Options FollowSymLinks
        AllowOverride All
</Directory>
should be
Code:
<Directory &quot;/home/domain/html&quot;>
        Options FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
</Directory>
//Daniel
 
Thanks, I added that.

Still get the 403 though.

 
It must be permissions... I get the error on every virtual host I try to access.

The ones I have listed above -- are those correct?
 
Yes, but does Apache have the rights to read the files in the directory? //Daniel
 
Code:
ls -l /home/domain/html
Does the permissions look like -rw-r--r--? //Daniel
 
Thanks, I had the permissions of /domain/ set at drwx------

I changed them over to drwxr-xr-x and they all work fine. So I'll presume that's a safe setup?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top