Enable mod_proxy on Plesk 11 with Ubuntu
Sometimes you need to redirect a website to a new server before the DNS changes are effective, or you need to prepare the hosting and the DNS settings before the website is transferred (or the new website is launched). In this case, it is very handy to just use the Apache Mod_proxy system.
How to do it on Plesk? It is really death simple… Following this procedure, you’ll be able to succeed it.
1. Install and enable mod_proxy. It should be shipped with your installation of Plesk 11 with Ubuntu:
sudo a2enmod proxy proxy_http
2. Edit the mod_proxy configuration file like this:
vim /etc/apache2/mods_enabled/proxy.conf
ProxyPreserveHost On
3. Restart the Apache service:
sudo service apache2 restart
4. Go to your website directory, under the conf folder(replace example.com by your website in my example):
cd /var/www/vhosts/example.com/conf
5. Create two files named vhost.conf and vhost_ssl.conf with the following content. (Replace 127.0.0.1 by the destination server)
ProxyPass / http://127.0.0.1:80/
ProxyPassReverse / http://127.0.0.1:80/
ProxyPassReverse / http://www.example.com:80/
6. Go to the control panel, suspend, and then activate your website. If you go to the URL (after DNS changes, locally or globally), you should now see the website that is hosted on the destination server.
1 Comment