Error 403

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Error 403

Postby amanda099 » 02. September 2009 15:13

I have successfully installed XAMPP on my Windows Vista computer for developing my own website.
But every time I try to access my website using the browser, I receive the following message:

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
http://www.imabeauty.com
9/3/2009 4:04:34 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 appreciate so much if anyone would give me some idea of the problem.

Kindly Amanda
amanda099
 
Posts: 41
Joined: 02. September 2009 15:05

Re: Error 403

Postby Wiedmann » 02. September 2009 15:35

I try to access my website

The XAMPP demopage was working after the installation, before you have put your own stuff in htdocs (and maybe also changed some settings)?
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Error 403

Postby amanda099 » 02. September 2009 15:49

Wiedmann wrote:
I try to access my website

The XAMPP demopage was working after the installation, before you have put your own stuff in htdocs (and maybe also changed some settings)?


Yes Wiedmann, The XAMPP demopage has been and is working after the installation and after I put my site-folder in C:\xampp\htdocs.
I have also added the following text at the bottom of the file C:\xampp\apache\conf\httpd.conf

NameVirtualHost *:80

<VirtualHost *:80>
ServerName www.imabeauty.com
ServerAlias imabeauty.com *.imabeauty.com
DocumentRoot htdocs/imabeauty
</VirtualHost>
amanda099
 
Posts: 41
Joined: 02. September 2009 15:05

Re: Error 403

Postby Wiedmann » 02. September 2009 15:54

Code: Select all
DocumentRoot htdocs/imabeauty

You must use an absolute path. (see the "DocumentRoot" for the main server in "httpd.conf")

I have also added the following text at the bottom of the file C:\xampp\apache\conf\httpd.conf

OK, makes no real difference, but should be better placed in "C:\xampp\apache\conf\extra\httpd-vhosts.conf".
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Error 403

Postby amanda099 » 02. September 2009 16:08

Wiedmann wrote:
Code: Select all
DocumentRoot htdocs/imabeauty

You must use an absolute path. (see the "DocumentRoot" for the main server in "httpd.conf")

I have also added the following text at the bottom of the file C:\xampp\apache\conf\httpd.conf

OK, makes no real difference, but should be better placed in "C:\xampp\apache\conf\extra\httpd-vhosts.conf".


I deleted the added text in the file C:\xampp\apache\conf\httpd.conf
then I added it at the bottom of the file C:\xampp\apache\conf\extra\httpd-vhosts.conf
After restarting Apache, I still received the same Error 403 .

Kindly Amanda
amanda099
 
Posts: 41
Joined: 02. September 2009 15:05

Re: Error 403

Postby Wiedmann » 02. September 2009 16:14

I still received the same Error 403 .

Correct. Because it make no real difference if you have this in httpd.conf or httpd-vhosts.conf. It's just the better place for this.

But you must correct the DocumentRoot value (read my last post a second time...)
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Error 403

Postby amanda099 » 02. September 2009 16:30

Wiedmann wrote:
I still received the same Error 403 .

Correct. Because it make no real difference if you have this in httpd.conf or httpd-vhosts.conf. It's just the better place for this.

But you must correct the DocumentRoot value (read my last post a second time...)


WOW ...It works like a charm now !
I added it at the bottom of the file C:\xampp\apache\conf\extra\httpd-vhosts.conf using the absolute path

NameVirtualHost *:80

<VirtualHost *:80>
ServerName www.imabeauty.com
ServerAlias imabeauty.com *.imabeauty.com
DocumentRoot C:/xampp/htdocs/imabeauty
</VirtualHost>

Thank You so much Wiedmann ! I feel much better hehehe !
Amanda Nguyen
amanda099
 
Posts: 41
Joined: 02. September 2009 15:05

Re: Error 403

Postby amanda099 » 02. September 2009 16:32

amanda099 wrote:
Wiedmann wrote:
I still received the same Error 403 .

Correct. Because it make no real difference if you have this in httpd.conf or httpd-vhosts.conf. It's just the better place for this.

But you must correct the DocumentRoot value (read my last post a second time...)


WOW ...It works like a charm now !
I added it at the bottom of the file C:\xampp\apache\conf\extra\httpd-vhosts.conf using the absolute path

NameVirtualHost *:80

<VirtualHost *:80>
ServerName http://www.imabeauty.com
ServerAlias imabeauty.com *.imabeauty.com
DocumentRoot C:/xampp/htdocs/imabeauty
</VirtualHost>

Thank You so much Wiedmann ! I feel much better hehehe !
Amanda Nguyen

PS. DocumentRoot htdocs/imabeauty worked in my old Apache
amanda099
 
Posts: 41
Joined: 02. September 2009 15:05

Re: Error 403

Postby amanda099 » 02. September 2009 16:55

amanda099 wrote:
Wiedmann wrote:
I still received the same Error 403 .

Correct. Because it make no real difference if you have this in httpd.conf or httpd-vhosts.conf. It's just the better place for this.

Hi, Wiedmann
What kind of sites should I use C:\xampp\apache\conf\extra\httpd-vhosts.conf
and what kind of sites should I use C:\xampp\apache\conf\httpd.conf
to put infomation in ?

Kindly Amanda
amanda099
 
Posts: 41
Joined: 02. September 2009 15:05

Re: Error 403

Postby sili » 02. September 2009 17:15

While httpd.conf is for general configuration, httpd-vhosts.conf is for the configuration of the virtual hosts.
sili
 
Posts: 54
Joined: 15. March 2003 16:05
XAMPP version: dfg
Operating System: dfg

Re: Error 403

Postby amanda099 » 02. September 2009 17:37

sili wrote:While httpd.conf is for general configuration, httpd-vhosts.conf is for the configuration of the virtual hosts.


Thank You for the info sili !
amanda099
 
Posts: 41
Joined: 02. September 2009 15:05

Error 404

Postby amanda099 » 03. September 2009 11:10

Just after I successfully installed XAMPP, I viewed the XAMPP demopage (XAMPP for Windows) using http://localhost (being redirected to http://localhost/xampp/)
Now I have my website running.
But I can no longer access to the XAMPP demopage using http://localhost , instead my own site appears.
When I click on the Admin button alongside Apache on the XAMPP Control Panel Application I receive the following Error 404 :

Object not found!
The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.

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

Error 404
localhost
9/3/2009 11:58:09 PM
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


Please provide me some solutions. Kindly Amanda Nguyen
amanda099
 
Posts: 41
Joined: 02. September 2009 15:05

Re: Error 403

Postby Wiedmann » 03. September 2009 11:57

If you want have access to the htdocs dir (and the XAMPP demopages), you must also add a virtual host for localhost and the htdocs dir.
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Error 403

Postby amanda099 » 03. September 2009 15:03

Wiedmann wrote:If you want have access to the htdocs dir (and the XAMPP demopages), you must also add a virtual host for localhost and the htdocs dir.


As far as I understand, I should add something similar to the following at the end of the file C:\xampp\apache\conf\extra\httpd-vhosts.conf

<VirtualHost *:80>
ServerName http://www.imabeauty.com
ServerAlias imabeauty.com *.imabeauty.com
DocumentRoot C:/xampp/htdocs/imabeauty
</VirtualHost>

, where DocumentRoot C:/xampp/htdocs/imabeauty is replaced by DocumentRoot C:/xampp/htdocs/xampp
How about other elements ?

Thank You beforehand, Amanda Nguyen .
amanda099
 
Posts: 41
Joined: 02. September 2009 15:05

Re: Error 403

Postby Wiedmann » 03. September 2009 16:21

How about other elements ?

That's the VHost for "localhost", so you have to use "localhost" for ServerName.
Because the only name for this host is "localhost", there is no ServerAlias.

It may be also a good idea, to use "127.0.0.1:80" in VirtualHost instead of "*.80" (or insert this vhost as your first vhost in this file).
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Next

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 144 guests