Tomcat 8.5.31 stuck while deploying the war

We are migrating our application from tomcat 7 to tomcat 8. All wars are deploying successfully in tomcat 8. But only one war is not deploying. Tomcat 8 starts deploying the war and then stuck there. No logs are printing in Catalina.out and Error.log.

Please find below logs.

23-May-2018 04:14:55.314 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version:        Apache Tomcat/8.5.31
23-May-2018 04:14:55.328 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Apr 27 2018 20:24:25 UTC
23-May-2018 04:14:55.328 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number:         8.5.31.0
23-May-2018 04:14:55.328 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Linux
23-May-2018 04:14:55.328 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            3.10.0-693.21.1.el7.x86_64
23-May-2018 04:14:55.328 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
23-May-2018 04:14:55.328 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             /usr/java/jdk1.8.0_60/jre
23-May-2018 04:14:55.328 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.8.0_60-b27
23-May-2018 04:14:55.328 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
23-May-2018 04:14:55.329 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         /opt/apache-tomcat-8.5.31
23-May-2018 04:14:55.329 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         /opt/apache-tomcat-8.5.31
23-May-2018 04:14:55.329 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/opt/tomcat/conf/logging.properties
23-May-2018 04:14:55.329 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
23-May-2018 04:14:55.329 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
23-May-2018 04:14:55.329 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
23-May-2018 04:14:55.329 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
23-May-2018 04:14:55.330 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
23-May-2018 04:14:55.330 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/opt/tomcat
23-May-2018 04:14:55.330 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/opt/tomcat
23-May-2018 04:14:55.330 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/opt/tomcat/temp
23-May-2018 04:14:55.330 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib]
23-May-2018 04:14:55.644 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
23-May-2018 04:14:55.675 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
23-May-2018 04:14:55.706 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
23-May-2018 04:14:55.708 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
23-May-2018 04:14:55.720 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 1282 ms
23-May-2018 04:14:55.755 WARNING [main] org.apache.tomcat.jdbc.pool.ConnectionPool.checkPoolConfiguration maxIdle is smaller than minIdle, setting maxIdle to: 5
23-May-2018 04:14:57.653 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
23-May-2018 04:14:57.654 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.31
23-May-2018 04:14:57.711 INFO [localhost-startStop-1] **org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/opt/apache-tomcat-8.5.31/webapps/llas.war]**

This is last line in Catalina.out.

Php and Flask with Apache Server with same Domain

i have an apache server (in an AWS EC2 instance) running a Landing Page written in PHP. This page is directed to let's say https// mydomain.com. Now i want to develop a Flask Application, but using the same Domain. On my research i found that i can modify my vhost.conf in this way:

<IfModule mod_ssl.c>
<VirtualHost *:443>
    ServerName www.mydomain.com
    ServerAlias mydomain.com
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^www.(.*) [NC]
    RewriteRule ^(.*) http://%1%{REQUEST_URI} [R=301,L]
    DocumentRoot /var/www/html/xxx
Include /etc/qqq/eee.conf
SSLCertificateFile /etc/rrr/ttt/mydomain.com/yyy.pem
SSLCertificateKeyFile /etc/rrr/ttt/mydomain.com/uuu.pem


ProxyRequests off
<Proxy *>
    Order deny,allow
    Allow from all
</Proxy>
<Location /webhooks>
    ProxyPassMatch http://localhost:5000/
    ProxyPassReverse http://localhost:5000/
</Location>

</VirtualHost>
</IfModule>

This works only for the index route on my Flask Application

from flask import Flask, render_template

app = Flask(__name__)

@app.route('/')
def index():
   return 'index'

@app.route('/contidions')
def condiciones():
    return render_template('conditions.html')


if __name__ == '__main__':
   app.run(debug = True)

so if i enter to mydomain.com/webhooks render 'Index', but if i try to enter to mydomain.com/webhooks/conditions, the server redirects to mydomain.com/webhooks. As you can see i'm not a server expert, so i don't know how to fix it or change it.

Thanks in advance for your help

Error ImportError: No module named ‘encodings’ in virtual environment using pyenv

I am trying to publish the site created by Django using apache. The settings of the server are as follows.

・ CentOS 7.2
・ Python 3.6
・ Django 2.0
・ apache 2.4

I am preparing a virtual environment using pyenv as follows.

git clone https://github.com/yyuu/pyenv.git ~/.pyenv
…
pyenv install anaconda3-5.1.0
pyenv rehash
pyenv global anaconda3-5.1.0
…
yum install httpd httpd-devel
systemctl start httpd
systemctl enable httpd
….
wget https://github.com/GrahamDumpleton/mod_wsgi/archive/4.5.14.tar.gz
tar -zxvf 4.5.14.tar.gz
cd mod_wsgi-4.5.14/
./configure --with-python=/home/username/.pyenv/versions/anaconda3-5.1.0/bin/python
make
sudo make install
…

■ httpd.conf

NameVirtualHost *:80
LoadModule wsgi_module /usr/lib64/httpd/modules/mod_wsgi.so
WSGISocketPrefix /var/run/wsgi
<VirtualHost *:80>

ServerName xxx.com
DocumentRoot /var/www/html

WSGIScriptReloading On
WSGIDaemonProcess xxx python-path=/home/username/.pyenv/versions/anaconda3-5.1.0/lib/python3.6/site-packages python-home=/home/username/.pyenv/versions/anaconda3-5.1.0
WSGIProcessGroup xxx
WSGIScriptAlias / /var/www/html/xxx/xxx/wsgi.py

<Directory "/xxx/">
Order deny,allow
</Directory>
</VirtualHost>

The following error will occur with this setting.

Fatal Python error: Py_Initialize: Unable to get the locale encoding
ModuleNotFoundError: No module named 'encodings'

Setting chmod should be fine. What other reasons can be considered?

apache websocket redirect / proxy

I need to load a webpage and forward it to a client using php. The webpage and the client are in separate networks, client connects using a browser (Google Chrome). I've implemented a php-proxy and that works fine with most pages. Unfortunately one program requires the use of a websocket, which I wasn't that familiar with and doesn't work with my current php-proxy.

When loaded in the local network the websocket normally connects to its location followed by a GET param. (example: ws://192.168.2.13:8080/theapp/websocket-tunnel?tunnel=83F7_65G8-36D7583) The location always stays the same, only the tunnel changes. But externally with the php-proxy it looks like this: ws://justawebsite.net/proxyfolder/websocket-tunnel?tunnel=83F7_65G8-36D7583

Within the config-file of Apache I want to change the last url into the first one. I want to do something like this:

<VirtualHost *:80>
    RewriteEngine  on
    RewriteCond    "%{REQUEST_URI}" "websocket-tunnel"
    RewriteRule    "/proxyfolder/(.*)" "ws://192.168.2.13:8080/theapp/$1"
</VirtualHost>

Without the above I get a 404, and with the above I get a 302 as status code for loading the websocket. So I can asume that the Rewrite goes well. It just doesn't stay open. But I saw somewhere that I should use something like this

<VirtualHost *:80>
    ProxyPass /ws/ ws://192.168.2.13:8080/theapp
    ProxyPassReverse /ws/ ws://192.168.2.13:8080/theapp
</VirtualHost>

Which fails miserably because it doesn't change the location. And I don't know how to combine both into something working. I just need to proxy the websocket, and change the location a little.

I've also tried a php proxy based on Workerman but there where so many issues that I gave up on that one. Any suggestions are welcome. Please let me know if I made a mistake in the logic of the config code above while I replaced my personal details.

First REST call slow on Apache server

I'm facing this issue on some of the requests. All the first calls of a user (or when some time has passed) take up to 60 seconds to be completed. After that it takes milliseconds. It doesn't matter if I call it on an internet browser or with SOAP UI, it is always the same. I'm running a java application on Apache. I ran it with fiddler to see where is the call spending the most time, and it looks like it is between when the server gets the request, and it started the answer, everytime it takes 61 seconds. Fiddler also shows the SSL handshake taking milliseconds in both cases

I'm not sure where else to look. If anyone can shed some light it will be greatly appreciated.

First request (takes 1:01 mins)

Request Count:   1
Bytes Sent:      683        (headers:683; body:0)
Bytes Received:  846        (headers:347; body:499)

ACTUAL PERFORMANCE
--------------

This traffic was captured on Friday, May 18, 2018.

ClientConnected:    16:21:17.244
ClientBeginRequest: 16:21:17.465
GotRequestHeaders:  16:21:17.465
ClientDoneRequest:  16:21:17.465
Determine Gateway:  0ms
DNS Lookup:         0ms
TCP/IP Connect: 0ms
HTTPS Handshake:    0ms
ServerConnected:    16:21:17.275
FiddlerBeginRequest:    16:21:17.466
ServerGotRequest:   16:21:17.466
ServerBeginResponse:    16:22:18.597
GotResponseHeaders: 16:22:18.597
ServerDoneResponse: 16:22:18.599
ClientBeginResponse:    16:22:18.599
ClientDoneResponse: 16:22:18.599

    Overall Elapsed:    0:01:01.133

RESPONSE BYTES (by Content-Type)
--------------
application/json: 499
       ~headers~: 347

Subsequent requests (Takes 0.120 mins)

Request Count:   1
Bytes Sent:      683        (headers:683; body:0)
Bytes Received:  846        (headers:347; body:499)

ACTUAL PERFORMANCE
--------------

This traffic was captured on Friday, May 18, 2018.

ClientConnected:    16:22:38.582
ClientBeginRequest: 16:22:38.607
GotRequestHeaders:  16:22:38.607
ClientDoneRequest:  16:22:38.607
Determine Gateway:  0ms
DNS Lookup:         0ms
TCP/IP Connect: 0ms
HTTPS Handshake:    0ms
ServerConnected:    16:22:38.589
FiddlerBeginRequest:    16:22:38.607
ServerGotRequest:   16:22:38.607
ServerBeginResponse:    16:22:38.726
GotResponseHeaders: 16:22:38.726
ServerDoneResponse: 16:22:38.727
ClientBeginResponse:    16:22:38.727
ClientDoneResponse: 16:22:38.727

    Overall Elapsed:    0:00:00.120

RESPONSE BYTES (by Content-Type)
--------------
application/json: 499
       ~headers~: 347

This is how it looks another first call made with the browser Chrome Network Analysis

Thanks!!

domain www and non www pointing to differents paths

I followed this tutorial to install mautic on my Digital Ocean droplet.

When i access the domain with www, eg: www.loudmonitor.ga the mautic opens. but when i access loudmonitor.ga, the apache page opens.

What i made wrong and how can i fix this?

PS: I used 'lets encrypt' to configure SSL on www.loudmonitor.ga

sudo nano /etc/apache2/sites-available/mautic.conf

<VirtualHost *:80>
     ServerAdmin [email protected]
     ServerName loudmonitor.ga
     ServerAlias www.loudmonitor.ga

     DocumentRoot /var/www/html/mautic

     <Directory /var/www/html/mautic/>
        Options +FollowSymlinks
        AllowOverride All
        Require all granted
     </Directory>

     ErrorLog ${APACHE_LOG_DIR}/error.log
     CustomLog ${APACHE_LOG_DIR}/access.log combined

RewriteEngine on
RewriteCond %{SERVER_NAME} =www.loudmonitor.ga [OR]
RewriteCond %{SERVER_NAME} =loudmonitor.ga
RewriteRule ^ https://www.loudmonitor.ga [END,NE,R=permanent]
</VirtualHost>

domain www and non www pointing to differents paths

I followed this tutorial to install mautic on my Digital Ocean droplet.

When i access the domain with www, eg: www.loudmonitor.ga the mautic opens. but when i access loudmonitor.ga, the apache page opens.

What i made wrong and how can i fix this?

PS: I used 'lets encrypt' to configure SSL on www.loudmonitor.ga

sudo nano /etc/apache2/sites-available/mautic.conf

<VirtualHost *:80>
     ServerAdmin [email protected]
     ServerName loudmonitor.ga
     ServerAlias www.loudmonitor.ga

     DocumentRoot /var/www/html/mautic

     <Directory /var/www/html/mautic/>
        Options +FollowSymlinks
        AllowOverride All
        Require all granted
     </Directory>

     ErrorLog ${APACHE_LOG_DIR}/error.log
     CustomLog ${APACHE_LOG_DIR}/access.log combined

RewriteEngine on
RewriteCond %{SERVER_NAME} =www.loudmonitor.ga [OR]
RewriteCond %{SERVER_NAME} =loudmonitor.ga
RewriteRule ^ https://www.loudmonitor.ga [END,NE,R=permanent]
</VirtualHost>

Apache server on macbook

I am trying to set up back all my config on my macbook, as I was using the built in server from symfony before, but I now need apache/mysql/phpmyadmin.

The basic thing I see from all the websites is just do: - "sudo apachectl restart", then go to "localhost" and i'm supposed to see the "it works" page.

I don't, just having "this website is inaccessible".

I replace my httpd.conf for another one i found online (kept the backup), nothing changes.. What's wrong ? I have no idea where to start.

Apache server on macbook

I am trying to set up back all my config on my macbook, as I was using the built in server from symfony before, but I now need apache/mysql/phpmyadmin.

The basic thing I see from all the websites is just do: - "sudo apachectl restart", then go to "localhost" and i'm supposed to see the "it works" page.

I don't, just having "this website is inaccessible".

I replace my httpd.conf for another one i found online (kept the backup), nothing changes.. What's wrong ? I have no idea where to start.

python 3.4 mod_wsgi error installing

I'm having a heck of a time trying to install mod_wsgi for apache 2.4 / python 3.4 right now. I've been looking at some other answers but don't seem to be helping. I set up a virtual environment and attempted:

pip install mod_wsgi

to start the process, but I keep getting an error:

Failed building wheel for mod-wsgi building 'mod_wsgi.server.mod_wsgi' extension error: Microsoft Visual C++ 10.0 is required. Get it with "Microsoft Windows SDK 7.1": www.microsoft.com/download/details.aspx?id=8279

Some people mentioned the easiest remedy is to install the visual studio community edition, but I already have Visual Studio 2017 installed. I also checked my installations and I have the Microsoft Visual C++ 2010 x64 and x86 Redistirbutables installed.

edit: I also attempted to go to the link that was provided and install the windows sdk, after which there was still no fix

Edit 2:

Path environment variables:

E:\platforms\python3.4.4\;
E:\platforms\python3.4.4\Scripts;
C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;
E:\platforms\jdk8u172\bin;
C:\Program Files\Microsoft MPI\Bin\;
E:\platforms\python3.6.5\Scripts\;
E:\platforms\python3.6.5;
%SystemRoot%\system32;
%SystemRoot%;
%SystemRoot%\System32\Wbem;
%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;
E:\Git\cmd;
E:\Git\mingw64\bin;
E:\Git\usr\bin;
C:\Program Files\dotnet\;
C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;
C:\Program Files (x86)\GtkSharp\2.12\bin;
C:\Program Files (x86)\Microsoft Emulator Manager\1.0\;
E:\TortoiseGit\bin;
%GROOVY_HOME%\bin;
%SYSTEMROOT%\System32\OpenSSH\;
E:\platforms\node10.1.0\;
E:\IDE\vs2017\VC\Auxiliary\Build;