Recent Topics

1 Jun 22, 2015 20:22    

Hi all,

I try to run b2e 6.4.4 behind a Apache acting as a reverse proxy:

internet => mypublicaddress.com:80 => myprivateaddress:8080

* I have a Apache running b2e on myprivateaddress:8080, with

$baseurl = mypublicaddress.com

* I have a Apache running a vhost setup as reverse proxy on mypublicaddress.com:80

<VirtualHost *:80>
  ServerName myprivateaddress
  ProxyPass "/" "http://myprivateaddress:8080/"
  ProxyPassReverse "/" "http://myprivateaddress:8080/"
</VirtualHost>

The problem is:

* a user connects to mypublicaddress.com
* the request gets proxyed to b2e on myprivateaddress
* b2e sees it is accessed as «myprivateaddress», rewrites to mypublicaddress.com
* user browser retries the redirection, connects to mypublicaddress.com
…and so on, on an endless redirection loop.

Is there a way to deal with this?

Thanks

2 Jun 22, 2015 21:27

Hum, I'm afraid that won't be easy. We've never encountered that use case.

What's the goal of the reverse proxy?

I understand using a reverse proxy for caching static files, but not for the whole app.

3 Jun 22, 2015 21:33

My front server, with a public IP, is running PHP5.6 (Debian Jessie packages), and it breaks b2e.
So I created a Wheezy / Apache 2.2 / PHP5.4 Docker container for b2e.

But, even without this php compatibility issue, I had planned to move my various vhosts to docker containers, in order to secure system and software upgrades.

4 Jun 25, 2015 02:28

Ah that's a shame because we fixed a lot of PHP 5.6 issues in b2evo 6.5 (ha, no number pun intended ;)
So that might have fixed it.

So about the proxying thing, are we talking about 2 servers on the same network?

As far as I know, the normal way to do this is NOT to use different domains. Normally your domain stays the same but the whole internet resolves to your proxy IP, while your proxy server has a static host config to resolve to your application server.

Now, I'm not sure about this Docker thing. Does it require a different architecture?

Tangent question just because I'm curious: what's the advantage of using docker over using just another server? You mention security, ok, but can you be more specific? https://www.docker.com does not give a quick answer :p It kinda looks interesting but the explanations it gives are a bit vague...

5 Jun 25, 2015 11:52

OK for b2e 6.5. I already manually applied some php5.6 patches, and will upgrade very soon.

I didn't understand the part about the normal way to reverse proxy 2 servers on the same network. As I am not an expert in Apache / web servers setup, you may be able to teach me something there!

From a simplistic point of view, running b2e as a Docker container is simply running it as different process on the same server, and so use some different ports.
Like :8081, :8082 and so on.

I see Docker as a software packaging tool.
Here is the idea:
You could create «official» b2e Docker images, containing b2e and all its dependencies, up to the OS libs.
Then I (or anyone) could take your image, and run it on my server.
It means I don't care that you run the latest release of PHP that is not available on my distrib, or that for any reason it would not run on my home-made distrib. All that is needed is included in the image. And it has all been tested altogether.

So, I was not speaking security like in "the app can not interfere with other apps", but rather in "server system upgrades won't affect the apps", and "I can upgrade each app separately, one by one, without any side effects".


Form is loading...