0

I have an internal web app hosted by Tomcat 7 running on Windows Server 2008 R2. Users access the site from this URL: http://servername:8080/ssc. I'd rather users access the site from here instead: http://fortify

By default, Tomcat uses port 8080:

    <Connector port="8080" protocol="HTTP/1.1"
           connectionTimeout="20000"
           redirectPort="8443" />

My initial thought was to update that to use port 80 or would it be better to add a connector?

Or would it be better still to have a second service as mentioned here?

Community
  • 1
  • 1
Steve L.
  • 1,098
  • 13
  • 23
  • 1
    The referred link is about running two or more Tomcat instances or running on different port whereas you want to run your Tomcat application without port. I strongly recommend to use mod_jk connector to achieve you this goal. – Ghayel Nov 24 '15 at 21:08
  • 1
    this http://serverfault.com/questions/256195/apache-2-2-17-tomcat-7-on-windows-server could help you. this link is also helpful http://www.anchor.com.au/hosting/dedicated/tomcat_with_apache_on_windows_x64 – Ghayel Nov 24 '15 at 21:11
  • Doesn't mod_jk require the Apache web server? I'm not opposed to installing it, but for my implementation I only have Tomcat 7. – Steve L. Nov 25 '15 at 14:22

1 Answers1

0

Thanks to guidance from Ghayel I now have this working! Here's how to do it:

  1. Install Apache
  2. Install the mod_jk connector into the Apache modules folder
  3. Create a workers.properties file with these lines and drop it into the Tomcat conf folder: worker.list=fortify worker.fortify.port=8009 worker.fortify.host=fortifytest worker.fortify.type=ajp13

  4. Modify the Apache httpd.conf by adding these lines to the very end of the file: LoadModule jk_module modules/mod_jk.so JkWorkersFile "c:/apache/tomcat/conf/workers.properties" JkLogFile "c:/apache/tomcat/conf/from_apache_mod_jk.log" JkLogLevel info JkLogStampFormat "[%a %b %d %H:%M:%S %Y]" <VirtualHost fortifytest:80> ServerName fortifytest RewriteEngine on RewriteRule ^/$ /ssc [PT,L] JkMount /* fortify ErrorLog "logs/fortifytest-error.log" CustomLog "logs/fortifytest-access.log" common </VirtualHost>

  5. Restart Tomcat then restart Apache

Now I can use http://fortifytest instead of http://servername:8080/ssc.

EDIT: The PT (pass-through) flag is very crucial here. Without that flag the re-write rule did not function properly for my scenario.

Steve L.
  • 1,098
  • 13
  • 23