Two apache installations on the same server

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 on Port 81 and the other apache on port 80. The two Apaches are pointing to the same folder where the systems are stored (D: \ www).

Bitnami example (Port 81):

  

link

Example of the other Apache (Port 80):

  

link

Is there any way to access the page without typing the port, putting some sort of alias into the main address, or even doing port redirection so that when I type the complete address of a system it will port to the correct port?

    
asked by anonymous 06.10.2015 / 15:16

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, redirect 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.example.com and www.example.net.

If the request is to www.example.com, the content of this apache is usually served.

If the request is to www.example.net, the corresponding VirtualHost of apache listening on port 80 will return a redirect for access to www.example.net:81, then redirected by Bitnami.

You need to use DNS records to work correctly this way.

    
23.10.2015 / 03:50
0

I solved a similar situation, it just was not with Apache.

I've set up a server (actually a VM) HAProxy ( link ). This listen port 80 and based on the URL (or other parameters that you can configure) calls the service with the correct port, making it transparent to the user who called, that is, the person who called the port does not appear in the URL.

I do not know if you have HAProxy for Windows, it should have some similar solution. Or you can configure a linux VM to fulfill the requests and then redirect to your Apaches in Windows.

It's not hard to remember that it's not recommended (at least as far as I know) to use PHP + Apache on Windows for production. If this has changed, please ignore this my last comment.

    
06.10.2015 / 15:50