When your web application is starting, it's best to let your clients know that it's temporary and soon you will be up and runnning again:
To make it possible you must have Apache HTTPD up-and-running and it must be an intermediate between your web application and your client. This is best practice anyway. To make it happen, you need in /etc/apache2/sites-available a file named YOUR_APP_NAME.conf:
<VirtualHost *:80> ServerAdmin YOUR_EMAIL ServerName YOUR_APP_HOST_NAME.com ServerAlias *.YOUR_APP_HOST_NAME.com # where's customized error message DocumentRoot /var/www/html ProxyPreserveHost On # this URLs won't be served to your web application ProxyPass /error-500-YOUR_APP_NAME.html ! ProxyPass /maintenance.jpg ! # In case of 503 HTTP error show the error page ErrorDocument 503 /error-500-YOUR_APP_NAME.html # on which port your web application runs ProxyPass / http://localhost:8080/ ProxyPassReverse / http://localhost:8080/ ProxyPassReverseCookiePath / / ErrorLog /var/log/apache2/YOUR_APP_HOST_NAME.com-error.log LogLevel warn </VirtualHost>
Made better & faster using https://www.yourkit.com/ Java Profiler