Apache tomcat jsf php

Discussion in 'Server Operation' started by ripit, Jun 20, 2008.

  1. ripit

    ripit New Member


    I've installed apache and tomcat with mod_jk and now I wonder how to get it to work with index.php files.

    I have jsf applications up and running on the server and I also got php applications to work but it won't work if I don't type index.php.

    This is my JKMount config in httpd.conf.

    JkUnMount /*.php worker1
    JkUnMount /*.html worker1
    JkUnMount /*.jpg worker1
    JkMount /* worker1
    JkMount /*/servlet/* worker1
    JkMount /*.war worker1
    and here is my workers.properties:

    # Define 1 real worker using ajp13
    # Set properties for worker1 (ajp13)
    I had to do JkMount /* to get jsf to work. is there any other way to configure this:

  2. falko

    falko Super Moderator ISPConfig Developer

    So PHP files are working except for index.php?
    Any errors in Apache's error log? Any errors in your browser when you call index.php?
  3. ripit

    ripit New Member

    No everything in php works fine if i type:


    but not if I type:


    when I type the latter i shows the php code for index.php. This I can stop.

    This is of course because tomcat can't parse php, but is there a way to stop apache to call tomcat. Can apache in someway find out what filetype it is before it passes it forward to tomcat.

    I wan't the JkMount /* because otherwise jsf won't work.

  4. ripit

    ripit New Member

    I found JkOptions ForwardDirectories but I can't figure out how to get it to work. If I understand it correct everything that apache don't recognize or if an index file doesn't exist then it is forwarded to tomcat.
    This would solve my problem whit jsf. So any help in how to get it to work is appreciated.

  5. ripit

    ripit New Member

    Hi again

    I think I solved it but not with JkOptions ForwardDirectories because I didn't know how.

    I do:

    DirectoryIndex index.html index.php *.jsp
    and then i forward all jsp to tomcat with this:

    JkMount /*.jsp worker1
    and then I have to stop access to WEB-INF directory like this:

    <Directory ~ "/WEB-INF" >
        AllowOverride None
        Deny from all
    This seems to solve my problems with JSF.

    If anyone got any other suggestions or know about any security issues with this solution I would be glad to know about them.

    Thanks in advance


Share This Page