You have a web application currently deployed within a private network. You would like your friends to test the application over the Internet.
One option is to set up a public server with the configuration similar to the one on the private network. However, this approach is tedious and costly especially if for testing purposes only.
An alternative is to use the proxying capabilities of Apache, in particular reverse proxying.
- Ubuntu Server 14.04 LTS with a public IP address and a private IP address (which is connected to the private network where the web application is running)
- Install and enable the required apache modules.
- sudo apt-get install apache2 libapache2-mod-proxy-html
- sudo a2enmod proxy_html
- Edit the /etc/apache2/sites-enabled/000-default. Add the following inside the VirtualHost directive, reflecting your own settings.
- ProxyPass "/myapp" "http://private_ip_hosting_the_app"
- ProxyPassReverse "/myapp" "http://private_ip_hosting_the_app"
- Restart Apache.
- sudo service apache2 restart
- Visit http://public_ip_of_server/myapp to test
You can add as many web applications as you want. Here is an example.