Some Problems with mod_proxy Virtualhost

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

Some Problems with mod_proxy Virtualhost

Postby xNanuNanax » 19. September 2018 20:09

I have 2 running xampp with 2 different IP-adresses.
The first One runs with a local IP-Adress, the lastone runs with a Internet IP-Adress..
I have on both xampp a lot of Virtualhosts.

I tried this, to mirror the local Servers with mod_prox on my Internet Server

for example:
Virtualhost on Internet Server(sub1.OnInternet.tld) mirrors the Virtualhost from local Server(sub1.OnLocalhost.tld)
sub2.OnInternet.tld:80 mirrors sub2.OnLocalhost.tld:80
sub3.OnInternet.tld:80 mirrors sub3.OnLocalhost.tld:80

I enter the URL Adress to my Server , sub1.OnInternet.tld or others, my Server showing me only the first defined Virtualhost Block (sub1.OnLocalhost.tld)
I can Access the local Domains directly. If i calls sub1.OnLocalhost.tl, i see it
If i calls sub2.OnLocalhost.tld, i see it.

Only, if i call thos Domains over Internet Server Domains, with mod_Proxy, i see only the first defined local Virtual host

I have 3 Sub Domains over Internet, to mirrors 3 local virtual hosts.
I Need a good example virtualhost example

can anyone help please

Sorry for my Bad English: Ist from Google translator
xNanuNanax
 
Posts: 4
Joined: 19. September 2018 19:46
XAMPP version: 5.6.37-0-VC11
Operating System: Windows 10

Re: Some Problems with mod_proxy Virtualhost

Postby louiscook » 20. September 2018 18:16

I am facing almost same problem
louiscook
 
Posts: 1
Joined: 20. September 2018 18:12
XAMPP version: 7.0.8
Operating System: Windows 10

Re: Some Problems with mod_proxy Virtualhost

Postby xNanuNanax » 20. September 2018 20:52

I have a solution.
Mod_Proxy on Apache have a lot Problems with the Domainnames, if its all on the same IP-Adresse.
I have now given to all Local Vhosts different ip adresses. And Im happy. The local Hostnames, and IP Adresses must inserted in to Hosts file

My Old Configuration
LOCAL DOMAINS ON First XAMPP
<VirtualHost 127.0.0.1:80>
ServerAdmin service@me.tld
DocumentRoot /WWW/sub1/htdocs
ServerName sub1.local.tld
ServerAlias www.sub1.local.tld
</VirtualHost>

<VirtualHost 127.0.0.1:80>
ServerAdmin service@me.tld
DocumentRoot /WWW/sub2/htdocs
ServerName sub2.local.tld
ServerAlias www.sub2.local.tld
</VirtualHost>

INTERNET DOMAINS the second XAMPP (all in the same machine)
<VirtualHost 225.4.22.50:80>
ProxyPreserveHost On
ProxyPass "/" "http://sub1.local.tld/"
ProxyPassReverse "/" "http://sub1.local.tld/"
ServerName sub1.domain.tld
ServerAlias www.sub1.domain.tld
</VirtualHost>

<VirtualHost 225.4.22.50:80>
ProxyPreserveHost On
ProxyPass "/" "http://sub2.local.tld/"
ProxyPassReverse "/" "http://sub2.local.tld/"
ServerName sub2.domain.tld
ServerAlias www.sub2.domain.tld
</VirtualHost>
# ####################################################################################
New Configuration
# I use now 2 different IP for my local vhosts 127.0.0.1 and 127.0.0.2
LOCAL DOMAINS ON First XAMPP
<VirtualHost 127.0.0.1:80>
ServerAdmin service@me.tld
DocumentRoot /WWW/sub1/htdocs
ServerName sub1.local.tld
ServerAlias www.sub1.local.tld
</VirtualHost>

<VirtualHost 127.0.0.2:80>
ServerAdmin service@me.tld
DocumentRoot /WWW/sub2/htdocs
ServerName sub2.local.tld
ServerAlias www.sub2.local.tld
</VirtualHost>



INTERNET DOMAINS the second XAMPP (all in the same machine)
<VirtualHost 225.4.22.50:80>
ProxyPreserveHost On
ProxyPass "/" "http://sub1.local.tld/"
ProxyPassReverse "/" "http://sub1.local.tld/"
ServerName sub1.domain.tld
ServerAlias www.sub1.domain.tld
</VirtualHost>

<VirtualHost 225.4.22.50:80>
ProxyPreserveHost On
ProxyPass "/" "http://sub2.local.tld/"
ProxyPassReverse "/" "http://sub2.local.tld/"
ServerName sub2.domain.tld
ServerAlias www.sub2.domain.tld
</VirtualHost>
xNanuNanax
 
Posts: 4
Joined: 19. September 2018 19:46
XAMPP version: 5.6.37-0-VC11
Operating System: Windows 10

Re: Some Problems with mod_proxy Virtualhost

Postby Nobbie » 20. September 2018 21:04

xNanuNanax wrote:Mod_Proxy on Apache have a lot Problems with the Domainnames, if its all on the same IP-Adresse.


No, of course not. You should explain more precisely, what you are doing, at least you showed some configurations. But there still are some unresolved questions.

First of all: what IP is 225.4.22.50, which server is meant by that??
And what is meant by "first" and "second" Xampp? Do you really have running TWO Xampp installations on ONE PC??

I am pretty sure, that youre two Xampp installations are the reason for all problems. You should remove one installation and run all requests on one Xampp.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: Some Problems with mod_proxy Virtualhost

Postby xNanuNanax » 20. September 2018 22:10

On the Xampp (runs with php4.x und different PHP.INI -mod_php) with local IP, i have a lot of old nice php4 scripts.
On the Xampp (runs with php7.x und different PHP.INI -mod_php) with Internet IP, i have new coded Scripts.
I Need Both Xampp Installation. With the Xampp(InternetIP), i can set my PHP 4 scripts online!!

But my Problem is solved..
xNanuNanax
 
Posts: 4
Joined: 19. September 2018 19:46
XAMPP version: 5.6.37-0-VC11
Operating System: Windows 10


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 130 guests