Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To make this configuration work you need to ensure that Geronimo can resolve the virtual host name you are about to define. Depending on your network configuration you can add an entry to you DNS, an alias to the Geronimo server IP. Alternatively you can add an entry to the local host table, each operating system has it's own way to define a local host table. For example Windows will have %SystemRoot%\system32\drivers\etc\hosts

Define Virtual host

Code Block
xml
xml
borderStylesolid
titleExcerpt from config.xml

...
<module name="geronimo/tomcat/1.1/car">
<gbean gbeanInfo="org.apache.geronimo.tomcat.HostGBean" name="geronimo/tomcat/1.1/car?ServiceModule=geronimo/tomcat/1.1/car,j2eeType=Host,name=TomcatVirtualHost">
<attribute name="className">org.apache.catalina.core.StandardHost</attribute>
<attribute name="initParams">name=host1.com
       appBase=
       workDir=work</attribute>
</gbean>
...

Declare the virtual host in the deployment plan

Code Block
xml
xml
borderStylesolid
titlegeronimo-web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1">
	<environment>
		<moduleId>
			<groupId>sample.applications</groupId>
			<artifactId>HelloWorldApp</artifactId>
			<version>1.1</version>
		</moduleId>		
	</environment>
  	<context-root>/hello</context-root>
	<host>host1.com</host>
</web-app>

Deploy the application