Before setting up my Linux servers for my development environments, I was using a WAMP (Windows, Apache, MySQL & PHP) stack to do Drupal development. The workings of the site on my local dev machine was exactly the same as the live site. All I needed to do was FTP files between the two to make updates and changes.
Recently, I moved away from the WAMP stack and created a proper LAMP (Linux, Apache, MySQL & PHP) server. However, this server is not internet facing, and therefore requires a proxy server to access outside resources. I use Squid for this. The configuration of the Squid proxy was quite simple (let me know in the comments if you’d like me to write tutorial on this). However after installing the Drupal site on my LAMP server, I noticed there were some issues that were not present with the WAMP stack. After researching, I found out that it was because I was using a proxy server between Drupal and the internet, and I had not configured it in Drupal.
I was reluctant to make any changes at the file level for this, as this is an issue only within my development environment – I should solve the issue causing the problem, and not band-aid it with code. What I really wanted was a way to turn a proxy on and off from the UI. Then I found the Drupal http_proxy module. This does exactly what I was after: it allows me to enter the details of a proxy server from the Drupal website itself. So when I download the site to my server for development, I simply add the details of my Squid server into the proxy admin page. Then, before uploading the file and database changes I’ve made to the live server, I remove the details of the proxy. As a final step in my deployment checklist, I check the settings of the proxy on the live site to make sure the setting has been removed (or manually disable the module).
This has worked great for me and allows me to keep my LAMP development server off my main network without a problem, and I don’t need to resort to hard wired coding to deal with my internal proxy.