Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am tasked with installing a new system to take over the job of an old system. The old system is a Ubuntu installation running Apache and Tomcat, as well as a few other services. The new system will be a Debian Squeeze, kept up to date with program- and security updates.

I am not by any stretch of the imagination an expert in the finer points of either Apache and Tomcat, but I thought I understood that for these two to work together you needed a separate application/module called mod_jk. Most instructions on the net seem to agree with me.

However, checking the old installation, I cannot seem to find any indication as to where mod_jk comes into play. I expected something like

JkMount /* ajp13_worker

in any configuration file for Apache, preferrable in any of the /etc/apache2/sites-available/* ones.

I have attached the /etc/apache2/sites-available/ourapp.oursite.tld.conf:

NameVirtualHost ourapp.oursite.tld:443
<VirtualHost ourapp.oursite.tld:443>
        ServerName ourapp.oursite.tld
        ServerAdmin admin@oursite.tld

        ErrorLog /var/log/apache2/ourapp.oursite.tld_ssl_error_log
        TransferLog /var/log/apache2/ourapp.oursite.tld_ssl_access_log

        SSLEngine on
        SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
        SSLCertificateFile /etc/apache2/ssl/servernew-public.key
        SSLCertificateKeyFile /etc/apache2/ssl/servernew-private.key

        <FilesMatch "\.(cgi|shtml|phtml|php3?)$">
            SSLOptions +StdEnvVars
        </FilesMatch>
        <Directory "/tmp">
            SSLOptions +StdEnvVars
        </Directory>

        SetEnvIf User-Agent ".*MSIE.*" \
           nokeepalive ssl-unclean-shutdown \
          downgrade-1.0 force-response-1.0

        CustomLog /var/log/apache2/ourapp.oursite.tld_ssl_request_log \
            "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

  DirectoryIndex index.jsp

  Redirect /webapps https://ourapp.oursite.tld/ourapp/
  Redirect /abs https://ourapp.oursite.tld:81
  Redirect / https://ourapp.oursite.tld/ourapp/

        ProxyRequests Off
        #ProxyVia On
        #ProxyPreserveHost On
        ProxyPass /ourapp http://127.0.0.1:8180/ourapp
        ProxyPassReverse /ourapp http://127.0.0.1:8180/ourapp
   ProxyPass /pbsEasyRequester http://127.0.0.1:8180/pbsEasyRequester
        ProxyPassReverse /pbsEasyRequester http://127.0.0.1:8180/pbsEasyRequester
   ProxyPass /ordertracking http://127.0.0.1:8180/ordertracking
        ProxyPassReverse /ordertracking http://127.0.0.1:8180/ordertracking

         <IfModule mod_deflate.c>
     #SetOutputFilter DEFLATE
   </IfModule>
</VirtualHost>

NameVirtualHost ourapp.oursite.tld:80
<VirtualHost ourapp.oursite.tld:80>
        ServerName ourapp.oursite.tld
        ErrorLog /var/log/apache2/ourapp.oursite.tld_error_log
        TransferLog /var/log/apache2/ourapp.oursite.tld_access_log

  Redirect /webapps https://ourapp.oursite.tld/ourapp/
  Redirect /abs https://ourapp.oursite.tld:81
  Redirect / https://ourapp.oursite.tld/ourapp/

        ProxyRequests Off
        #ProxyVia On
        #ProxyPreserveHost On
  ProxyPass /ourapp http://127.0.0.1:8180/ourapp
        ProxyPassReverse /ourapp http://127.0.0.1:8180/ourapp
        ProxyPass /pbsEasyRequester http://127.0.0.1:8180/pbsEasyRequester
        ProxyPassReverse /pbsEasyRequester http://127.0.0.1:8180/pbsEasyRequest
        ProxyPass /ordertracking http://127.0.0.1:8180/ordertracking
        ProxyPassReverse /ordertracking http://127.0.0.1:8180/ordertracking
</VirtualHost>

NameVirtualHost ourapp.oursite.tld:81
<VirtualHost ourapp.oursite.tld:81>
  ServerName ourapp.oursite.tld
  ErrorLog /var/log/apache2/ourapp.oursite.tld_joomla_error_log
  TransferLog /var/log/apache2/ourapp.oursite.tld_joomla_access_log

  DocumentRoot /var/www/joomla

        SSLEngine on
        SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
        SSLCertificateFile /etc/apache2/ssl/servernew-public.key
        SSLCertificateKeyFile /etc/apache2/ssl/servernew-private.key
        #SSLCACertificateFile /etc/apache2/ssl/ourapp.oursite.tld.crt
        <FilesMatch "\.(cgi|shtml|phtml|php3?)$">
            SSLOptions +StdEnvVars
        </FilesMatch>
        <Directory "/tmp">
            SSLOptions +StdEnvVars
        </Directory>
</VirtualHost>

I can see that it states that the default file is index.jsp, but I cannot figure our how this system knows that Tomcat is to be used.

I'd appreciate it if you give me a hint. I can post any configuration file on request.

Thank you.

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

From the look of things, I would guess that it's the mod_proxy sections in the middle:

ProxyPass /ourapp http://127.0.0.1:8180/ourapp
ProxyPassReverse /ourapp http://127.0.0.1:8180/ourapp
ProxyPass /pbsEasyRequester http://127.0.0.1:8180/pbsEasyRequester
ProxyPassReverse /pbsEasyRequester http://127.0.0.1:8180/pbsEasyRequest
ProxyPass /ordertracking http://127.0.0.1:8180/ordertracking
ProxyPassReverse /ordertracking http://127.0.0.1:8180/ordertracking

If you search the Tomcat server configuration file (server.xml I think) for "8180", you'll probably find a "HTTP connector" entry in there. In that case, Apache is actually talking to Tomcat's built in HTTP web server.

share|improve this answer
    
Thank you. I'm pretty sure this is the solution. Apache and Tomcat are not actually linked. Apache just redirects all requests to our application to port 8180, then Tomcat picks the request up and handles it. I found a Connector entry in /etc/tomcat/server.xml for this port. Cheers! –  Dabu Jan 18 '12 at 14:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.