3

I use this configuration below in order to make my application available via SSL. My question now would be how it is possible to set a timeout at **. Is there a way of doing it and how would be the syntax?

# force HTTPS
<VirtualHost *:80>
ServerName app.xy.at

RewriteEngine on
RewriteCond %{SERVER_NAME} =app.xy.at
Redirect permanent "/" https://app.xy.at
RewriteRule (.*) https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

# forward ORDS requests to tomcat
<VirtualHost *:443>
ServerName app.xy.at

# SSL certificates settings
#Include /etc/apache2/conf-enabled/options-ssl-apache.conf
SSLCertificateFile /etc/apache2/ssl/app.xy.at/fullchain.cer
SSLCertificateKeyFile /etc/apache2/ssl/app.xy.at/app.xy.at.key
SSLCertificateChainFile /etc/apache2/ssl/app.xy.at/ca.cer

ProxyRequests on
ProxyPreserveHost On
<Location / >
    ProxyPass "ajp://localhost:9090/"
    ProxyPassReverse "ajp://localhost:9090/"
</Location>

I will set a timeout because I get the following errors:

[Thu Mar 26 00:10:52.731383 2020] [proxy_ajp:error] [pid 16266:tid 
139926293157632] [client 
xxx.xxx.3.59:60869] AH00893: dialog to 127.0.0.1:9090 (localhost) 
failed, referer: 
https domain
[Thu Mar 26 00:10:57.802571 2020] [proxy_ajp:error] [pid 16266:tid 
139926720988928] 
(70014)End of file found: AH01030: ajp_ilink_receive() can't receive 
header
[Thu Mar 26 00:10:57.802597 2020] [proxy_ajp:error] [pid 16266:tid 
139926720988928] [client 
xxx.xxx.3.59:60875] AH00992: ajp_read_header: ajp_ilink_receive 
failed, referer: 
https domain
[Thu Mar 26 00:10:57.802628 2020] [proxy_ajp:error] [pid 16266:tid 
139926720988928] 
(120006)APR does not understand this error code: [client 
xxxx.xxxx.3.59:60875] AH00878: read 
response failed from 127.0.0.1:9090 (localhost), referer: https domain

and I dont know why.

quma
  • 5,233
  • 26
  • 80
  • 146
  • 5
    You can try this `ProxyPass "ajp://localhost:9090/" connectiontimeout=5 timeout=30` – Tarun Lalwani Mar 30 '20 at 06:23
  • 2
    To add a bit more context to @TarunLalwani's comment, take a look at [documentation here](https://httpd.apache.org/docs/2.4/mod/mod_proxy.html#proxypass) – timur Mar 31 '20 at 00:57
  • It sounds like you get this error because of the default timeout values, if you need to know which requests failed you can enable logging with extra debug information including the request information. However you may have a problem with your application server (Tomcat?) so check that also for sufficient heap size (garbage collection logging), thread pool sizes, or do a thread dump to see what your application threads are waiting for – JohannesB Apr 05 '20 at 14:17

1 Answers1

0

According to the documentation, You can pass different parameters along with the URL, in the format of key value pairs

ProxyPass "protocol://domain.com" key1=value1 key2=value2 ...

for your case,

ProxyPass "ajp://localhost:9090/" connectiontimeout=10 timeout=50

connectiontimeout : Connect timeout in seconds. The number of seconds Apache httpd waits for the creation of a connection to the backend to complete. By adding a postfix of ms, the timeout can be also set in milliseconds.

timeout : Connection timeout in seconds. The number of seconds Apache httpd waits for data sent by / to the backend.

Nilanka Manoj
  • 3,527
  • 4
  • 17
  • 48