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;
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 :
- Visiting
http://my-server-name.com
is opening thetomcat
landing page - Visiting
https://my-server-name.com
is opening theapache
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
add a comment |
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 :
- Visiting
http://my-server-name.com
is opening thetomcat
landing page - Visiting
https://my-server-name.com
is opening theapache
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
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
add a comment |
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 :
- Visiting
http://my-server-name.com
is opening thetomcat
landing page - Visiting
https://my-server-name.com
is opening theapache
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
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 :
- Visiting
http://my-server-name.com
is opening thetomcat
landing page - Visiting
https://my-server-name.com
is opening theapache
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
apache-2.2 ssl proxy tomcat reverse-proxy
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
add a comment |
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
add a comment |
2 Answers
2
active
oldest
votes
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>
This didn't work and the result is : 1.http://my-server-name.com
mapped toapache webserver
and not thetomcat
2.https://my-server-name.com
mapped toapache webserver
and not thetomcat
– 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 modulesproxy
,proxy_http
andrewrite
activated...
– Hello Fishy
Apr 4 '17 at 15:28
I've the modeules activated. Also, the above mentioned updated changes just madehttp
to behttps
; but the request is still not being transferred to tomcat. I can see theapache2
welcome page and nottomcat
– 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 happeningLogLevel 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
|
show 2 more comments
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
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 apachea2dissite 000-default
– chloesoe
Apr 5 '17 at 17:08
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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>
This didn't work and the result is : 1.http://my-server-name.com
mapped toapache webserver
and not thetomcat
2.https://my-server-name.com
mapped toapache webserver
and not thetomcat
– 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 modulesproxy
,proxy_http
andrewrite
activated...
– Hello Fishy
Apr 4 '17 at 15:28
I've the modeules activated. Also, the above mentioned updated changes just madehttp
to behttps
; but the request is still not being transferred to tomcat. I can see theapache2
welcome page and nottomcat
– 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 happeningLogLevel 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
|
show 2 more comments
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>
This didn't work and the result is : 1.http://my-server-name.com
mapped toapache webserver
and not thetomcat
2.https://my-server-name.com
mapped toapache webserver
and not thetomcat
– 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 modulesproxy
,proxy_http
andrewrite
activated...
– Hello Fishy
Apr 4 '17 at 15:28
I've the modeules activated. Also, the above mentioned updated changes just madehttp
to behttps
; but the request is still not being transferred to tomcat. I can see theapache2
welcome page and nottomcat
– 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 happeningLogLevel 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
|
show 2 more comments
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>
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>
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 toapache webserver
and not thetomcat
2.https://my-server-name.com
mapped toapache webserver
and not thetomcat
– 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 modulesproxy
,proxy_http
andrewrite
activated...
– Hello Fishy
Apr 4 '17 at 15:28
I've the modeules activated. Also, the above mentioned updated changes just madehttp
to behttps
; but the request is still not being transferred to tomcat. I can see theapache2
welcome page and nottomcat
– 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 happeningLogLevel 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
|
show 2 more comments
This didn't work and the result is : 1.http://my-server-name.com
mapped toapache webserver
and not thetomcat
2.https://my-server-name.com
mapped toapache webserver
and not thetomcat
– 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 modulesproxy
,proxy_http
andrewrite
activated...
– Hello Fishy
Apr 4 '17 at 15:28
I've the modeules activated. Also, the above mentioned updated changes just madehttp
to behttps
; but the request is still not being transferred to tomcat. I can see theapache2
welcome page and nottomcat
– 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 happeningLogLevel 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
|
show 2 more comments
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
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 apachea2dissite 000-default
– chloesoe
Apr 5 '17 at 17:08
add a comment |
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
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 apachea2dissite 000-default
– chloesoe
Apr 5 '17 at 17:08
add a comment |
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
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
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 apachea2dissite 000-default
– chloesoe
Apr 5 '17 at 17:08
add a comment |
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 apachea2dissite 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
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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