Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I would like to host 2 Joomla! websites on separate machines using XAMPP with Apache. I need to make sure it is configured the correct way but I am not sure if I understand how it is to be written in the config files.(on both PC's)

things to be configured as far as I know:

  • Host file
  • httpd file to allow proxy
  • vhost file

I have all the basics set up on the "proxy" to run multiple websites from the one server. However I want to put one of the websites on a separate server on its own and still be able to run multiple sites from the first.

for the sake of example my IP address from the ISP is 12.123.124.12

the internal addresses for each machine:

  • server1: 192.168.1.146
  • server2: 192.168.1.114

I know that I can do this from one machine with Virtual Hosts but I would like to accomplish it with two separate machines...

share|improve this question

1 Answer 1

First, make sure you have mod_proxy* enabled (there are multiple proxy modules, so enable all of them for simplicity).

Then copy this into your main configuration file:

<VirtualHost *:80>
        # Where 'ServerName' is the domain of this site.
        ServerName joomla-one.domain.org
        ProxyRequests Off
        ProxyPreserveHost On
        ProxyVia full
        # LOCAL IP of the backend server (must be the same both places)
        ProxyPass / http://192.168.1.146:80/
        ProxyPassReverse / http://192.168.1.146:80/
        # The name of the log (so you can identify traffic)
        ErrorLog /var/log/apache2/error_joomla1.log
        LogLevel warn
        CustomLog /var/log/apache2/access_joomla1.log combined
</VirtualHost>
<VirtualHost *:80>
        # Where 'ServerName' is the domain of this site.
        ServerName joomla-two.domain.org
        ProxyRequests Off
        ProxyPreserveHost On
        ProxyVia full
        # LOCAL IP of the backend server (must be the same both places)
        ProxyPass / http://192.168.1.114:80/
        ProxyPassReverse / http://192.168.1.114:80/
        # The name of the log (so you can identify traffic)
        ErrorLog /var/log/apache2/error_joomla2.log
        LogLevel warn
        CustomLog /var/log/apache2/access_joomla2.log combined
</VirtualHost>

This actually combines a VirtualHost with a backend server via the Apache (reverse) proxy. Please post a comment if it does or does not work; I will try to edit my answer to accommodate your system.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.