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

Multi tool use
Multi tool use

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







Px6,az5cBzpR7HZ gOwLx2FDYl 1IQWdDEAbA0
94j76TFH VbhRoxXlN8eiHRvjNE5gQh 1CLPIfJJ hF Vizh B,nuG JyfiesYBP2JT zerTVERAIADog4dpe8KmVbKNGSxXdYMN3

Popular posts from this blog

RemoteApp sporadic failureWindows 2008 RemoteAPP client disconnects within a matter of minutesWhat is the minimum version of RDP supported by Server 2012 RDS?How to configure a Remoteapp server to increase stabilityMicrosoft RemoteApp Active SessionRDWeb TS connection broken for some users post RemoteApp certificate changeRemote Desktop Licensing, RemoteAPPRDS 2012 R2 some users are not able to logon after changed date and time on Connection BrokersWhat happens during Remote Desktop logon, and is there any logging?After installing RDS on WinServer 2016 I still can only connect with two users?RD Connection via RDGW to Session host is not connecting

Vilaño, A Laracha Índice Patrimonio | Lugares e parroquias | Véxase tamén | Menú de navegación43°14′52″N 8°36′03″O / 43.24775, -8.60070

Cegueira Índice Epidemioloxía | Deficiencia visual | Tipos de cegueira | Principais causas de cegueira | Tratamento | Técnicas de adaptación e axudas | Vida dos cegos | Primeiros auxilios | Crenzas respecto das persoas cegas | Crenzas das persoas cegas | O neno deficiente visual | Aspectos psicolóxicos da cegueira | Notas | Véxase tamén | Menú de navegación54.054.154.436928256blindnessDicionario da Real Academia GalegaPortal das Palabras"International Standards: Visual Standards — Aspects and Ranges of Vision Loss with Emphasis on Population Surveys.""Visual impairment and blindness""Presentan un plan para previr a cegueira"o orixinalACCDV Associació Catalana de Cecs i Disminuïts Visuals - PMFTrachoma"Effect of gene therapy on visual function in Leber's congenital amaurosis"1844137110.1056/NEJMoa0802268Cans guía - os mellores amigos dos cegosArquivadoEscola de cans guía para cegos en Mortágua, PortugalArquivado"Tecnología para ciegos y deficientes visuales. Recopilación de recursos gratuitos en la Red""Colorino""‘COL.diesis’, escuchar los sonidos del color""COL.diesis: Transforming Colour into Melody and Implementing the Result in a Colour Sensor Device"o orixinal"Sistema de desarrollo de sinestesia color-sonido para invidentes utilizando un protocolo de audio""Enseñanza táctil - geometría y color. Juegos didácticos para niños ciegos y videntes""Sistema Constanz"L'ocupació laboral dels cecs a l'Estat espanyol està pràcticament equiparada a la de les persones amb visió, entrevista amb Pedro ZuritaONCE (Organización Nacional de Cegos de España)Prevención da cegueiraDescrición de deficiencias visuais (Disc@pnet)Braillín, un boneco atractivo para calquera neno, con ou sen discapacidade, que permite familiarizarse co sistema de escritura e lectura brailleAxudas Técnicas36838ID00897494007150-90057129528256DOID:1432HP:0000618D001766C10.597.751.941.162C97109C0155020