Access Forbidden

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

Access Forbidden

Postby jamesthemonkeh » 26. April 2017 17:27

Hello

I am trying to set up local dev environment with virtual host, using XAMPP, on my new work laptop - running Windows 10.

I have exactly the same set up as on my Surface Pro, but each time I try to access local, I get an access forbidden 403 error.

In the hosts file I have added

127.0.0.1 local.testing.co.uk

In httpd-vhosts.conf I have added

<VirtualHost *:80>
DocumentRoot "C:/www/testing-co-uk/web"
ServerName local.testing.co.uk
</VirtualHost>

In httpd.conf, I have amended the DocumentRoot and Directory as follows:

DocumentRoot "C:/www"
<Directory "C:/www">

My testing-co-uk folder is in C:/www

Can anyone kindly suggest what could be going wrong? I have been going insane for about 6 hours now.

Kind regards
James
jamesthemonkeh
 
Posts: 6
Joined: 05. November 2014 11:09
Operating System: Windows

Re: Access Forbidden

Postby Nobbie » 27. April 2017 03:23

6 hours is a really short time in my mind, it took me years to become an expert in Apache configuration. So what did you find out about error 403 and what exactly does it mean?
Nobbie
 
Posts: 9621
Joined: 09. March 2008 13:04

Re: Access Forbidden

Postby jamesthemonkeh » 27. April 2017 11:23

Yeah I've got past that issue now by changing require all denied to require all granted, in httpd.conf

I'm now getting an error where it always redirects me to https://local.testing.co.uk/dashboard/ when I try to load local.testing.co.uk.

Any ideas? Please.
jamesthemonkeh
 
Posts: 6
Joined: 05. November 2014 11:09
Operating System: Windows

Re: Access Forbidden

Postby Altrea » 27. April 2017 13:33

jamesthemonkeh wrote:Yeah I've got past that issue now by changing require all denied to require all granted, in httpd.conf

You cannot enter your house because the door is locked.
Instead of getting the key to open the door you simply remove the door so that now everybody can enter?
Seems not to be the best idea i think.

The rule you changed is a default rule that says: Anything which is not explicity allowed is denied (whitelisting principle).
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8885
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: Access Forbidden

Postby jamesthemonkeh » 27. April 2017 14:26

I agree it isn't the best idea but I'm trying to find a solution!

Been trying to figure this out for about 11 hours now :-(
jamesthemonkeh
 
Posts: 6
Joined: 05. November 2014 11:09
Operating System: Windows

Re: Access Forbidden

Postby Altrea » 27. April 2017 15:37

Require all granted works in virtualhost definitions too.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8885
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: Access Forbidden

Postby jamesthemonkeh » 27. April 2017 16:08

I've got it in there too. Will remove from httpd.conf

Still cannot get my virtualhost to work though.
jamesthemonkeh
 
Posts: 6
Joined: 05. November 2014 11:09
Operating System: Windows

Re: Access Forbidden

Postby Nobbie » 27. April 2017 17:11

You have to put your own index.php into your virtualhosts documentroot, seems you still use Xampps index.php. Do not use htdocs folder as documentroot, create your own folder to avoid collisions with Xampps dashboard. Also check if your virtualhost does work, check error_log and access_log, if there is an error with virtualhost, Apache ignores the definition for that Servername and uses the first virtualhost instead.

Your latest error description lacks everything, we do not see your computer and neither your configuration.
Nobbie
 
Posts: 9621
Joined: 09. March 2008 13:04

Re: Access Forbidden

Postby jamesthemonkeh » 27. April 2017 17:38

My error logs are as follows? Do they make any sense to you?

[Thu Apr 27 17:44:51.371425 2017] [ssl:warn] [pid 5768:tid 564] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Thu Apr 27 17:44:51.424078 2017] [core:warn] [pid 5768:tid 564] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Thu Apr 27 17:44:51.486669 2017] [ssl:warn] [pid 5768:tid 564] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Thu Apr 27 17:44:51.523439 2017] [mpm_winnt:notice] [pid 5768:tid 564] AH00455: Apache/2.4.25 (Win32) OpenSSL/1.0.2j PHP/5.6.30 configured -- resuming normal operations
[Thu Apr 27 17:44:51.523439 2017] [mpm_winnt:notice] [pid 5768:tid 564] AH00456: Apache Lounge VC11 Server built: Dec 20 2016 13:02:04
[Thu Apr 27 17:44:51.523439 2017] [core:notice] [pid 5768:tid 564] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Thu Apr 27 17:44:51.524441 2017] [mpm_winnt:notice] [pid 5768:tid 564] AH00418: Parent: Created child process 5152
[Thu Apr 27 17:44:51.956279 2017] [ssl:warn] [pid 5152:tid 600] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Thu Apr 27 17:44:52.124821 2017] [ssl:warn] [pid 5152:tid 600] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Thu Apr 27 17:44:52.156108 2017] [mpm_winnt:notice] [pid 5152:tid 600] AH00354: Child: Starting 150 worker threads.
jamesthemonkeh
 
Posts: 6
Joined: 05. November 2014 11:09
Operating System: Windows

Re: Access Forbidden

Postby Nobbie » 27. April 2017 20:45

jamesthemonkeh wrote:My error logs are as follows? Do they make any sense to you?


Yes of course. But there is no hint, what is going wrong, maybe there is no error in the configuration. I still dont know your configuration, i dont know the contents of your document root, i dont know what is going wrong, i dont know the access log etc.pp., i dont know anything. As i cannot see your monitor and cannot reach your keyboard, the success of this thread does only fully depend on your ability to give us proper and valid and full information. Any lacki of information may disturb success.
Nobbie
 
Posts: 9621
Joined: 09. March 2008 13:04


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 47 guests