Ubuntu – Apache2 mod_proxy_ajp with Tomcat leads to 500 Internal Server Error

apache-2.4mod-proxy-ajptomcat7Ubuntuubuntu-14.04

I am currently deploying a cloud server instance running Ubuntu 14.04. I have installed the LAMP Stack as well as Tomcat 7 Server. I want to run a Java Based App from this server and therefore any request that comes to my server, i.e www.example.com/app, should load my app.

However, it's been 10 hours now and I am still receiving a 500 Internal Server Error. The default virtual hosts file located in /etc/apache2/sites-available/000-default.conf is:

<VirtualHost *:80>
        ServerName example.com
        ServerAlias www.example.com
        ServerAdmin user@postmaster

        DocumentRoot /var/www/html

        <Proxy *>
          Require all granted
          AddDefaultCharset Off
          Order deny,allow
          Allow from all
        </Proxy>

        ProxyRequests Off
        ProxyPass /app ajp://localhost:8009/app/
        ProxyPassReverse /app ajp://localhost:8009/app/

        ErrorLog /var/log/apache2/ajp.error.log
        CustomLog /var/log/apache2/ajp.log combined
</VirtualHost>

When I go straight to my app at example.com:8080 it displays fine. Am I missing something? I have read a lot that I have to have enable proxy and proxy_http and I can confirm they are all loaded. Am I missing something? Could it be a permissions issue?

I hope it helps to know I installed Tomcat from the binary and not using aptitude. I feel it's easier to manage that way.

I am newbie to Linux Server Administration and I appreciate any help from anyone out there. Thank you!

Best Answer

How about removing the 2 proxy lines you have and trying

<Location /app>
  ProxyPass ajp://localhost:8009/app
  ProxyPassReverse ajp://localhost:8009/app
</Location>

Anything in your Apache logs that could help?

Related Topic