Web Server plugin
The Deploy Web Server plugin provides the deployment of web content and web server configuration to a web server.
Features
- Deploy to Apache and IHS web servers
-
Deploy and undeploy web server artifacts:
- Web content (HTML pages, images, and others)
- Virtual host configuration
- Any configuration fragment
- Start, stop, and restart web servers as control tasks
Using the www.ApacheVirtualHost
configuration item
The following example is a manifest snippet that shows how to include web content and a virtual host in a deployment package. The web content CI refers to a folder, html
, included in the deployment package.
<udm.DeploymentPackage version="2.0" application="PetClinic-ear" >
<jee.Ear name="PetClinic" file="PetClinic-2.0.ear" />
<www.WebContent name="PetClnic-html" file="html" />
<www.ApacheVirtualHostSpec name="PetClinic-vh">
<host>*</host>
<port>8080</port>
</www.ApacheVirtualHostSpec>
</udm.DeploymentPackage>
Using the www.ApacheConfFragment
configuration item
Defining a new fragment to deploy to the Apache configuration consists of two steps:
- Define the type of configuration fragment and its properties.
- Provide a template for the configuration fragment implementation. As a default, the script searches for
DEPLOYIT_HOME/ext/www/apache/${deployed.type}.conf.ftl
.
Example:
-
Define an
ApacheCurrentDate
type inDEPLOYIT_HOME/ext/synthetic.xml
:<type type="www.ApacheProxyPassSetting" extends="www.ApacheConfFragment" deployable-type="www.ApacheProxyPassSpec"> <generate-deployable type="www.ApacheProxyPassSpec" extends="generic.Resource" /> <property name="from" /> <property name="to" /> <property name="options" required="false" default="" /> <property name="reverse" kind="boolean" required="false" default="false" /> </type>
-
Create
www.ApacheCurrentDate.conf.ftl
inDEPLOYIT_HOME/ext/www/apache
:--- start www.ApacheProxyPassSetting.conf.ftl --- ProxyPass ${deployed.from} ${deployed.to} <#if (deployed.options?has_content)>${deployed.options}</#if> <#if (deployed.reverse)> ProxyPassReverse ${deployed.from} ${deployed.to} </#if> --- end www.ApacheProxyPassSetting.conf.ftl ---