Two apache installations on the same server

Asked

Viewed 1,176 times

4

I have a windows server with Bitnami (only with Apache running) and another apache installed manually. Since Bitnami Apache is for Postgresql database and Apache installed manual is for Mysql.

It’s working normally, but on different ports. Bitnami at Gate 81 and the other apache at Gate 80. The two Apaches pointing to the same folder where the systems are stored (D: www).

Bitnami example (Porta 81):

http://147.1.0.31:81/info.php

Example of other Apache (Port 80):

http://147.1.0.31/info.php

Is there any way to access the page without typing the port, put some kind of alias to the main address or even do port forwarding so that when you type the full address of a system it contributes to the correct port?

  • Apache has the "mod_proxy" module. With this module you can do what you want.

2 answers

1

The only way to do something similar to a redirect involves using apache’s Virtualhost settings and, based on the request url, redirecting to Bitnami by listening on port 81.

It would be necessary for apache listening on port 80 to be configured with 2 Virtualhost, each with its own Servername, such as www.exemplo.com and www.exemplo.net.

If the request is for www.exemplo.com, the content of this apache is usually served.

If the request is for www.exemplo.net, the corresponding apache host listening on port 80 will return a redirect to be accessed www.exemplo.net:81, then redirected by Bitnami.

It is necessary to use DNS records in order to work properly in this way.

0

I solved a similar situation, just wasn’t with apache.

I set up a server (actually a VM) Haproxy (http://www.haproxy.org/). This vm listens to port 80 and based on the URL (or other parameters that you can configure) calls the service with the correct port, leaving transparent to the user who called, IE, for who called the port does not appear in the URL.

I can’t tell you if you have Haproxy for Windows, there must be some similar solution. Or you can set up a linux VM to fulfill the requests and then redirect to your apaches on Windows.

It doesn’t hurt to remember that it’s not recommended (at least as far as I know) to use PHP+Apache in Windows for production. If that has changed, ignore my last comment.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.