One virtual host works fine, the next redirects me to dashbo

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

One virtual host works fine, the next redirects me to dashbo

Postby henlfern » 11. October 2019 09:20

Hi everyone. Here's hoping you can help me with a peculiar problem.

I've installed XAMPP 7.2.23 on a Mac with Mojave OS. I've set everything up as one should (I've followed the guide Configure Virtual Hosts) and got one virtual host working. I've copied the information of the virtual host and set up a new directory in /htdocs so I can work on a second project. But whatever I do, the second installation/virtual host just keeps sending me to a dashboard.

Another strange thing is that it answers on the domain, but sends me to a dashboard.

For example. site1.loc works fine, all the time. site2.loc answers but adds /dashboard to the URL and shows the default dashboard from XAMPP. When I remove /dashboard and add for example COPYRIGHT.txt (which is a file in the folder in /htdocs/site2/) it gives me a 404.

I've changed the .loc from both .localhost and .local to see if the name localhost makes any difference, but it doesn't.

Since I have several personal websites, a multi-virtual host-setup is of outmost importance to me, and this one is really making me perplexed. It seems to work... like half the way...

Any help and thoughts (and prayers) are appreciated.

More information on the setup:
I've uncommented the line
Code: Select all
Include etc/extra/httpd-vhosts.conf


The contents of /etc/hosts
Code: Select all
127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost
127.0.0.1       site1.loc
127.0.0.1       site2.loc
henlfern
 
Posts: 2
Joined: 11. October 2019 09:08
XAMPP version: 7.2.23
Operating System: Max OS Mojave

Re: One virtual host works fine, the next redirects me to da

Postby Nobbie » 12. October 2019 12:12

Watch the error logs if you can find any hint, probably there is something wrong with one of the VirtualHosts. Show us your httpd-vhosts.conf as well.

Also start httpd (Apache) with option -S (./httpd -S), that shows up all recognized VirtualHosts. Replace ./httpd by the full path of httpd (which i dont know).
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: One virtual host works fine, the next redirects me to da

Postby henlfern » 13. October 2019 19:34

Thank you for your reply, Nobbie.

I don't know what happened, but now every virtual host gets a response - but only from the first folder in the list of virtual hosts. This is how the beginning of the file httpd-vhosts.conf looks like (I have more hosts, but everyone reacts the same, no matter what the URL, they present the content from the first in i list of httpd-vhosts.conf):

Code: Select all
#<VirtualHost *:80>
#       DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs/"
#       ServerName localhost
#</VirtualHost>

<VirtualHost *:80>
       DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs/web/site1/"
       ServerName site1.loc
   <Directory "/Applications/XAMPP/xamppfiles/htdocs/web/site1/">
    Order allow,deny
    Allow from all
   </Directory>
</VirtualHost>

<VirtualHost *:80>
       DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs/web/site2/"
       ServerName site2.loc
   <Directory "/Applications/XAMPP/xamppfiles/htdocs/web/site2/">
    Order allow,deny
    Allow from all
   </Directory>
</VirtualHost>


The error_log and access_log doesn't show anything unusual.

I'll look into the option to start Apache with option -S.

Until then, any ideas?
henlfern
 
Posts: 2
Joined: 11. October 2019 09:08
XAMPP version: 7.2.23
Operating System: Max OS Mojave

Re: One virtual host works fine, the next redirects me to da

Postby Nobbie » 14. October 2019 12:02

Code: Select all
Order allow,deny
Allow from all


is deprecated, replace it by

Code: Select all
Require All Granted


And run httpd -S for detailed information about VirtualHosts, i cannot see any weird things.
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04


Return to XAMPP for macOS

Who is online

Users browsing this forum: No registered users and 17 guests