The Configuring Virtual Host in Tomcat topic introduces how to define a Virtual Host in the Geronimo's config.xml
file so that applications can be deployed to specific hosts ( Virtual Hosts) with a minimal configuration on the application deployment plans side. However, the need to define Virtual Hosts at the server level ( config.xml
) only applies to Geronimo with Tomcat distributions.
For the Jetty distribution of Apache Geronimo, configuring Virtual Host is dramatically simpler.
In this topic, the HelloWorld Web sample application, covered in the Quick start - Apache Geronimo for the impatient section, is used as an example. You can use the following steps to create the HelloWorld application and define a virtual host in Geronimo with Jetty:
app_home
directory somewhere in the file system, from now on we will reference this location as <app_home>
.HelloWorld.jsp
file in the <app_home>
directory and paste the following content to the file.
WEB-INF
directory under <app_home>
.web.xml
file in the <app_home>\WEB-INF
directory and paste the following content to the file.
geronimo-web.xml
file in the <app_home>\WEB-INF
directory and paste the following content to the file.
<virtual-host>virtualhost1.com</virtual-host>
. This is all you need to define a virtual host in Geronimo with Jetty.
To deploy this application, you can use the --inPlace option from the deployer tool so that you do not need to package the application nor copy it anywhere else. Run the following command:
The following information will be displayed in your command window:
Note that even when the successful deployment message on screen shows that the application has been deployed to the http://XYZ:8080/hello host, the application will only be accessible via the virtual host previously defined in the <virtual-host> tag on the geronimo-web.xml
deployment plan.
Bookmark this on Delicious Digg this | Privacy Policy - Copyright © 2003-2013, The Apache Software Foundation, Licensed under ASL 2.0. |