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

I am trying to set-up a proper configuration to have Apache serve some static html pages and to pass other requests for dynamic pages to Tomcat. So far, I have installed Apache2 and Tomcat6 successfully.

I am trying to follow the instructions available here. I am stuck at step 4. There is a 000-default file in my /etc/apache2/sites-enabled directory. The content is:

<VirtualHost *:80>
        ServerAdmin webmaster@localhost

        DocumentRoot /var/www
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog /var/log/apache2/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /var/log/apache2/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>

The instructions I am following say:

In your /etc/apache2/sites-enabled/ dir find the vhost you want to use tomcat and edit it, at the end of the vhost declaration put:

#Everything under root goes to tomcat
JkMount  /* worker1
#html files should be served by apache2
JkUnMount /*.html worker1

I would like to have tomcat handle requests to http://mywebsite.com/MyTomcatApp1/ or http://mywebsite.com/MyTomcatApp2/ (dynamic content) and all requests to http://mywebsite.com/ to be handled by Apache (static content).

How should I configure 000-default? I don't really understand the logic of JkMount and JkUnMount... Thanks.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Assuming you've followed the rest of the instructions about creating workers.properties and loading the mod_jk module, you just need lines like:

JkMount /MyTomcatApp1/* worker1
JkMount /MyTomcatApp2/* worker1

They need to be somewhere in your Apache config that will be read for the mywebsite.com domain. That may be 000-default or it may be somewhere else -- only you know your own Apache configuration.

share|improve this answer
    
Ok, so can I assume that anything that does not fall under /MyTomcatApp1/* or /MyTomcatApp2/* will be served by Apache2 for mywebsite.com? –  JVerstry Sep 20 '11 at 14:40

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.