Setup a Reverse Proxy – Apache (Linux)

The_Pirate_Bay_logo

softtitledonwloadlinkhomepagecontactlicenceSoftware Title: Reverse Piratebay Proxy – Apache (Linux)
Download Link: http://proxybay.info/assets/proxy/nginx-proxy.zip
Homepage: http://proxybay.info
Contact Them: http://proxybay.info/contact.html
License: Freeware open source project community driven.

Apache (Linux)

If you have a Linux VPS or dedicated server and are running the Apache web server, you can set up a reverse proxy

Steps for Debian based systems (E.g. Ubuntu)

1. Install two Apache modules, mod_proxy and mod_proxy_http. Enter the following two commands in your shell

a2enmod proxy
a2enmod proxy_http
a2enmod headers

2. After the two modules have been enabled, you can create a new Virtual Host.
This may differ on you system but on my system, I created a new file:

sudo nano /etc/apache2/sites-available/yourdomain.com

3. Add the following configuration to the file (Replace ‘yourdomain.com’ with the domain you wish to use):

<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName yourdomain.com
  <Proxy *>
    Order deny,allow
    Allow from all
  </Proxy>
  ProxyRequests off
  ProxyPassReverseCookieDomain .thepiratebay.se .yourdomain.com
  ProxyPreserveHost on
  ProxyPass / http://194.71.107.80/
  ProxyPassReverse / http://194.71.107.80/
  RequestHeader unset Accept-Encoding
</VirtualHost>

4. Enable the site

sudo a2ensite yourdomain.com

5. Restart Apache

/etc/init.d/apache2 restart

The site should now be functioning at your domain.

Steps for Red-Hat based systems (e.g. Centos)

1. You will need to enable two Apache modules, mod_proxy and mod_proxy_html.
See this link on how to enable modules.

2. After the two modules have been enabled, you can create a new Virtual Host.
This is usually done by going to the /etc/httpd/conf.d/ directory and creating a new file

nano /etc/httpd/conf.d/yourdomain.conf

3. Add the following configuration to the file (Replace ‘yourdomain.com’ with the domain you wish to use):

<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName yourdomain.com
  <Proxy *>
    Order deny,allow
    Allow from all
  </Proxy>
  ProxyRequests off
  ProxyPassReverseCookieDomain .thepiratebay.se .yourdomain.com
  ProxyPreserveHost on
  ProxyPass / http://194.71.107.80/
  ProxyPassReverse / http://194.71.107.80/
  RequestHeader unset Accept-Encoding
</VirtualHost>

4. Restart Apache

service httpd restart

The site should now be functioning at your domain.