Tomcat 6 / apache2 setup for publication server

So, I’ve got the publication server (“frank”) running through tomcat on port 8080. I’ve decided for several reasons to run apache2 as the front-end for our site on port 80 (and possibly 443 if we need SSL in the future).

The problem I’m having is that some pages are not being treated as html when viewed through the apache2 frontend (using firefox or chrome). I know this isn’t a forum for apache2, but I thought maybe someone here might have run into this problem before and would know how to deal with it.

For example, http://frank:8080/Academics/ (note the :8080, so this is going through tomcat) displays properly:

…but when I look at http://frank/Academics/ (note that this is using port 80, so it’s going through apache2) shows the text of the html:

Since it’s working fine through tomcat, I assume the problem is with my apache2 config.

Here’s jk.conf:

<ifmodule mod_jk.c>
        JkWorkersFile /etc/apache2/workers.properties
        JkLogFile /var/log/apache2/mod_jk.log
        JkLogLevel error
</ifmodule>

here’s workers.properties:

workers.tomcat_home=/var/lib/tomcat6
workers.java.home=/usr/lib/jvm/java-6-sun
ps=/
worker.list=default
worker.default.port=8009
worker.default.host=localhost
worker.default.type=ajp13
worker.default.lbfactor=1
worker.loadbalancer.type=lb

and here’s the config for my virtual host:

<virtualhost *:80>
        JkMount /*.jsp default
        ServerName frank.gsw.local
        ServerAlias frank
        ServerAdmin root@gsw.edu
        DocumentRoot /opt/tomcat/gsw.eduapps/ROOT
        ErrorLog /opt/tomcat/gsw.eduapps/logs/error.log
        CustomLog /opt/tomcat/gsw.eduapps/logs/access.log common
        <directory /opt/tomcat/gsw.eduapps/ROOT>
                Options -Indexes
        </directory>

        DirectoryIndex index index.php index.html index.htm index.shtml
</virtualhost>

I think the problem might come from the fact that the individual pages don’t have an extension (like “index” instead of “index.html”), so apache sees the file as a text file and tells the browser to render it as standard text instead of html.

EDIT: nope. That error was caused by something else entirely. It’s still odd that IE will render the html while both Firefox and Chrome will just display the html code.

INTERESTING NEW DEVELOPMENT!

Internet Explod^Hrer tries to render the page, but gives me an error:

Here’s a snippet from the apache2 virtual host log:

[Wed Sep 07 11:17:25 2011] [error] [client 168.18.90.98] File does not exist: /opt/tomcat/gsw.eduapps/ROOT/Rhythmyx, referer: http://frank/Academics/
[Wed Sep 07 11:17:25 2011] [error] [client 168.18.90.98] File does not exist: /opt/tomcat/gsw.eduapps/ROOT/Rhythmyx, referer: http://frank/Academics/
[Wed Sep 07 11:17:25 2011] [error] [client 168.18.90.98] File does not exist: /opt/tomcat/gsw.eduapps/ROOT/Rhythmyx, referer: http://frank/Academics/

I think that may have something to do with it…

Holy crap i got it to work! All I had to do was add a line to my virtual host config:

DefaultType text/html

Now it works beautifully! I guess sometimes all I have to do is tell my troubles to the world and I get motivated to solve the problem myself.

If anyone’s interested, I’ll see if I can get a little howto up and show all my configs and such.