Page 1 of 2

Error 403

PostPosted: 02. September 2009 15:13
by amanda099
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

Re: Error 403

PostPosted: 02. September 2009 15:35
by Wiedmann
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)?

Re: Error 403

PostPosted: 02. September 2009 15:49
by amanda099
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>

Re: Error 403

PostPosted: 02. September 2009 15:54
by Wiedmann
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".

Re: Error 403

PostPosted: 02. September 2009 16:08
by amanda099
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

Re: Error 403

PostPosted: 02. September 2009 16:14
by Wiedmann
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...)

Re: Error 403

PostPosted: 02. September 2009 16:30
by amanda099
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

Re: Error 403

PostPosted: 02. September 2009 16:32
by amanda099
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

Re: Error 403

PostPosted: 02. September 2009 16:55
by amanda099
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

Re: Error 403

PostPosted: 02. September 2009 17:15
by sili
While httpd.conf is for general configuration, httpd-vhosts.conf is for the configuration of the virtual hosts.

Re: Error 403

PostPosted: 02. September 2009 17:37
by amanda099
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 !

Error 404

PostPosted: 03. September 2009 11:10
by amanda099
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

Re: Error 403

PostPosted: 03. September 2009 11:57
by Wiedmann
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.

Re: Error 403

PostPosted: 03. September 2009 15:03
by amanda099
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 .

Re: Error 403

PostPosted: 03. September 2009 16:21
by Wiedmann
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).