In the Configuring Virtual Host in Tomcat section we describe how to define a Virtual Host in the Geronimo's config.xml
so applications can be deployed to specific hosts ( Virtual Hosts) with a minimal configuration on the application deployment plans side. 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 this configuration is dramatically simpler.
In this example we continue to use the HelloWorld Web sample application covered in the Quick start - Apache Geronimo for the impatient section. Here is a summary of steps
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.
WEB-INF
directory under <app_home>
.web.xml
file in the <app_home>\WEB-INF
directory and paste the following content.
geronimo-web.xml
file in the <app_home>\WEB-INF
directory and paste the following content.
If you compare this deployment plan with the one described in the Quick start - Apache Geronimo for the impatient section you will note that only one line has been added, that is <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 you wont need to package the application nor copy it anywhere else. Just run the following command:
<geronimo_home>\bin\deploy --user system --password manager deploy --inPlace <app_home>
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-2011, The Apache Software Foundation, Licensed under ASL 2.0. |