Does Apache act as a proxy server?

How to setup an Apache proxy server in Linux?

There are a lot of things people do in Linux by installing various software for the system, but installing Apache web server is one of the most common tasks.

I am sure that your Apache web server has already been installed, but do you know if this web server is being used behind a firewall / gateway? I am going to assume here that you are using a Linux Operating System running either on a physical hardware or virtual machine, which you probably want to be safe than sorry, so I am going to recommend to have a look at our guide on how to setup a VPN/Routing environment on a Linux Virtual Machine. This includes details about how to connect between two locations, from inside (behind the corporate firewall) to outside (unrestricted internet), but here we focus on the reverse proxy part which comes with several advantages.

In order to configure an Apache proxy server, the Linux user must ensure it is configured to serve as a reverse proxy, using the Apache module modproxy, with a Listen 443 statement in the server's Apache configuration file /etc/apache2.example com . The above proxy server configuration is useful for many reasons, for instance, in case you are in a university network, you could use this web server to access the unrestricted internet, but you would still be able to block the access to certain websites, or even all websites, from your workplace's LAN while permitting you to bypass its proxy when needed. So without further ado, let us get into the details of how to do that.

Note : I am assuming you want to enable HTTP basic auth for the proxy server, for this you can install the modauthbasic Apache module. If the proxy service will be listening on a non standard HTTP port, it can be done via the command line (as this tutorial shows).

Related Answers

How to configure Apache forward proxy?

This article will teach you how to configure a ProxyPass in Apache....

What is the difference between ProxyPass and proxyreversepass?

Apache has a useful feature to use as a front-end web server: a ProxyPass directi...

What is the use of ProxyPreserveHost?

When should I use the ProxyPreserveHost flag? If you have read...