Reverse proxy from apache to tomcat (for https to http)Apache redirection issue with httpsWhen Using Reverse Proxy, Backend Server Does 301 Back to The Proxy Server or Changes URLApache proxy over port 443reverse proxy not rewriting to httpsApache / Tomcat port informationApache not proxying HTTPS requests to tomcatBasic auth Apache with TomcatSetting up an Apache forward proxy with 2-way SSL with certificate CN check failsHow to mention # symbol in apache proxy pass?How to configure apache 2.2 to allow acme-challenge and pass all other traffic to AJP/tomcat

Schwa-less Polysyllabic German Noun Stems of Germanic Origin

Is being an extrovert a necessary condition to be a manager?

List of lists elementwise greater/smaller than

What city and town structures are important in a low fantasy medieval world?

US F1 Visa grace period attending a conference

Salesforce bug enabled "Modify All"

How to add a low pass filter to this non-inverting amplifier circuit?

Can dirty bird feeders make birds sick?

On a piano, are the effects of holding notes and the sustain pedal the same for a single chord?

Does George B Sperry logo on fold case for photos indicate photographer or case manufacturer?

Is it wise to pay off mortgage with 401k?

Are CTRL+C and <esc> the same?

How do we properly manage transitions within a descriptive section?

Farthing / Riding

Good examples of "two is easy, three is hard" in computational sciences

Do most Taxis give Receipts in London?

How do you cope with rejection?

Don't understand notation of morphisms in Monoid definition

How could the B-29 bomber back up under its own power?

Is presenting a play showing Military characters in a bad light a crime in the US?

How would a physicist explain this starship engine?

Is my company merging branches wrong?

How did Jean Parisot de Valette, 49th Grand Master of the Order of Malta, die?

How can I use 400 ASA film in a Leica IIIf, which does not have options higher than 100?



Reverse proxy from apache to tomcat (for https to http)


Apache redirection issue with httpsWhen Using Reverse Proxy, Backend Server Does 301 Back to The Proxy Server or Changes URLApache proxy over port 443reverse proxy not rewriting to httpsApache / Tomcat port informationApache not proxying HTTPS requests to tomcatBasic auth Apache with TomcatSetting up an Apache forward proxy with 2-way SSL with certificate CN check failsHow to mention # symbol in apache proxy pass?How to configure apache 2.2 to allow acme-challenge and pass all other traffic to AJP/tomcat






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I am trying to front my tomcat installation with Apache 2 webserver. The idea is to let apache handle the SSL/https part and then forward the normal request to the tomcat on same machine running on port 8080.



As mentioned here, I am using the following configuration :



<VirtualHost *:*>
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/

ServerName my-server-name.com
</VirtualHost>

Listen 443
NameVirtualHost *:443
<VirtualHost *:443>
SSLEngine On
SSLCertificateFile /etc/letsencrypt/archive/my-server-name.com/cert-file
SSLCertificateKeyFile /etc/letsencrypt/archive/my-server-name.com/key-file
SSLCertificateChainFile /etc/letsencrypt/archive/my-server-name.com/chain-file

ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/

</VirtualHost>


The above configuration is resulting in :



  1. Visiting http://my-server-name.com is opening the tomcat landing page

  2. Visiting https://my-server-name.com is opening the apache landing page

But what I expect is to always redirect to https://my-server-name.com which should open the tomcat landing page (which will evantually be replaced by my application deployed on the ROOT)



Can someone please guide me or any pointer to a step by step guide to front tomcat with apache for https to http handling










share|improve this question






















  • Aren't there any other VirtualHosts listening on port 443?

    – Lacek
    Apr 2 '17 at 13:33











  • @Lacek: no, just the ones I mentioned above

    – gaurs
    Apr 2 '17 at 13:34

















0















I am trying to front my tomcat installation with Apache 2 webserver. The idea is to let apache handle the SSL/https part and then forward the normal request to the tomcat on same machine running on port 8080.



As mentioned here, I am using the following configuration :



<VirtualHost *:*>
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/

ServerName my-server-name.com
</VirtualHost>

Listen 443
NameVirtualHost *:443
<VirtualHost *:443>
SSLEngine On
SSLCertificateFile /etc/letsencrypt/archive/my-server-name.com/cert-file
SSLCertificateKeyFile /etc/letsencrypt/archive/my-server-name.com/key-file
SSLCertificateChainFile /etc/letsencrypt/archive/my-server-name.com/chain-file

ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/

</VirtualHost>


The above configuration is resulting in :



  1. Visiting http://my-server-name.com is opening the tomcat landing page

  2. Visiting https://my-server-name.com is opening the apache landing page

But what I expect is to always redirect to https://my-server-name.com which should open the tomcat landing page (which will evantually be replaced by my application deployed on the ROOT)



Can someone please guide me or any pointer to a step by step guide to front tomcat with apache for https to http handling










share|improve this question






















  • Aren't there any other VirtualHosts listening on port 443?

    – Lacek
    Apr 2 '17 at 13:33











  • @Lacek: no, just the ones I mentioned above

    – gaurs
    Apr 2 '17 at 13:34













0












0








0








I am trying to front my tomcat installation with Apache 2 webserver. The idea is to let apache handle the SSL/https part and then forward the normal request to the tomcat on same machine running on port 8080.



As mentioned here, I am using the following configuration :



<VirtualHost *:*>
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/

ServerName my-server-name.com
</VirtualHost>

Listen 443
NameVirtualHost *:443
<VirtualHost *:443>
SSLEngine On
SSLCertificateFile /etc/letsencrypt/archive/my-server-name.com/cert-file
SSLCertificateKeyFile /etc/letsencrypt/archive/my-server-name.com/key-file
SSLCertificateChainFile /etc/letsencrypt/archive/my-server-name.com/chain-file

ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/

</VirtualHost>


The above configuration is resulting in :



  1. Visiting http://my-server-name.com is opening the tomcat landing page

  2. Visiting https://my-server-name.com is opening the apache landing page

But what I expect is to always redirect to https://my-server-name.com which should open the tomcat landing page (which will evantually be replaced by my application deployed on the ROOT)



Can someone please guide me or any pointer to a step by step guide to front tomcat with apache for https to http handling










share|improve this question














I am trying to front my tomcat installation with Apache 2 webserver. The idea is to let apache handle the SSL/https part and then forward the normal request to the tomcat on same machine running on port 8080.



As mentioned here, I am using the following configuration :



<VirtualHost *:*>
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/

ServerName my-server-name.com
</VirtualHost>

Listen 443
NameVirtualHost *:443
<VirtualHost *:443>
SSLEngine On
SSLCertificateFile /etc/letsencrypt/archive/my-server-name.com/cert-file
SSLCertificateKeyFile /etc/letsencrypt/archive/my-server-name.com/key-file
SSLCertificateChainFile /etc/letsencrypt/archive/my-server-name.com/chain-file

ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/

</VirtualHost>


The above configuration is resulting in :



  1. Visiting http://my-server-name.com is opening the tomcat landing page

  2. Visiting https://my-server-name.com is opening the apache landing page

But what I expect is to always redirect to https://my-server-name.com which should open the tomcat landing page (which will evantually be replaced by my application deployed on the ROOT)



Can someone please guide me or any pointer to a step by step guide to front tomcat with apache for https to http handling







apache-2.2 ssl proxy tomcat reverse-proxy






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Apr 2 '17 at 13:26









gaursgaurs

1012




1012












  • Aren't there any other VirtualHosts listening on port 443?

    – Lacek
    Apr 2 '17 at 13:33











  • @Lacek: no, just the ones I mentioned above

    – gaurs
    Apr 2 '17 at 13:34

















  • Aren't there any other VirtualHosts listening on port 443?

    – Lacek
    Apr 2 '17 at 13:33











  • @Lacek: no, just the ones I mentioned above

    – gaurs
    Apr 2 '17 at 13:34
















Aren't there any other VirtualHosts listening on port 443?

– Lacek
Apr 2 '17 at 13:33





Aren't there any other VirtualHosts listening on port 443?

– Lacek
Apr 2 '17 at 13:33













@Lacek: no, just the ones I mentioned above

– gaurs
Apr 2 '17 at 13:34





@Lacek: no, just the ones I mentioned above

– gaurs
Apr 2 '17 at 13:34










2 Answers
2






active

oldest

votes


















0














The first vhost isn't needed as it seems and the NameVirtualHost directive can also be dropped, resulting in:



Listen 80 
Listen 443

<VirtualHost *:80>
RewriteEngine On
RewriteCond %HTTP_HOST ^(.*)$
RewriteRule ^(.*)$ https://%1$1 [R=Permanent,L,QSA]
</VirtualHost>

<VirtualHost *:443>
SSLEngine On
SSLCertificateFile /etc/letsencrypt/archive/my-server-name.com/cert-file
SSLCertificateKeyFile /etc/letsencrypt/archive/my-server-name.com/key-file
SSLCertificateChainFile /etc/letsencrypt/archive/my-server-name.com/chain-file

ProxyPreserveHost On
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/
</VirtualHost>





share|improve this answer

























  • This didn't work and the result is : 1. http://my-server-name.com mapped to apache webserver and not the tomcat 2. https://my-server-name.com mapped to apache webserver and not the tomcat

    – gaurs
    Apr 4 '17 at 15:12












  • But the Apache doesn't listen on 8080 and Tomcat does? - edited my answer to force HTTPS on HTTP-requests

    – Hello Fishy
    Apr 4 '17 at 15:23











  • And you should have Apache modules proxy, proxy_http and rewrite activated...

    – Hello Fishy
    Apr 4 '17 at 15:28











  • I've the modeules activated. Also, the above mentioned updated changes just made http to be https; but the request is still not being transferred to tomcat. I can see the apache2 welcome page and not tomcat

    – gaurs
    Apr 4 '17 at 16:09











  • But the Apache doesn't listen on 8080 and Tomcat does? It seems like Apache still 'wins' the fight for port 8080...Myb turn up the errorlog to see more of what is happening LogLevel debug rewrite:trace2 should show you more than enough info, provide the relevant (if you can distinguish it^^) as an update of your post, if necessary clean up IPs and servernames...

    – Hello Fishy
    Apr 4 '17 at 16:13


















0














On my server I have this configuration for your question:



Listen 80
Listen 443

<VirtualHost *:80>
ErrorLog /var/log/apache2/myserver.error.log
CustomLog /var/log/apache2/myserver.log combined

#settings for AJP to tomcat
ProxyPass / ajp://localhost:8009/
ProxyPassReverse / ajp://localhost:8009/

</VirtualHost>

<VirtualHost *:443>
ErrorLog /var/log/apache2/myserver.error.log
CustomLog /var/log/apache2/myserver.log combined

<Proxy *>
AddDefaultCharset Off
Order deny,allow
Allow from all
</Proxy>
SSLEngine on
SSLCertificateKeyFile /etc/letsencrypt/live/myserver.com/privkey.pem
SSLCertificateFile /etc/letsencrypt/live/myserver.com/cert.pem

#settings for AJP to tomcat
ProxyPass / ajp://localhost:8009/
ProxyPassReverse / ajp://localhost:8009/

</VirtualHost>


I forward via AJP 8009, this is usually activated in tomcat. In apache the mod_proxy_ajp has to be enabled. But the configuration would work with http too.
Difference from my config to your's:
I don't have



<VirtualHost *:*>


and



NameVirtualHost *:443





share|improve this answer

























  • This again didn't work and resulted in the similar behavior as earlier

    – gaurs
    Apr 5 '17 at 16:42











  • what's logged, if you add the ErrorLog and CustomLog like in my example? On what OS are you running that? <br> Today I tested a similar installation on Debian, I had to disable the default site of apache a2dissite 000-default

    – chloesoe
    Apr 5 '17 at 17:08












Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "2"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f842055%2freverse-proxy-from-apache-to-tomcat-for-https-to-http%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














The first vhost isn't needed as it seems and the NameVirtualHost directive can also be dropped, resulting in:



Listen 80 
Listen 443

<VirtualHost *:80>
RewriteEngine On
RewriteCond %HTTP_HOST ^(.*)$
RewriteRule ^(.*)$ https://%1$1 [R=Permanent,L,QSA]
</VirtualHost>

<VirtualHost *:443>
SSLEngine On
SSLCertificateFile /etc/letsencrypt/archive/my-server-name.com/cert-file
SSLCertificateKeyFile /etc/letsencrypt/archive/my-server-name.com/key-file
SSLCertificateChainFile /etc/letsencrypt/archive/my-server-name.com/chain-file

ProxyPreserveHost On
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/
</VirtualHost>





share|improve this answer

























  • This didn't work and the result is : 1. http://my-server-name.com mapped to apache webserver and not the tomcat 2. https://my-server-name.com mapped to apache webserver and not the tomcat

    – gaurs
    Apr 4 '17 at 15:12












  • But the Apache doesn't listen on 8080 and Tomcat does? - edited my answer to force HTTPS on HTTP-requests

    – Hello Fishy
    Apr 4 '17 at 15:23











  • And you should have Apache modules proxy, proxy_http and rewrite activated...

    – Hello Fishy
    Apr 4 '17 at 15:28











  • I've the modeules activated. Also, the above mentioned updated changes just made http to be https; but the request is still not being transferred to tomcat. I can see the apache2 welcome page and not tomcat

    – gaurs
    Apr 4 '17 at 16:09











  • But the Apache doesn't listen on 8080 and Tomcat does? It seems like Apache still 'wins' the fight for port 8080...Myb turn up the errorlog to see more of what is happening LogLevel debug rewrite:trace2 should show you more than enough info, provide the relevant (if you can distinguish it^^) as an update of your post, if necessary clean up IPs and servernames...

    – Hello Fishy
    Apr 4 '17 at 16:13















0














The first vhost isn't needed as it seems and the NameVirtualHost directive can also be dropped, resulting in:



Listen 80 
Listen 443

<VirtualHost *:80>
RewriteEngine On
RewriteCond %HTTP_HOST ^(.*)$
RewriteRule ^(.*)$ https://%1$1 [R=Permanent,L,QSA]
</VirtualHost>

<VirtualHost *:443>
SSLEngine On
SSLCertificateFile /etc/letsencrypt/archive/my-server-name.com/cert-file
SSLCertificateKeyFile /etc/letsencrypt/archive/my-server-name.com/key-file
SSLCertificateChainFile /etc/letsencrypt/archive/my-server-name.com/chain-file

ProxyPreserveHost On
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/
</VirtualHost>





share|improve this answer

























  • This didn't work and the result is : 1. http://my-server-name.com mapped to apache webserver and not the tomcat 2. https://my-server-name.com mapped to apache webserver and not the tomcat

    – gaurs
    Apr 4 '17 at 15:12












  • But the Apache doesn't listen on 8080 and Tomcat does? - edited my answer to force HTTPS on HTTP-requests

    – Hello Fishy
    Apr 4 '17 at 15:23











  • And you should have Apache modules proxy, proxy_http and rewrite activated...

    – Hello Fishy
    Apr 4 '17 at 15:28











  • I've the modeules activated. Also, the above mentioned updated changes just made http to be https; but the request is still not being transferred to tomcat. I can see the apache2 welcome page and not tomcat

    – gaurs
    Apr 4 '17 at 16:09











  • But the Apache doesn't listen on 8080 and Tomcat does? It seems like Apache still 'wins' the fight for port 8080...Myb turn up the errorlog to see more of what is happening LogLevel debug rewrite:trace2 should show you more than enough info, provide the relevant (if you can distinguish it^^) as an update of your post, if necessary clean up IPs and servernames...

    – Hello Fishy
    Apr 4 '17 at 16:13













0












0








0







The first vhost isn't needed as it seems and the NameVirtualHost directive can also be dropped, resulting in:



Listen 80 
Listen 443

<VirtualHost *:80>
RewriteEngine On
RewriteCond %HTTP_HOST ^(.*)$
RewriteRule ^(.*)$ https://%1$1 [R=Permanent,L,QSA]
</VirtualHost>

<VirtualHost *:443>
SSLEngine On
SSLCertificateFile /etc/letsencrypt/archive/my-server-name.com/cert-file
SSLCertificateKeyFile /etc/letsencrypt/archive/my-server-name.com/key-file
SSLCertificateChainFile /etc/letsencrypt/archive/my-server-name.com/chain-file

ProxyPreserveHost On
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/
</VirtualHost>





share|improve this answer















The first vhost isn't needed as it seems and the NameVirtualHost directive can also be dropped, resulting in:



Listen 80 
Listen 443

<VirtualHost *:80>
RewriteEngine On
RewriteCond %HTTP_HOST ^(.*)$
RewriteRule ^(.*)$ https://%1$1 [R=Permanent,L,QSA]
</VirtualHost>

<VirtualHost *:443>
SSLEngine On
SSLCertificateFile /etc/letsencrypt/archive/my-server-name.com/cert-file
SSLCertificateKeyFile /etc/letsencrypt/archive/my-server-name.com/key-file
SSLCertificateChainFile /etc/letsencrypt/archive/my-server-name.com/chain-file

ProxyPreserveHost On
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/
</VirtualHost>






share|improve this answer














share|improve this answer



share|improve this answer








edited Apr 4 '17 at 15:22

























answered Apr 3 '17 at 15:49









Hello FishyHello Fishy

1013




1013












  • This didn't work and the result is : 1. http://my-server-name.com mapped to apache webserver and not the tomcat 2. https://my-server-name.com mapped to apache webserver and not the tomcat

    – gaurs
    Apr 4 '17 at 15:12












  • But the Apache doesn't listen on 8080 and Tomcat does? - edited my answer to force HTTPS on HTTP-requests

    – Hello Fishy
    Apr 4 '17 at 15:23











  • And you should have Apache modules proxy, proxy_http and rewrite activated...

    – Hello Fishy
    Apr 4 '17 at 15:28











  • I've the modeules activated. Also, the above mentioned updated changes just made http to be https; but the request is still not being transferred to tomcat. I can see the apache2 welcome page and not tomcat

    – gaurs
    Apr 4 '17 at 16:09











  • But the Apache doesn't listen on 8080 and Tomcat does? It seems like Apache still 'wins' the fight for port 8080...Myb turn up the errorlog to see more of what is happening LogLevel debug rewrite:trace2 should show you more than enough info, provide the relevant (if you can distinguish it^^) as an update of your post, if necessary clean up IPs and servernames...

    – Hello Fishy
    Apr 4 '17 at 16:13

















  • This didn't work and the result is : 1. http://my-server-name.com mapped to apache webserver and not the tomcat 2. https://my-server-name.com mapped to apache webserver and not the tomcat

    – gaurs
    Apr 4 '17 at 15:12












  • But the Apache doesn't listen on 8080 and Tomcat does? - edited my answer to force HTTPS on HTTP-requests

    – Hello Fishy
    Apr 4 '17 at 15:23











  • And you should have Apache modules proxy, proxy_http and rewrite activated...

    – Hello Fishy
    Apr 4 '17 at 15:28











  • I've the modeules activated. Also, the above mentioned updated changes just made http to be https; but the request is still not being transferred to tomcat. I can see the apache2 welcome page and not tomcat

    – gaurs
    Apr 4 '17 at 16:09











  • But the Apache doesn't listen on 8080 and Tomcat does? It seems like Apache still 'wins' the fight for port 8080...Myb turn up the errorlog to see more of what is happening LogLevel debug rewrite:trace2 should show you more than enough info, provide the relevant (if you can distinguish it^^) as an update of your post, if necessary clean up IPs and servernames...

    – Hello Fishy
    Apr 4 '17 at 16:13
















This didn't work and the result is : 1. http://my-server-name.com mapped to apache webserver and not the tomcat 2. https://my-server-name.com mapped to apache webserver and not the tomcat

– gaurs
Apr 4 '17 at 15:12






This didn't work and the result is : 1. http://my-server-name.com mapped to apache webserver and not the tomcat 2. https://my-server-name.com mapped to apache webserver and not the tomcat

– gaurs
Apr 4 '17 at 15:12














But the Apache doesn't listen on 8080 and Tomcat does? - edited my answer to force HTTPS on HTTP-requests

– Hello Fishy
Apr 4 '17 at 15:23





But the Apache doesn't listen on 8080 and Tomcat does? - edited my answer to force HTTPS on HTTP-requests

– Hello Fishy
Apr 4 '17 at 15:23













And you should have Apache modules proxy, proxy_http and rewrite activated...

– Hello Fishy
Apr 4 '17 at 15:28





And you should have Apache modules proxy, proxy_http and rewrite activated...

– Hello Fishy
Apr 4 '17 at 15:28













I've the modeules activated. Also, the above mentioned updated changes just made http to be https; but the request is still not being transferred to tomcat. I can see the apache2 welcome page and not tomcat

– gaurs
Apr 4 '17 at 16:09





I've the modeules activated. Also, the above mentioned updated changes just made http to be https; but the request is still not being transferred to tomcat. I can see the apache2 welcome page and not tomcat

– gaurs
Apr 4 '17 at 16:09













But the Apache doesn't listen on 8080 and Tomcat does? It seems like Apache still 'wins' the fight for port 8080...Myb turn up the errorlog to see more of what is happening LogLevel debug rewrite:trace2 should show you more than enough info, provide the relevant (if you can distinguish it^^) as an update of your post, if necessary clean up IPs and servernames...

– Hello Fishy
Apr 4 '17 at 16:13





But the Apache doesn't listen on 8080 and Tomcat does? It seems like Apache still 'wins' the fight for port 8080...Myb turn up the errorlog to see more of what is happening LogLevel debug rewrite:trace2 should show you more than enough info, provide the relevant (if you can distinguish it^^) as an update of your post, if necessary clean up IPs and servernames...

– Hello Fishy
Apr 4 '17 at 16:13













0














On my server I have this configuration for your question:



Listen 80
Listen 443

<VirtualHost *:80>
ErrorLog /var/log/apache2/myserver.error.log
CustomLog /var/log/apache2/myserver.log combined

#settings for AJP to tomcat
ProxyPass / ajp://localhost:8009/
ProxyPassReverse / ajp://localhost:8009/

</VirtualHost>

<VirtualHost *:443>
ErrorLog /var/log/apache2/myserver.error.log
CustomLog /var/log/apache2/myserver.log combined

<Proxy *>
AddDefaultCharset Off
Order deny,allow
Allow from all
</Proxy>
SSLEngine on
SSLCertificateKeyFile /etc/letsencrypt/live/myserver.com/privkey.pem
SSLCertificateFile /etc/letsencrypt/live/myserver.com/cert.pem

#settings for AJP to tomcat
ProxyPass / ajp://localhost:8009/
ProxyPassReverse / ajp://localhost:8009/

</VirtualHost>


I forward via AJP 8009, this is usually activated in tomcat. In apache the mod_proxy_ajp has to be enabled. But the configuration would work with http too.
Difference from my config to your's:
I don't have



<VirtualHost *:*>


and



NameVirtualHost *:443





share|improve this answer

























  • This again didn't work and resulted in the similar behavior as earlier

    – gaurs
    Apr 5 '17 at 16:42











  • what's logged, if you add the ErrorLog and CustomLog like in my example? On what OS are you running that? <br> Today I tested a similar installation on Debian, I had to disable the default site of apache a2dissite 000-default

    – chloesoe
    Apr 5 '17 at 17:08
















0














On my server I have this configuration for your question:



Listen 80
Listen 443

<VirtualHost *:80>
ErrorLog /var/log/apache2/myserver.error.log
CustomLog /var/log/apache2/myserver.log combined

#settings for AJP to tomcat
ProxyPass / ajp://localhost:8009/
ProxyPassReverse / ajp://localhost:8009/

</VirtualHost>

<VirtualHost *:443>
ErrorLog /var/log/apache2/myserver.error.log
CustomLog /var/log/apache2/myserver.log combined

<Proxy *>
AddDefaultCharset Off
Order deny,allow
Allow from all
</Proxy>
SSLEngine on
SSLCertificateKeyFile /etc/letsencrypt/live/myserver.com/privkey.pem
SSLCertificateFile /etc/letsencrypt/live/myserver.com/cert.pem

#settings for AJP to tomcat
ProxyPass / ajp://localhost:8009/
ProxyPassReverse / ajp://localhost:8009/

</VirtualHost>


I forward via AJP 8009, this is usually activated in tomcat. In apache the mod_proxy_ajp has to be enabled. But the configuration would work with http too.
Difference from my config to your's:
I don't have



<VirtualHost *:*>


and



NameVirtualHost *:443





share|improve this answer

























  • This again didn't work and resulted in the similar behavior as earlier

    – gaurs
    Apr 5 '17 at 16:42











  • what's logged, if you add the ErrorLog and CustomLog like in my example? On what OS are you running that? <br> Today I tested a similar installation on Debian, I had to disable the default site of apache a2dissite 000-default

    – chloesoe
    Apr 5 '17 at 17:08














0












0








0







On my server I have this configuration for your question:



Listen 80
Listen 443

<VirtualHost *:80>
ErrorLog /var/log/apache2/myserver.error.log
CustomLog /var/log/apache2/myserver.log combined

#settings for AJP to tomcat
ProxyPass / ajp://localhost:8009/
ProxyPassReverse / ajp://localhost:8009/

</VirtualHost>

<VirtualHost *:443>
ErrorLog /var/log/apache2/myserver.error.log
CustomLog /var/log/apache2/myserver.log combined

<Proxy *>
AddDefaultCharset Off
Order deny,allow
Allow from all
</Proxy>
SSLEngine on
SSLCertificateKeyFile /etc/letsencrypt/live/myserver.com/privkey.pem
SSLCertificateFile /etc/letsencrypt/live/myserver.com/cert.pem

#settings for AJP to tomcat
ProxyPass / ajp://localhost:8009/
ProxyPassReverse / ajp://localhost:8009/

</VirtualHost>


I forward via AJP 8009, this is usually activated in tomcat. In apache the mod_proxy_ajp has to be enabled. But the configuration would work with http too.
Difference from my config to your's:
I don't have



<VirtualHost *:*>


and



NameVirtualHost *:443





share|improve this answer















On my server I have this configuration for your question:



Listen 80
Listen 443

<VirtualHost *:80>
ErrorLog /var/log/apache2/myserver.error.log
CustomLog /var/log/apache2/myserver.log combined

#settings for AJP to tomcat
ProxyPass / ajp://localhost:8009/
ProxyPassReverse / ajp://localhost:8009/

</VirtualHost>

<VirtualHost *:443>
ErrorLog /var/log/apache2/myserver.error.log
CustomLog /var/log/apache2/myserver.log combined

<Proxy *>
AddDefaultCharset Off
Order deny,allow
Allow from all
</Proxy>
SSLEngine on
SSLCertificateKeyFile /etc/letsencrypt/live/myserver.com/privkey.pem
SSLCertificateFile /etc/letsencrypt/live/myserver.com/cert.pem

#settings for AJP to tomcat
ProxyPass / ajp://localhost:8009/
ProxyPassReverse / ajp://localhost:8009/

</VirtualHost>


I forward via AJP 8009, this is usually activated in tomcat. In apache the mod_proxy_ajp has to be enabled. But the configuration would work with http too.
Difference from my config to your's:
I don't have



<VirtualHost *:*>


and



NameVirtualHost *:443






share|improve this answer














share|improve this answer



share|improve this answer








edited Sep 25 '17 at 18:37

























answered Apr 5 '17 at 8:20









chloesoechloesoe

245114




245114












  • This again didn't work and resulted in the similar behavior as earlier

    – gaurs
    Apr 5 '17 at 16:42











  • what's logged, if you add the ErrorLog and CustomLog like in my example? On what OS are you running that? <br> Today I tested a similar installation on Debian, I had to disable the default site of apache a2dissite 000-default

    – chloesoe
    Apr 5 '17 at 17:08


















  • This again didn't work and resulted in the similar behavior as earlier

    – gaurs
    Apr 5 '17 at 16:42











  • what's logged, if you add the ErrorLog and CustomLog like in my example? On what OS are you running that? <br> Today I tested a similar installation on Debian, I had to disable the default site of apache a2dissite 000-default

    – chloesoe
    Apr 5 '17 at 17:08

















This again didn't work and resulted in the similar behavior as earlier

– gaurs
Apr 5 '17 at 16:42





This again didn't work and resulted in the similar behavior as earlier

– gaurs
Apr 5 '17 at 16:42













what's logged, if you add the ErrorLog and CustomLog like in my example? On what OS are you running that? <br> Today I tested a similar installation on Debian, I had to disable the default site of apache a2dissite 000-default

– chloesoe
Apr 5 '17 at 17:08






what's logged, if you add the ErrorLog and CustomLog like in my example? On what OS are you running that? <br> Today I tested a similar installation on Debian, I had to disable the default site of apache a2dissite 000-default

– chloesoe
Apr 5 '17 at 17:08


















draft saved

draft discarded
















































Thanks for contributing an answer to Server Fault!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f842055%2freverse-proxy-from-apache-to-tomcat-for-https-to-http%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Wikipedia:Vital articles Мазмуну Biography - Өмүр баян Philosophy and psychology - Философия жана психология Religion - Дин Social sciences - Коомдук илимдер Language and literature - Тил жана адабият Science - Илим Technology - Технология Arts and recreation - Искусство жана эс алуу History and geography - Тарых жана география Навигация менюсу

Bruxelas-Capital Índice Historia | Composición | Situación lingüística | Clima | Cidades irmandadas | Notas | Véxase tamén | Menú de navegacióneO uso das linguas en Bruxelas e a situación do neerlandés"Rexión de Bruxelas Capital"o orixinalSitio da rexiónPáxina de Bruselas no sitio da Oficina de Promoción Turística de Valonia e BruxelasMapa Interactivo da Rexión de Bruxelas-CapitaleeWorldCat332144929079854441105155190212ID28008674080552-90000 0001 0666 3698n94104302ID540940339365017018237

What should I write in an apology letter, since I have decided not to join a company after accepting an offer letterShould I keep looking after accepting a job offer?What should I do when I've been verbally told I would get an offer letter, but still haven't gotten one after 4 weeks?Do I accept an offer from a company that I am not likely to join?New job hasn't confirmed starting date and I want to give current employer as much notice as possibleHow should I address my manager in my resignation letter?HR delayed background verification, now jobless as resignedNo email communication after accepting a formal written offer. How should I phrase the call?What should I do if after receiving a verbal offer letter I am informed that my written job offer is put on hold due to some internal issues?Should I inform the current employer that I am about to resign within 1-2 weeks since I have signed the offer letter and waiting for visa?What company will do, if I send their offer letter to another company