VirtualHost redirecting me to the default xampp page

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

VirtualHost redirecting me to the default xampp page

Postby asaurat_ovr » 12. May 2017 11:23

Hi!
I'd like to use 2 different folders to serve webpages. But when I add the new one, it keeps redirecting me to the standard Dashboard xampp page!!

Any idea about what could cause that?

Here is what I did put in my httpd-vhosts.conf :

Code: Select all
<VirtualHost *.80>
    DocumentRoot "E:\xampp\htdocs\
    ServerName localhost
</VirtualHost>

<VirtualHost *.80>
    ServerAdmin adrien.saurat@onvareserver.com
    DocumentRoot "E:/git/site1/htdocs"
    ServerName site1.local
   ServerAlias www.site1.local
    ErrorLog "logs/site1.local.error.log"
    CustomLog "logs/site1.local.access.log" common
   <Directory "E:/git/site1/htdocs">
        Require all granted   
    </Directory>
</VirtualHost>


In my Windows "hosts" file I simply added a ligne
127.0.0.1 site1.local

I use XAMPP for Windows 5.6.30, on Windows 10

Thanks!
asaurat_ovr
 
Posts: 4
Joined: 12. May 2017 11:17
XAMPP version: 3.2.2
Operating System: Windows 10

Re: VirtualHost redirecting me to the default xampp page

Postby Nobbie » 12. May 2017 13:57

At least, your VirtualHost Declaration is wrong:

Code: Select all
<VirtualHost *.80>


Thy dot is wrong, that must be a colon:

Code: Select all
<VirtualHost *:80>


That might already solve the problem (restart Apache after correcting that error).

In my Windows "hosts" file I simply added a ligne
127.0.0.1 site1.local


If you want your ServerAlias working, you also have to declare www.site1.local
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: VirtualHost redirecting me to the default xampp page

Postby asaurat_ovr » 15. May 2017 08:02

Thanks for your answer! Indeed, I don't know how I ended up with *.80 instead of *:80 but I fixed that. That changed one thing: I get 2 different outcomes depending on the url I use.

Now I've got the following:
1/ Localhost gives a 403 error (already searched about this problem, but couldn't solve it so far)
2/ site1.local first gives a certificate error (the production website uses SSL) but if I choose to continue, I end up on the default xampp page.


This makes me wonder...
a) Would the 403 error appear for the default page ? It didn't after a fresh install, so maybe it's trying to access the new directories?
b) why do I get the SSL error if site1.local finally arrives on the xampp dashboard?!
asaurat_ovr
 
Posts: 4
Joined: 12. May 2017 11:17
XAMPP version: 3.2.2
Operating System: Windows 10

Re: VirtualHost redirecting me to the default xampp page

Postby asaurat_ovr » 15. May 2017 08:11

I disabled the xampp ssl by disabling those lignes in the http-conf:
LoadModule ssl_module modules/mod_ssl.so
Include conf/extra/httpd-ssl.conf

And now site1.local doesn't send me to the xampp dashboard but simply crashes and says that "I cannot access this page". No error code displayed.

EDIT : Oh, yes, it's a DNS error INET_E_RESOURCE_NOT_FOUND
asaurat_ovr
 
Posts: 4
Joined: 12. May 2017 11:17
XAMPP version: 3.2.2
Operating System: Windows 10

Re: VirtualHost redirecting me to the default xampp page

Postby Nobbie » 15. May 2017 10:19

asaurat_ovr wrote:a) Would the 403 error appear for the default page ?


The 403 error obviously is due to completely missing "Require" clause in your quasi empty VirtualHost declaration of localhost. There are also missing any Options, any Allow etc. pp. - you only declared a servername and a document. Thats quite poor.
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: VirtualHost redirecting me to the default xampp page

Postby asaurat_ovr » 17. May 2017 08:21

The Require did indeed help, thanks.

But aren't the "Allow..." lines deprecated? Where can I find a recent guide indicating the different between all those config options? Most pages that I find seem to talk about obsolete versions of Xampp.

Thanks again!
asaurat_ovr
 
Posts: 4
Joined: 12. May 2017 11:17
XAMPP version: 3.2.2
Operating System: Windows 10

Re: VirtualHost redirecting me to the default xampp page

Postby Nobbie » 17. May 2017 17:23

Sorry, i was a bit lousy, by Allow... i meant AllowOverride. Allow From etc. Is deprecated.
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 129 guests