문제

linux tomcat 7 apache 2.4

We already have tomcat6 and apache2.2 working on this server. I am attempting to get the newer versions running for out next project. Apache2.4 is working and listening on port 1904. Tomcat is working and listening on port 8081. The AJP is set to 8010.

I have compiled mod_jk against the apache server and it created the mod_jk.so file. I copied the file over to the modules folder.

My workers.properties

worker.list=worker3
worker.myworker.type=ajp13
worker.myworker.host=localhost
worker.myworker.port=8010

My http.conf has:

LoadModule jk_module modules/mod_jk.so
<IfModule jk_module>
  Include conf/extra/mod_jk.conf
</IfModule>

The mod_jk.conf is in that directory and contains:

JkWorkersFile conf/workers.properties
JkLogFile logs/mod_jk.log
JkLogLevel info
JkShmFile logs/jk-runtime-status
JkLogStampFormat "[%b %d %Y - %H:%M:%S] "
JkRequestLogFormat "%w %V %T"
JkAutoAlias /usr/local/tomcat7/webapps
JkMountCopy All
JkMount /* worker3
JkUnMount /cgi-bin/* worker3
JkUnMount /htdocs/* worker3

server.xml is:

<?xml version='1.0' encoding='utf-8'?>
<Server port="8015" shutdown="SHUTDOWN">
  <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
  <Listener className="org.apache.catalina.core.JasperListener" />
  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
  <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
  <GlobalNamingResources>
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>
  <Service name="Catalina">
    <Connector port="8081" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8444" />
    <Connector port="8010" protocol="AJP/1.3" redirectPort="8444" />
    <Engine name="Catalina" defaultHost="localhost">
      <Realm className="org.apache.catalina.realm.LockOutRealm">
        <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
               resourceName="UserDatabase"/>
      </Realm>
      <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log." suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" />
      </Host>
    </Engine>
  </Service>
</Server>

I am under the assumption I should be able to goto [server]:1904/examples and get the same thing that I get when I goto [server]:8081/examples.

As another peice of configuration info I do have a xml file in tomcathome/conf/Catalina/localhost named srvc.xml

<Context path="" docBase="/usr/local/tomcat7/web"/>

This works when addressing the tomcat server. Thanks for eyeballing all this and for any help if provided.

도움이 되었습니까?

해결책

Finally, found it with the help of a coworker. The worker.properties needs to look like:

worker.list=worker3
worker.worker3.type=ajp13
worker.worker3.host=localhost
worker.worker3.port=8010

The original had worker.myworker.type and so on.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top