Page 1 of 1

Access Forbidden

PostPosted: 14. September 2009 19:13
by Raproductions
I installed Xammp on my External 1Tb harddrive and had no problems with it i had a couple of virtual hosts setup and they worked fine. So i decided that it was time to try and install it on my computer for Portability and i set it up wnt to local host and had no problem i restart my computer and i turn on the control panel and type LocalHost and it comes up with a page like that says

Access forbidden!
You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.

If you think this is a server error, please contact the webmaster.

Error 403
localhost
9/14/2009 11:01:28 AM
Apache/2.2.12 (Win32) DAV/2 mod_ssl/2.2.12 OpenSSL/0.9.8k mod_autoindex_color PHP/5.3.0 mod_perl/2.0.4 Perl/v5.10.0


I have tried changing the Permission levels i have tried running Xampp as an Admin. MY laptop is Hp dv5 with 4gb ram and a Intel Core 2 Duo CPU T6400 @ 2.00GHZ with a Vista 64bit Home Premium

Re: Access Forbidden

PostPosted: 15. September 2009 16:22
by dmphotography
Try adding the following Apache directives to your VirtualHost:

Code: Select all
<VirtualHost *:80>
ServerName myseconddomain.com
ServerAlias www.myseconddomain.com
DocumentRoot "C:/xampp/htdocs2"
<Directory "C:/xampp/htdocs2">
Options Indexes +FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>


This will most likely fix your problem, although you should read the Apache documentation on these to understand exactly what they're doing.

Re: Access Forbidden

PostPosted: 16. September 2009 05:39
by Raproductions
I have one last question i have changed my Vhosts.config and my hosts file in C:\system 32\Drivers\Etc\Hosts.config file and when i type in my server address say Rlcwh.local i get the first site which is greattaste.local in the site what am i doing wrong
Code: Select all
<VirtualHost *:80>
ServerName Greattaste.local
ServerAlias www.Greattaste.local
DocumentRoot "C:\Web Design\Ron Beachump\Test\htdocs"
<Directory "C:\Web Design\Ron Beachump\Test\htdocs">
Options Indexes +FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName Rlcwh.local
ServerAlias www.Rlcwh.local
DocumentRoot "C:\Web Design\Robert Skillings\RLCWH.com"
<Directory "C:\Web Design\Robert Skillings\RLCWH.com">
Options Indexes +FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName Mybugtube.local
ServerAlias www.Mybugtube.local
DocumentRoot "C:\Web Design\Mr. Hill\Mybugtube.com"
<Directory "C:\Web Design\Mr. Hill\Mybugtube.com">
Options Indexes +FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>


Hosts file found at C:\Windows\System32\drivers\etc
Code: Select all
127.0.0.1       localhost
::1             localhost
127.0.0.1 Greattaste.local
::1       Greattaste.local
127.0.0.1 Rlcwh.local
::1       Rlcwh.local
127.0.0.1 mybugtube.local
::1       mybugtube.local
                               

Re: Access Forbidden

PostPosted: 16. September 2009 16:05
by dmphotography
Raproductions wrote:I have one last question i have changed my Vhosts.config and my hosts file in C:\system 32\Drivers\Etc\Hosts.config file and when i type in my server address say Rlcwh.local i get the first site which is greattaste.local in the site what am i doing wrong
Code: Select all
<VirtualHost *:80>
ServerName Greattaste.local
ServerAlias www.Greattaste.local
DocumentRoot "C:\Web Design\Ron Beachump\Test\htdocs"
<Directory "C:\Web Design\Ron Beachump\Test\htdocs">
Options Indexes +FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName Rlcwh.local
ServerAlias www.Rlcwh.local
DocumentRoot "C:\Web Design\Robert Skillings\RLCWH.com"
<Directory "C:\Web Design\Robert Skillings\RLCWH.com">
Options Indexes +FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName Mybugtube.local
ServerAlias www.Mybugtube.local
DocumentRoot "C:\Web Design\Mr. Hill\Mybugtube.com"
<Directory "C:\Web Design\Mr. Hill\Mybugtube.com">
Options Indexes +FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

This should be fine, but I'll make a few suggestions.
When it comes to folder names, I personally don't recommend using periods in them at all. Special characters other than letters and numbers can sometimes effect things due to the fact many programs see these as special operators or definition characters. I further recommend leaving out spaces between names, but instead use - or _ between words.

Your virtualhosts file looks correct though.
Raproductions wrote:Hosts file found at C:\Windows\System32\drivers\etc
Code: Select all
127.0.0.1       localhost
::1             localhost
127.0.0.1 Greattaste.local
::1       Greattaste.local
127.0.0.1 Rlcwh.local
::1       Rlcwh.local
127.0.0.1 mybugtube.local
::1       mybugtube.local
                               

You've got to enter your Domain Alias as well. So in other words,
Code: Select all
127.0.0.1       localhost
::1             localhost
127.0.0.1 Greattaste.local
127.0.0.1 www.Greattaste.local
127.0.0.1 Rlcwh.local
127.0.0.1 www.Rlcwh.local
127.0.0.1 mybugtube.local
127.0.0.1 www.mybugtube.local
                               


I wouldn't even worry about the IV6 entry unless you're somehow using that, which doesn't get used by default. (That is the ::1 thingy)

The reason you have to add "www" to the beginning is because your browser does this automatically. I don't know all of the technical jargon on it, but eventually the "www" will get left off of domain names in the future, which many are doing it that way now. It's more of an understood "www", so even if you don't specify it, your browser adds it.

But that's more than likely your problem, because you haven't specified www yet, which it's seeing it as a sub-domain name.

As far as they all going to the first entry, this will always be true when a domain name isn't correctly specified. It's the same entry that will be reached by going to localhost, 127.0.0.1, your LAN IP, and your public IP. Whichever entry you have listed at the beginning of your VirtualHost file is the one that get's picked for all undefined requests to your server on port 80. That's it in a nutshell.

Re: Access Forbidden

PostPosted: 16. September 2009 22:06
by Raproductions
I appreciate all the help you have been giving me but it does the same thing here is the imageImage It is still the wrong one
Please Help,
Robert Skillings

Re: Access Forbidden

PostPosted: 17. September 2009 00:24
by Izzy
I need to know what version of XAMPP you installed and what Windows OS you are using please?

To all who read this topic, please included these 2 details in all requests for support as now we have different behaviors depending on the OS and the XAMPP versions being used.


I have assumed you are using Vista and that you have installed XAMPP 1.7.2

In Vista permissions can be affected if you use spaces in folder names, see the XAMPP for Windows Home Page near the top.

Rename your folders without spaces and dots and make them all lower case for consistency and the elimination of possible conflicts down the track - see my code below that has been corrected to reflect the renaming of your folders.

In XAMPP 1.7.2 if you answered auto (the default) for the IPv6 question then it can be assumed that leaving the IPv6 entry in your host file will not affect your XAMPP installation - This question was only introduced from XAMPP 1.7.2 version.

You also have some missing entries in your httpd-vhosts.conf file - it may be possible to copy and paste this code below after you have changed the folder names and do make sure that there is no differences or you may get unexpected and unexplained errors - if on Vista use as below or if you still have an issue with Vista then change the forward slashes to back slashes, forward slashes are Apache friendly where as back slashes may be Vista friendly.
Code: Select all
NameVirtualHost *:80

<VirtualHost *:80>
ServerName localhost
DocumentRoot "C:/xampp/htdocs"
</VirtualHost>

<VirtualHost *:80>
ServerName greattaste.local
ServerAlias www.greattaste.local
DocumentRoot "C:/webdesign/ronbeachump/test/htdocs"
<Directory "C:/webdesign/ronbeachump/test/htdocs">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

<VirtualHost *:80>
ServerName rlcwh.local
ServerAlias www.rlcwh.local
DocumentRoot "C:/webdesign/robertskillings/rlcwh"
<Directory "C:/webdesign/robertskillings/rlcwh">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

<VirtualHost *:80>
ServerName mybugtube.local
ServerAlias www.mybugtube.local
DocumentRoot "C:/webdesign/mrhill/mybugtube"
<Directory "C:/webdesign/mrhill/mybugtube">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Save the file and then restart Apache server.

Now if that works then you can experiment with your folder names by replacing dots and spaces with the underscore character if you think it will be easier for you to read, then test after each change to make sure they work - spaces and dots in folder names may introduce strange behavior so if you can live without them on your server then you may have a better trouble free experience.

Your Windows hosts file would then look like this and dots in domain names is both the norm and is just fine but keep them all lowercase to match your httpd-vhosts.conf file, I have also dropped the IPv6 entry for localhost but you may wish to keep it depending on the way you answered that question when installing XAMPP and mentioned above
Code: Select all
127.0.0.1 localhost
127.0.0.1 greattaste.local
127.0.0.1 www.greattaste.local
127.0.0.1 rlcwh.local
127.0.0.1 www.rlcwh.local
127.0.0.1 mybugtube.local
127.0.0.1 www.mybugtube.local


Now see how the above performs and please post back again if you are still having issues as I have my fingers and everything else crossed for good luck.

Re: Access Forbidden

PostPosted: 17. September 2009 01:59
by Raproductions
I am using Xampp Version 1.7.2 on a 64bit Vista Home Premium

Re: Access Forbidden

PostPosted: 17. September 2009 02:05
by Izzy
Ok, as I guessed.

I edited my post to reflect your specs whilst waiting for your answer.

You are logged in to Vista as an administrator and you have disabled UAC?

Re: Access Forbidden

PostPosted: 17. September 2009 03:34
by Raproductions
Thank you for the help i really appreciate it i had another question it is about the status page my Mysql database says it is deactivted is it because i am on Vista or is somethign not working Image Again i appreciate all the help

Re: Access Forbidden

PostPosted: 17. September 2009 04:57
by Izzy
Does your VirtualHost work as you intended now?

Your Deactivated question may be answered by this Advanced Forum Search

BTW when posting images to the forum please try and keep them no bigger than 800 x 600, thanks.

Re: Access Forbidden

PostPosted: 18. September 2009 03:43
by Raproductions
Everything has been working fine when i went to add another site i end up with this Image No matter what way i name the file or where i set the dashes. my vhost file
Code: Select all
#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# Use name-based virtual hosting.
#
##NameVirtualHost *:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
##<VirtualHost *:80>
    ##ServerAdmin postmaster@dummy-host.localhost
    ##DocumentRoot "C:/xampp/htdocs/dummy-host.localhost"
    ##ServerName dummy-host.localhost
    ##ServerAlias www.dummy-host.localhost
    ##ErrorLog "logs/dummy-host.localhost-error.log"
    ##CustomLog "logs/dummy-host.localhost-access.log" combined
##</VirtualHost>

##<VirtualHost *:80>
    ##ServerAdmin postmaster@dummy-host2.localhost
    ##DocumentRoot "C:/xampp/htdocs/dummy-host2.localhost"
    ##ServerName dummy-host2.localhost
    ##ServerAlias www.dummy-host2.localhost
    ##ErrorLog "logs/dummy-host2.localhost-error.log"
    ##CustomLog "logs/dummy-host2.localhost-access.log" combined

##</VirtualHost>
NameVirtualHost *:80

<VirtualHost *:80>
ServerName localhost
DocumentRoot "C:/xampp/htdocs"
</VirtualHost>

<VirtualHost *:80>
ServerName greattaste.local
ServerAlias www.greattaste.local
DocumentRoot "C:/webdesign/ronbeachump/test/htdocs"
<Directory "C:/webdesign/ronbeachump/test/htdocs">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

<VirtualHost *:80>
ServerName rlcwh.local
ServerAlias www.rlcwh.local
DocumentRoot "C:/webdesign/robertskillings/rlcwh"
<Directory "C:/webdesign/robertskillings/rlcwh">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

<VirtualHost *:80>
ServerName mybugtube.local
ServerAlias www.mybugtube.local
DocumentRoot "C:/webdesign/mrhill/mybugtube\public_html"
<Directory "C:/webdesign/mrhill/mybugtube\public_html">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

<VirtualHost *:80>
ServerName learnphp.local
ServerAlias www.learnphp.local
DocumentRoot "C:\webdesign\robertskillings\learnphp"
<Directory "C:\webdesign\robertskillings\learnphp">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

Hosts file
Code: Select all
# Copyright (c) 1993-2006 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

127.0.0.1       localhost
::1             localhost
127.0.0.1 Greattaste.local
127.0.0.1 www.Greattaste.local
127.0.0.1 Rlcwh.local
127.0.0.1 www.Rlcwh.local
127.0.0.1 mybugtube.local
127.0.0.1 www.mybugtube.local
127.0.0.1 learnphp.local
127.0.0.1 www.learnphp.local
                                     

Everything else works just fine and i got the mysql activated it is just when i setup the last file

Re: Access Forbidden

PostPosted: 20. September 2009 05:45
by Raproductions
~Bump~ I still cannot get it to work please help

Re: Access Forbidden

PostPosted: 20. September 2009 06:26
by Izzy
Check the server error log file C:\xampp\apache\logs\error.log at about the time you get this Access Forbidden error.

Code: Select all
DocumentRoot "C:/webdesign/mrhill/mybugtube\public_html"
<Directory "C:/webdesign/mrhill/mybugtube\public_html">
A mixed bag of slashes here - all forward like the rest of this conf file may help.

Code: Select all
DocumentRoot "C:\webdesign\robertskillings\learnphp"
<Directory "C:\webdesign\robertskillings\learnphp">
Again a mix up here as all the rest of the vhosts in your httpd-vhosts.conf file are forward yet you choose to go the other way with this one.

Code: Select all
127.0.0.1 Greattaste.local
127.0.0.1 www.Greattaste.local
127.0.0.1 Rlcwh.local
127.0.0.1 www.Rlcwh.local
These don't match the vhosts as they are capitalized - making them all lower case may help.


BTW you have gone from a huge image down to an image size that is out of focus and unreadable at 320 x 122 - try resizing them on your PC to 800 x 600 then upload the images to ImageShack.