configuring ProxyPass on .htaccess to show tomcat through apache http server

10,300

proxypass and proxypassReverse are available only in the server config and virtual host contexts.

in case you don't have access to the config files or whatever else reason, you could use mod_rewrite with the P flag which does the same.

your .htaccess file should then look like

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule tomcat/ http://127.0.0.1:8080/ [P]
</IfModule>
Share:
10,300
Ulises Layera
Author by

Ulises Layera

Updated on June 04, 2022

Comments

  • Ulises Layera
    Ulises Layera almost 2 years

    I have an Apache HTTP server runing on an open 80 port and a Tomcat server running on 8080 closed port.

    I can get internally the tomcat webpage using lwp-request 127.0.0.1 8080.

    I don't have access to httpd.conf so i tried to configure a ProxyPass on the .htaccess file.

    What i need is that the user who enters http://www.mydomain.com/tomcat can see the html generated by the tomcat server

    I used this line in the .htaccess:

    ProxyPass tomcat/ http://127.0.0.1:8080/
    

    But the only thing i get entering http://www.mydomain.com/tomcat is an error 500

    What am i doing wrong?