Apache 2 - Setup Reverse Proxy to Access Private Network Over The Internet

I wrote these tutorials for myself in future when I forget for the next steps.
Search for a command to run...

I wrote these tutorials for myself in future when I forget for the next steps.
No comments yet. Be the first to comment.
When you provision an Ubuntu instance on Oracle Cloud, you'll notice something different from standard Ubuntu installations: the system uses iptables instead of ufw for firewall management. This disti

When developing web applications locally, HTTPS is often overlooked. Yet, modern browsers and APIs increasingly require secure connections—even in development. That’s where mkcert comes in: a simple t

Testing the checkout success page in Magento 2 can be frustrating. By default, once an order is placed, Magento clears the quote session, meaning you can’t simply refresh or revisit the success page without going through the entire checkout process a...

Magento Commerce (EE) offers powerful features, but for many teams, Open Source (CE) is leaner, lighter, and more sustainable. If you're migrating from EE to CE, the Opengento downgrade tool provides a clean, scriptable way to remove proprietary modu...

If you’ve ever checked your Apache error logs and seen something like this: Code [core:error] (13)Permission denied: access to /robots.txt denied (filesystem path '/home/username/sites') because search permissions are missing on a component of the pa...

Do you already have apache2 configured on your server, and you want to have another application running on the same port as apache have? which is port 80.
We can do it by implementing reverse proxy, so how to do it?
We need to create a virtual host, in this case I will try to create magento245.dev.fiko.me
<VirtualHost *:80>
ServerAdmin hi@fiko.me
ServerName testing.dev.fiko.me
</VirtualHost>
Next we need to place reverse proxy, and point this virtual host to original port you have previously installed on. In this case I already installed my application locally on port of 8082, so I need to point to port of 8082.
<VirtualHost *:80>
ServerAdmin hi@fiko.me
ServerName testing.dev.fiko.me
SSLProxyEngine On
RequestHeader set Front-End-Https "On"
ProxyPreserveHost On
SSLProxyVerify none
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off
SSLProxyCheckPeerExpire off
ProxyPass / http://127.0.0.1:8082/
ProxyPassReverse / http://127.0.0.1:8082/
</VirtualHost>
Try to run :
sudo apache2ctl configtest
it should have Syntax Ok response.
Once it's good, restart your apache
sudo service apache2 restart
and try to access your application from browser.
Do you face this error?

It's too general, but maybe you haven't enabled required apache2 modules, you need to enable these modules:
sudo a2enmod ssl
sudo a2enmod proxy
sudo a2enmod proxy_balancer
sudo a2enmod proxy_http
Then restart your apache2, and refresh the browser.
References: