ProxyPass within plesk 10/11

2

1

I would like to redirect some folder within apache2.

My webserver uses with plesk 11.

I followed this tutorial. It says I've got to put redirection rules in this file /etc/apache2/sites-available/default. For my webserver this file doesn't even exist. I guess that's because of plesk's website management. However there is only this one file: 000-default. I did not modify it!

I also managed to locate the config file for my domain. Which is located here

/var/www/vhosts/example.org/conf/last_httpd.include

I want to solve my problem with Apache 2 "ProxyPass". Because I think that's the easiest way to solve the redirect.

As I found out, I have to add this line

ProxyPass /folder/map/ http://www.google.de

This does not work. It exits with error "403 forbidden". Please give me a hint. Thank you!

Peter

Posted 2013-02-18T17:27:11.340

Reputation: 728

I really don't see in the given config anything about how to open example.org/mc/map URL. It handles /mc/map/up, /mc/map/standalone and /mc/map/tiles, but not /mc/map.Probably you need to remove temporarily this config and check example.org/mc/map again – Sergey L – 2013-02-20T04:31:07.807

@SergeyL You are right. I checked this. I think their tutorial is just wrong. So I edited my post. – Peter – 2013-02-24T16:39:00.460

Answers

5

Plesk 10/11:

1. Create your individual config for apache2

cd /var/www/vhosts/example.org
sudo touch conf/vhost.conf
sudo vim 

2. Insert your directives there

Press I and insert those lines

RewriteEngine On
ProxyPass /directory/subdir/ http://localhost:8123/
ProxyPassReverse /directory/subdir/ http://localhost:8123/

Press Esc followed by : and write: wq and press

3. Tell apache to use the config

sudo /usr/local/psa/admin/bin/httpdmng --reconfigure-all
sudo service apache2 restart

4. You are done.


Plesk 12

  • Login as administrator
  • Select subscription
  • Open in control panel
  • Web server settings
  • Additional directives for HTTP && Additional directives for HTTPS:


RewriteEngine On
ProxyPass /directory/subdir/ http://localhost:8123/
ProxyPassReverse /directory/subdir/ http://localhost:8123/


Sources:
oli.new-lan.de
forum.parallels.com

Peter

Posted 2013-02-18T17:27:11.340

Reputation: 728

1

The answer above is correct, but I have smth to add:

ProxyPass /directory/subdir/ http://localhost:8123/
ProxyPassReverse /directory/subdir/ http://localhost:8123/

No need to add RewriteEngine On here.

/usr/local/psa/admin/bin/httpdmng --reconfigure-domain <YOUR_DOMAIN>

No need to restart httpd also.

user3070377

Posted 2013-02-18T17:27:11.340

Reputation: 11

Welcome to Super User! This is really a comment and not an answer to the original question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient reputation you will be able to comment on any post.

– DavidPostill – 2015-07-05T07:08:37.593

0

ProxyPass /directory/subdir/ http://localhost:8123/
ProxyPassReverse /directory/subdir/ http://localhost:8123/

is right but I had to activate proxy_http module first. By checkbox in Plesk or by terminal.

sudo a2enmod proxy_http
service apache2 reload

otherwise I've got errors like this in my log:

No protocol handler was valid for the URL /myapp. 
If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.

Fusca Software

Posted 2013-02-18T17:27:11.340

Reputation: 121

The hint to activate/install proxy_http. If you don't have it, you get the mentioned error. – Fusca Software – 2017-09-12T11:37:22.327