Question: I have two servers running ubuntu server with both on the same physical host virtual server but are completely separate virtual machines (ubuntu servers). One is hosting my WordPress site and the other hosting my other site. I’m using apache2 on bother servers on ubuntu server 16.04 with Webmin for GUI access as I’m new to Linux and still learning.

Currently, when I enter the domain name for server two redirects to server one even though I have specified on the virtual host on each server to use port 80 and 8080 respectively I can only reach domain name 2 if I enter www.domaname2.co.uk:8080 if I don’t use this then it redirects to www.domainname1.co.uk.

I think I have to edit the apache config file on server 1 to dismiss port 8080 but not sure how to do this or if this is the correct solution. I’m basically trying to run two websites on separate servers using port 80 for website 1 and port 8080 for website 2.

Two Apache Server Virtual Host config images port 80 and 8080

Infrastructure 1x Host Server Hyper-V 2016 core (just for virtualisation). 2x Ubuntu Servers, Lamp on both and one is hosting WordPress site and other Apache2 only.

Both are virtual machines, different IP Address, Different Server Names, Different servers.

Solutions: Website\ webserver 1 use port 80 and website\webserver 2 use port 8080 both independent of each other or could I use a subdomain on server one (I have no issues using the domain name e.g. stream.domainame1.co.uk for the second site and keep www.domainname1.co.uk for the main site if this is possible?


1 Answer 1


The only way to achieve this is using reverse proxy, there is several way to configure it :

  1. host1 proxies request domaname2 to host2.
  2. host2 proxies request domaname1 to host1.
  3. you install a third virtual machine with nginx and it will proxy the both domains.

More information about reverse proxy with nginx: https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/

If you would like to make reverse proxy with your current apache: https://httpd.apache.org/docs/2.4/howto/reverse_proxy.html

  • thanks mate much apricated, do you know how to do this? if so can you do it for me obviously for a donation I have no idea about nginx. if not, no issues thanks for the feedback Aug 3, 2018 at 9:23
  • is it possible to move website2 on the same server as website 1 and configure apache host on server 1 to host multiple websites e.g. website1 & website2 are on webserver1 Aug 3, 2018 at 9:36
  • Yes of course, Apache can handle multi website. Look for VirtualHost in Apache.
    – ob2
    Aug 10, 2018 at 12:19
  • thanks, i'll need to hire and apache2 expert I thinks I can build the server and move the sites but some config need expert advice, thanks. can you recommended anyone or a good site to use to find one Aug 11, 2018 at 13:07
  • If you want a quote you can contact my company at iabsis.com, I will be please to help you.
    – ob2
    Aug 14, 2018 at 6:45

You must log in to answer this question.

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