newbie's question for Configuring Tomcat5 and Apache2 with Virtual Hosts using mod_jk

Discussion in 'HOWTO-Related Questions' started by strephon, Feb 27, 2006.

  1. strephon

    strephon New Member

    Hi, all

    I'm so newbie on Debian box.
    I have been following Popplewell's tutorial for configuring Apache and Tomcat with mod_jk.
    As a newbie, a tiny problem can make me frustrated.
    If anyone remember your newbie's sad memory, please help me.

    I got errors while I tried to do following steps:

    root@myLinux:/usr/src/jakarta-tomcat-connectors-1.2.15-src/jk/native# ./
    rm autom4te.cache
    libtoolize --force --automake --copy
    ./ line 7: libtoolize: command not found
    ./ line 11: aclocal: command not found
    ./ line 13: autoheader: command not found
    automake -a --foreign --copy
    ./ line 15: automake: command not found
    ./ line 17: autoconf: command not found
    rm autom4te.cache


    Can anyone help me out?
    In order to create the custom configure file, what do I have to install on my Debian box before excuting "./" ?

    Popplewell's tutorial url is:

    Thank you in advance.
  2. falko

    falko Super Moderator Howtoforge Staff

    It seems as if you don't have any development tools installed. Please install at least gcc.
  3. strephon

    strephon New Member

    Thank you, Falko.

    But I have installed gcc and other development tools.
    Anyway, after I posted, I figured out.

    After install apache2-threaded-dev package, there was no problem.

    Thank you.
  4. daveyfx

    daveyfx New Member

    This is an excellent "how-to" - quite possibly the best one available.

    As far as configuring Tomcat virtual hosts goes, is it possible to configure a "catch all" in the host field? This would be similar to the Apache <VirtualHost> directive in which one can create a wildcard in the domain, such as * to point to the same document base. Is such a configuration available for Tomcat?
  5. badbug

    badbug New Member

    Tomcat requests hang


    I'm not sure if anyone's still watching this thread but I'd really appreciate any help you can give me with this setup. I followed all the instructions yet any jsp or servlet requests hang. The Java process sits at about 80-100% CPU consumption so I know it's doing something but I can't find anything in the logs.

    <Server port="8005" shutdown="SHUTDOWN">
      <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
      <Listener className="org.apache.catalina.storeconfig.StoreConfigLifecycleListener"/>
      <!-- Global JNDI resources -->
        <!-- Test entry for demonstration purposes -->
        <Environment name="simpleValue" type="java.lang.Integer" value="30"/>
        <!-- Editable user database that can also be used by
             UserDatabaseRealm to authenticate users -->
        <Resource name="UserDatabase" auth="Container"
           description="User database that can be updated and saved"
              pathname="conf/tomcat-users.xml" />
      <!-- Define the Tomcat Stand-Alone Service -->
      <Service name="Catalina">
        <!-- A "Connector" represents an endpoint by which requests are received
             and responses are returned.  Each Connector passes requests on to the
             associated "Container" (normally an Engine) for processing.
        <!-- Define a non-SSL HTTP/1.1 Connector on port 2117 (default 8080) -->
        <Connector port="2117" maxHttpHeaderSize="8192"
                   maxThreads="150" minSpareThreads="5" maxSpareThreads="75"
                   enableLookups="false" redirectPort="8443" acceptCount="100"
                   connectionTimeout="20000" disableUploadTimeout="true" />
        <!-- Define an AJP 1.3 Connector on port 8009 -->
        <Connector port="8009"
                   enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />
        <!-- Define a Proxied HTTP/1.1 Connector on port 8082 -->
        <!-- See proxy documentation for more information about using this. -->
        <Connector port="8082"
                   maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
                   enableLookups="false" acceptCount="100" connectionTimeout="20000"
                   proxyPort="80" disableUploadTimeout="true" />
        <!-- An Engine represents the entry point (within Catalina) that processes
             every request.  The Engine implementation for Tomcat stand alone
             analyzes the HTTP headers included with the request, and passes them
             on to the appropriate Host (virtual host). -->
        <!-- Define the top level container in our container hierarchy -->
        <Engine name="Catalina" defaultHost="localhost">
          <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
          <!-- Define the default virtual host -->
          <Host name="localhost" appBase="webapps"
           unpackWARs="true" autoDeploy="true"
           xmlValidation="false" xmlNamespaceAware="false">
            <Valve className="org.apache.catalina.valves.AccessLogValve"
                     directory="logs"  prefix="localhost_access_log." suffix=".txt"
                     pattern="common" resolveHosts="false"/>
          <!-- -->
          <Host name="" appBase="/var/www/maskeddom/htdocs"
            unpackWARs="true" autoDeploy="true">
            <Valve className="org.apache.catalina.valves.AccessLogValve"
                     directory="/var/www/maskeddom/logs"  prefix="maskeddom_access_log." suffix=".txt"
                     pattern="common" resolveHosts="false"/>
          <Listener className="org.apache.jk.config.ApacheConfig"

            ServerAdmin [email protected]
            DirectoryIndex index.shtml
            DocumentRoot /var/www/maskeddom/htdocs
            <Directory /var/www/maskeddom/htdocs>
                    Options +Includes -Indexes
                    AllowOverride None
                    Order allow,deny
                    allow from all
                    AddType text/html .shtml
                    AddOutputFilter INCLUDES .shtml
            ErrorLog /var/www/maskeddom/logs/error.log
            # Possible values include: debug, info, notice, warn, error, crit,
            # alert, emerg.
            LogLevel warn
            CustomLog /var/www/maskeddom/logs/access.log combined
            ServerSignature On
        # Forward servlets
        JkMount /*/servlet/* worker1
        # Forward JSPs
        JkMount /*.jsp worker1
    The other files I think are OK. Is there something here that's messing things up? Let me know if you need other files.

    I have changed the real public IP to and the domain name to


  6. badbug

    badbug New Member

    Problem sorted


    I've been playing around with the server since my post and I've managed to get things working. I toyed around with the apache2 virtualhosts and restarted the java services and things seem to be ok now.

    Thanks anyways,


Share This Page