Although it is 3yrs down-hill, yet answering the question might help someone in need henceforth.
I will explain about how to do it on Ubuntu. It will be the same for other Linux distros but just sudo would become yum in case of CentOS and so on, so forth!
So here goes: “remove endless redirect loop on apache web server” :
Redirect loops are created when you have a proxy in front of your server. In the subject case, we have an Apache server (tested on this day while replying).
Now @kolemcrae seems to have removed #CloudFlare from the picture to achieve HTTPS but here is a quick link to small “magic mod” for Apache Web Server.
A simple guide is given below to download, compile & install the mod from source:
First, install dependencies:
sudo apt-get install unzip build-essential apache2-threaded-dev libtool libtool-bin
For Ubuntu 16.04 and above apache2-threaded-dev is now available on apache2-dev. So replace as your case maybe! Moving on..
Next, download the ZIP archive from GIT from below link:
It is preferable that you download this ZIP archive in /tmp folder but it is your choice if you like to clean up manually afterwards. Moving on..
Next, unzip the archive and change to extracted directory i.e. mod_rpaf-stable:
“`sudo unzip stable.zip
Once inside the directory, it’s time to compile & install the archive:
sudo make install”`
Now, there is an important prompt when “make install” completes. Please follow that with libtool. For this libtool command to work, you need ‘libtool-bin’ which we have already installed.
Next, let us setup the mod manually as follows:
sudo nano /etc/apache2/mods-available/rpaf.load
The above command will create and open a new file. Copy & Paste following line in this new file:
LoadModule rpaf_module /usr/lib/apache2/modules/mod_rpaf.so
Next, create an Apache mod in mods-available directory:
sudo nano /etc/apache2/mods-available/rpaf.conf
The above command will create & open a new file for editing. Copy & paste following lines in it:
Finally, enable this newly created mod and restart Apache Web Server:
“`sudo a2enmod rpaf
sudo service apache2 restart”`
That’s it !!
Reference: This Article STEP-8