0

I have a proxy that redirects to an Java Web-App when error 403 is encountered.

This application checks the user's credentials: if the user is authorized, the client IP address is added to a list of authorized IP addresses, and included in Apache2.4's httpd.conf.

Therefore, The Proxy is to be restarted using:

synchronized (Runtime.getRuntime()) {
    Runtime.getRuntime().exec("...apachectl -k restart").waitFor();
}

This was tested locally with the proxy under Windows, it worked just fine; but when I started working on Linux (Ubuntu 14), the behavior changed with errors like "The connection was reset" or "No data received" (Firefox, Chrome, respectively).

Is there a relationship between processes of the Proxy (Apache 2.4) and the Web Server (Tomcat)?

1 Answers1

0

It turned out the restart would make the proxy reproduce the exact same "pending" request right after the restart operation.

To take in consideration the new values in httpd.conf, all I had to do was to replace the restart directive with graceful.

synchronized (Runtime.getRuntime()) {
    Runtime.getRuntime().exec("...apachectl -k graceful").waitFor();
}

This way, the process won't restart but changes within httpd.conf will take effect, and thus the whole mechanism won't be impacted.