You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Luis Daniel Alvarez <da...@enet.cu> on 2003/04/22 20:14:08 UTC
Fw: configuration problem with tomcat and apache
Hi everyone
This is my first time with tomcat.
Bellow you can see my configuration files.
I want to connect Apache and Tomcat but when I use this configuration is imposible to get http://www.myserver.com, always appear my Apache default home page.
May be something is wrong on this configuration, somebody can help me?
Thanks in advance
Daniel Alvarez
System OS: Red Hat 8.0
Apache/2.0.45
/opt/local/apache2/conf/httpd.conf
### httpd.conf file #####
ServerRoot "/opt/local/apache2"
Listen 80
ServerName my.server.net
DocumentRoot "/opt/local/apache2/htdocs
DirectoryIndex index.html index.html.var index.jsp
# jk conf
LoadModule jk2_module modules/mod_jk2.so
# Virtual host configuration
NameVirtualHost *
<VirtualHost *>
ServerName www.myserver.com
ServerAlias myserver.com
DocumentRoot /var/www/virtuals/myserver
ErrorLog logs/myserver_error.log
CustomLog logs/myserver_access.log common
<Location "/*.jsp">
JkUriSet worker ajp13:localhost:8009
</Location>
</VirtualHost>
### httpd.conf file (the end) #####
/opt/local/apache2/conf/workers2.properties
### workers2.properties file #####
# only at beginnin. In production uncomment it out
[logger.apache2]
level=DEBUG
[shm]
file=/opt/local/apache2/logs/shm.file
size=1048576
# Example socket channel, override port and host.
[channel.socket:localhost:8009]
port=8009
host=127.0.0.1
# define the worker
[ajp13:localhost:8009]
channel=channel.socket:localhost:8009
# Uri mapping
[uri:www.myserver.com/*.jsp]
worker=ajp13:localhost:8009
### workers2.properties file (the end) #####
Jakarta-tomcat-4.1.24
/opt/jakarta-tomcat-4.1.24/conf/server.xml
### server.xml file ####
<Server port="8005" shutdown="SHUTDOWN" debug="0">
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
debug="0"/>
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"
debug="0"/>
<GlobalNamingResources>
<Environment name="simpleValue" type="java.lang.Integer" value="30"/>
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved">
</Resource>
<ResourceParams name="UserDatabase">
<parameter>
<name>factory</name>
<value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
</parameter>
<parameter>
<name>pathname</name>
<value>conf/tomcat-users.xml</value>
</parameter>
</ResourceParams>
</GlobalNamingResources>
<Service name="Tomcat-Apache">
<Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
port="8009" minProcessors="5" maxProcessors="75"
enableLookups="true" redirectPort="8443"
acceptCount="10" debug="0" connectionTimeout="0"
useURIValidationHack="false"
protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"/>
<Engine name="Apache" defaultHost="my.server.net" debug="0">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="catalina_log." suffix=".txt"
timestamp="true"/>
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
debug="0" resourceName="UserDatabase"/>
<Host name="my.server.net" debug="0" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<Logger className="org.apache.catalina.logger.FileLogger"
directory="logs" prefix="localhost_log." suffix=".txt"
timestamp="true"/>
<Context path="/examples" docBase="examples" debug="0"
reloadable="true" crossContext="true">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="localhost_examples_log." suffix=".txt"
timestamp="true"/>
<Ejb name="ejb/EmplRecord" type="Entity"
home="com.wombat.empl.EmployeeRecordHome"
remote="com.wombat.empl.EmployeeRecord"/>
<Environment name="maxExemptions" type="java.lang.Integer"
value="15"/>
<Parameter name="context.param.name" value="context.param.value"
override="false"/>
<Resource name="jdbc/EmployeeAppDb" auth="SERVLET"
type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/EmployeeAppDb">
<parameter><name>username</name><value>sa</value></parameter>
<parameter><name>password</name><value></value></parameter>
<parameter><name>driverClassName</name>
<value>org.hsql.jdbcDriver</value></parameter>
<parameter><name>url</name>
<value>jdbc:HypersonicSQL:database</value></parameter>
</ResourceParams>
<Resource name="mail/Session" auth="Container"
type="javax.mail.Session"/>
<ResourceParams name="mail/Session">
<parameter>
<name>mail.smtp.host</name>
<value>localhost</value>
</parameter>
</ResourceParams>
<ResourceLink name="linkToGlobalResource"
global="simpleValue" type="java.lang.Integer"/>
</Context>
</Host>
<Host name="www.myserver.com" appBase="/var/www/virtuals/myserver">
<Alias>myserver.com</Alias>
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs"
prefix="myserver_access_log."
suffix=".txt"
pattern="combined"
resolveHosts="false"/>
<Logger className="org.apache.catalina.logger.FileLogger"
directory="logs"
prefix="myserver_log."
suffix=".txt"
timestamp="true"
verbosity="4"/>
<Context path="" docBase="" debug="0"
reloadable="true" crossContext="true">
</Context>
</Host>
</Engine>
</Service>
### the end ####
/opt/jakarta-tomcat-4.1.24/conf/jk/jk2.properties
### jk2.properties file ####
#(unixSocket is available as well)
handler.list=apr,channelSocket,request
channelSocket.port=8009
apr.NativeSo=/opt/local/apache2/modules/jkjni.so
### jk2.properties file (the end) ####