1

Current Layout

One functioning Ubuntu 16.04 server handling public resolution of "domain.com" as well as many other virtual domains and subdomains through a static IP in a home office. This server runs Apache, MySQL, BIND DNS, Postfix and a host of other web based services on various ports.

One additional box running Ubuntu 18.04 with no specific purpose other than to learn how to do this stuff.

One pfSense box handling traffic.

Let's say the following is true:

pfSense is on 192.168.1.1 and is the DHCP server. Ubuntu box 1 is 192.168.1.100 (server1.domain.com) Ubuntu box 2 is 192.168.1.101 (server2.domain.com)

What needs to be in place on either or both servers to be able to enter http://server2.domain.com:[whateverport] to pull up a web-based app on server2 without using the internal IP address?

I am currently able to route that specific port directly to the 2nd server and use the public IP, but I'm stuck attempting to give it a friendly subdomain name.

Thanks!

1 Answer 1

0

What needs to be in place on either or both servers to be able to enter http://server2.domain.com:port to pull up a web-based app on server2 without using the internal IP address?

The typical approach to solving this problem is to have Apache on 192.168.1.100 pass requests for ex. http://server2.domain.com to 192.168.1.101 itself:

Listen 1234

<VirtualHost *:1234>

ServerName server2.domain.com

ProxyPass / http://192.168.1.101:1234/
ProxyPassReverse / http://192.168.1.101:1234/

</VirtualHost>

You'll want mod_proxy enabled for this, as well as likely mod_proxy_html and mod_proxy_http, in your Apache configuration files.

I am currently able to route that specific port directly to the 2nd server and use the public IP[.]

You'll want to route the given port (e.g. 1234) to your Apache server to have the configuration above work.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .