Ok, I've changed the server.xml file so that <engine> and at least one <host> reference "localhost". The ultimate goal is to have Tomcat support multiple individual web applications and not have multiple context configurations for one host.
Before, when the server.xml file was configured to use the server's ip address I was able to get the following URL to work: http://66.80.144.156/dynamichostings Now that no longer works since I've changed it to use "localhost". I can only get this URL to work: http://66.80.144.156:8080/dynamichostings Ultimately I'm trying to get the following to work: http://dev.dynamichostings.com and several other web applications. This is the current server.xml file I'm using.... <!-- A "Server" is a singleton element that represents the entire JVM, which may contain one or more "Service" instances. The Server listens for a shutdown command on the indicated port. Note: A "Server" is not itself a "Container", so you may not define subcomponents such as "Valves" or "Loggers" at this level. --> <Server port="8005" shutdown="SHUTDOWN" debug="0"> <!-- Comment these entries out to disable JMX MBeans support --> <!-- You may also configure custom components (e.g. Valves/Realms) by including your own mbean-descriptor file(s), and setting the "descriptors" attribute to point to a ';' seperated list of paths (in the ClassLoader sense) of files to add to the default list. e.g. descriptors="/com/myfirm/mypackage/mbean-descriptor.xml" --> <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" debug="0"/> <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" debug="0"/> <!-- Global JNDI resources --> <GlobalNamingResources> <!-- 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" 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> <!-- A "Service" is a collection of one or more "Connectors" that share a single "Container" (and therefore the web applications visible within that Container). Normally, that Container is an "Engine", but this is not required. Note: A "Service" is not itself a "Container", so you may not define subcomponents such as "Valves" or "Loggers" at this level. --> <!-- 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. By default, a non-SSL HTTP/1.1 Connector is established on port 8080. You can also enable an SSL HTTP/1.1 Connector on port 8443 by following the instructions below and uncommenting the second Connector entry. SSL support requires the following steps (see the SSL Config HOWTO in the Tomcat 5 documentation bundle for more detailed instructions): * If your JDK version 1.3 or prior, download and install JSSE 1.0.2 or later, and put the JAR files into "$JAVA_HOME/jre/lib/ext". * Execute: %JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA (Windows) $JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA (Unix) with a password value of "changeit" for both the certificate and the keystore itself. By default, DNS lookups are enabled when a web application calls request.getRemoteHost(). This can have an adverse impact on performance, so you can disable it by setting the "enableLookups" attribute to "false". When DNS lookups are disabled, request.getRemoteHost() will return the String version of the IP address of the remote client. --> <!-- Define a non-SSL Coyote HTTP/1.1 Connector on the port specified during installation --> <Connector port="8080" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" redirectPort="8443" acceptCount="100" debug="0" connectionTimeout="20000" disableUploadTimeout="true" /> <!-- Note : To disable connection timeouts, set connectionTimeout value to 0 --> <!-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 --> <!-- <Connector port="8443" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" disableUploadTimeout="true" acceptCount="100" debug="0" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" /> --> <!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 --> <Connector port="8009" enableLookups="false" redirectPort="8443" debug="0" 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" debug="0" 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). --> <!-- You should set jvmRoute to support load-balancing via JK/JK2 ie : <Engine name="Standalone" defaultHost="localhost" debug="0" jvmRoute="jvm1"> --> <!-- Define the top level container in our container hierarchy --> <Engine name="Catalina" defaultHost="localhost" debug="0"> <!-- The request dumper valve dumps useful debugging information about the request headers and cookies that were received, and the response headers and cookies that were sent, for all requests received by this instance of Tomcat. If you care only about requests to a particular virtual host, or a particular application, nest this element inside the corresponding <Host> or <Context> entry instead. For a similar mechanism that is portable to all Servlet 2.4 containers, check out the "RequestDumperFilter" Filter in the example application (the source for this filter may be found in "$CATALINA_HOME/webapps/examples/WEB-INF/classes/filters"). Request dumping is disabled by default. Uncomment the following element to enable it. --> <!-- <Valve className="org.apache.catalina.valves.RequestDumperValve"/> --> <!-- Global logger unless overridden at lower levels --> <Logger className="org.apache.catalina.logger.FileLogger" prefix="catalina_log." suffix=".txt" timestamp="true"/> <!-- Because this Realm is here, an instance will be shared globally --> <!-- This Realm uses the UserDatabase configured in the global JNDI resources under the key "UserDatabase". Any edits that are performed against this UserDatabase are immediately available for use by the Realm. --> <Realm className="org.apache.catalina.realm.UserDatabaseRealm" debug="0" resourceName="UserDatabase"/> <!-- Comment out the old realm but leave here for now in case we need to go back quickly --> <!-- <Realm className="org.apache.catalina.realm.MemoryRealm" /> --> <!-- Define the default virtual host Note: XML Schema validation will not work with Xerces 2.2. --> <!-- Default Host Configuration --> <Host name="localhost" debug="0" appBase="drive:\tomcat5\webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"> <!-- Normally, users must authenticate themselves to each web app individually. Uncomment the following entry if you would like a user to be authenticated the first time they encounter a resource protected by a security constraint, and then have that user identity maintained across *all* web applications contained in this virtual host. --> <!-- <Valve className="org.apache.catalina.authenticator.SingleSignOn" debug="0"/> --> <!-- Access log processes all requests for this virtual host. By default, log files are created in the "logs" directory relative to $CATALINA_HOME. If you wish, you can specify a different directory with the "directory" attribute. Specify either a relative (to $CATALINA_HOME) or absolute path to the desired directory. --> <!-- <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="server_access_log." suffix=".txt" pattern="common" resolveHosts="false"/> --> <!-- Logger shared by all Contexts related to this virtual host. By default (when using FileLogger), log files are created in the "logs" directory relative to $CATALINA_HOME. If you wish, you can specify a different directory with the "directory" attribute. Specify either a relative (to $CATALINA_HOME) or absolute path to the desired directory.--> <Logger className="org.apache.catalina.logger.FileLogger" directory="logs" prefix="server_log." suffix=".txt" timestamp="true"/> </Host> <!-- Dynamic Hostings Configuration --> <Host name="dev.dynamichostings.com" debug="0" appBase="drive:\www\dev_dynamichostings" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"> <!-- Normally, users must authenticate themselves to each web app individually. Uncomment the following entry if you would like a user to be authenticated the first time they encounter a resource protected by a security constraint, and then have that user identity maintained across *all* web applications contained in this virtual host. --> <!-- <Valve className="org.apache.catalina.authenticator.SingleSignOn" debug="0"/> --> <!-- Access log processes all requests for this virtual host. By default, log files are created in the "logs" directory relative to $CATALINA_HOME. If you wish, you can specify a different directory with the "directory" attribute. Specify either a relative (to $CATALINA_HOME) or absolute path to the desired directory. --> <!-- <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="server_access_log." suffix=".txt" pattern="common" resolveHosts="false"/> --> <!-- Logger shared by all Contexts related to this virtual host. By default (when using FileLogger), log files are created in the "logs" directory relative to $CATALINA_HOME. If you wish, you can specify a different directory with the "directory" attribute. Specify either a relative (to $CATALINA_HOME) or absolute path to the desired directory.--> <Logger className="org.apache.catalina.logger.FileLogger" directory="logs" prefix="dynamichostings." suffix=".txt" timestamp="true"/> </Host> </Engine> </Service> </Server> -----Original Message----- From: Adrian Lanning [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 23, 2004 9:04 AM To: Tomcat Users List Subject: Re: Configuration Help As I understand it, you should not be using the IP address in server.xml except to limit the connector to a specific IP address if you don't want Tomcat to answer requests for other IPs. In production you can use localhost for a <host> and use your domain as an alias. Or you can get rid of localhost altogether and just set up your domain as a host. We need to set up a control so follow the steps I recommended in my last email and post your results to the list. Also, please post your server.xml file. Adrian ----- Original Message ----- From: "LILES, DAVID (CONTRACTOR)" <[EMAIL PROTECTED]> To: "Tomcat Users List" <[EMAIL PROTECTED]> Sent: Tuesday, March 23, 2004 9:42 AM Subject: RE: Configuration Help The server.xml file is using the default port settings (8080 and 8009) and instead of localhost or 127.0.0.1, I'm using the server's ip address. Even though this is a web server, should I have the server.xml file configured to use localhost instead of the server's ip address? -----Original Message----- From: Adrian Lanning [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 23, 2004 8:43 AM To: Tomcat Users List Subject: Re: Configuration Help Hmm, Do you have Tomcat set up to listen on port 80? (you shouldn't) Can you get to your webapp correctly using localhost? Try setting up a test host in your server.xml file with name=www.example.com and then edit your hosts file to point 127.0.0.1 to www.example.com. Then try connecting to http://www.example.com:8080/yourWebApp and report your findings. Earlier you said: >>> In the server.xml file the <engine> tag is configured to use the IP address of the server and one <host> tag is set to the IP address. I have a second <host> tag that is set to the URL I want to serve. >>> Do you mean that you've set defaultHost to your IP address? Try setting your <engine>'s defaultHost and your <host>'s name to the domain name: dev.dynamichostings.com Please post your server.xml file. Adrian ----- Original Message ----- From: "LILES, DAVID (CONTRACTOR)" <[EMAIL PROTECTED]> To: "Tomcat Users List" <[EMAIL PROTECTED]> Sent: Tuesday, March 23, 2004 9:10 AM Subject: RE: Configuration Help Thanks for the links below. I've been looking at anything I can find and as far as I can tell, I have IIS configured to support Tomcat. The following link serves the web app I'm trying to configure, but it only serves it from the ip address and not the URL.... http://66.80.144.156/dynamichostings I'm trying to get it to work from this url: http://dev.dynamichostings.com I'm almost 100% positive it has something to do with the server.xml file because if my IIS wasn't configured correctly, the first url example wouldn't work. I've even tried to contact the support people at JBoss but they wouldn't talk with me unless I purchased either a $5K or $10K support package.... This shouldn't be this difficult to get working.... -Dave -----Original Message----- From: Adrian Lanning [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 23, 2004 7:30 AM To: Tomcat Users List Subject: Re: Configuration Help Hi Dave, Did you ever solve this problem? Actually, 400 error is malformed syntax. Basically doesn't tell us much in this situation besides "configuration screwed up". I don't use IIS so don't know how to from first-hand experience. Searching turns up stuff on connecting using jk rather than jk2. Have you tried getting jk to work? Have you looked at: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jk2/jk/iishowto.html Also try: http://www.onjava.com/pub/a/onjava/2002/12/18/tomcat.html hth, Adrian ----- Original Message ----- From: "LILES, DAVID (CONTRACTOR)" <[EMAIL PROTECTED]> To: "Tomcat Users List" <[EMAIL PROTECTED]> Sent: Monday, March 22, 2004 10:15 AM Subject: RE: Configuration Help Adrian, The 400 error is indicating that the page has been moved, server might not be available... blah, blah.... This URL will display the web app I'm working with... http://66.80.144.156/dynamichostings/ But if I try this URL I get the error.... http://dev.dynamichostings.com I think I'm close I just don't know what configuration change I need to make at this point. I've been told that by mapping the isapi_redirector2.dll in IIS it should work.... There has to be someone else who is successfully using IIS and Tomcat 5 out there.... -----Original Message----- From: Adrian Lanning [mailto:[EMAIL PROTECTED] Sent: Monday, March 22, 2004 9:15 AM To: Tomcat Users List Subject: Re: Configuration Help Hey Dave, I'm a little fuzzy on my errors. Is 400 from iis or tomcat? Does tomcat work with the urls in standalone mode? Adrian ----- Original Message ----- From: "LILES, DAVID (CONTRACTOR)" <[EMAIL PROTECTED]> To: "Tomcat Users List" <[EMAIL PROTECTED]> Sent: Monday, March 22, 2004 9:17 AM Subject: Configuration Help For over a week I have been unable to get Tomcat 5 configured with IIS 5. I know the Tomcat server is working because I can get to the management console from the IP address:8080 and the two example web apps are working, both from the IP address:8080/servlet-examle and without the port... I have created a web app instance which I can access from the IP address:8080/webapp and IP address/webapp, but when I attempt to access it from the URL I get a 400 error. In the server.xml file the <engine> tag is configured to use the IP address of the server and one <host> tag is set to the IP address. I have a second <host> tag that is set to the URL I want to serve. Can anyone help explain what I need to do in order to access the web app by the URL? In IIS I have configured the isapi_redirector2.dll at the root server level and in the web app I'm trying to get working I created a virtual directory named "jakarta". I have made all the necessary registry entries required to support the .dll. Thanks, Dave --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
