You can configure a web server plug-in so that, when the web server receives an HTTP request for dynamic resources, the request is forwarded to the Liberty profile.
A web server plug-in is used to forward HTTP requests from a supported web server to one or more application servers. The plug-in takes a request and checks the request against configuration data in the plugin-cfg.xml file. The configuration data maps the URI for the HTTP request to the host name of an application server. The web server plug-in then uses this information to forward the request to the application server.
For IBM i, see Installing and configuring web server plug-ins.
For IBM i, install the WCT on your workstation. However, you do not need to install any of the WCT tools. The Java™ SDK installed with the WCT is used to run the jconsole Java utility in a later step.
In the pluginConfiguration element of the server configuration file, you can specify the webserverPort and webserverSecurePort attributes to forward requests from the web server. By default, the value of webserverPort is 80 and the value of webserverSecurePort is 443. However, you might want to change these settings. For example, for Linux and similar platforms, if you are a non-root user, you must use port numbers greater than 1024.
For all configurable attributes of the pluginConfiguration element, see Liberty profile: Configuration elements in the server.xml file.
<server description="new server">
<featureManager>
<feature>localConnector-1.0</feature>
<feature>jsp-2.2</feature>
</featureManager>
<keyStore id="defaultKeyStore" password="{xor}PGY6bW4wOyw+" />
<httpEndpoint id="defaultHttpEndpoint"
host="*"
httpPort="9080">
<tcpOptions soReuseAddr="true" />
</httpEndpoint>
<pluginConfiguration webserverPort="80"
webserverSecurePort="443"
sslKeyringLocation="path/to/sslkeyring"
sslStashfileLocation="path/to/stashfile"
sslCertlabel="definedbyuser"/>
<application type="war" id="myapp" name="myapp" location="${server.config.dir}/apps/myapp.war" />
<application type="war" id="snoop" name="snoop" location="${server.config.dir}/apps/snoop.war" />
</server>
For IBM i, include the restConnector-1.0 feature instead of the localConnector-1.0 feature. For details, see Configuring secure JMX connection to the Liberty profile.
<server description="new server">
<!-- Enable features -->
<featureManager>
<feature>jsp-2.2</feature>
<feature>restConnector-1.0</feature>
</featureManager>
<keyStore id="defaultKeyStore" password="{xor}PGY6bW4wOyw+" />
<httpEndpoint id="defaultHttpEndpoint"
host="*"
httpPort="9080"
httpsPort="9443">
<tcpOptions soReuseAddr="true" />
</httpEndpoint>
<quickStartSecurity userName="testuser"
userPassword="security" />
<pluginConfiguration webserverPort="80"
webserverSecurePort="443"
sslKeyringLocation="path/to/sslkeyring"
sslStashfileLocation="path/to/stashfile"
sslCertlabel="definedbyuser"/>
<application type="war" id="myapp" name="myapp" location="${server.config.dir}/apps/myapp.war" />
<application type="war" id="snoop" name="snoop" location="${server.config.dir}/apps/snoop.war" />
</server>
<Log LogLevel="Error" Name="String\logs\String\http_plugin.log"/>
c:\java\bin\jconsole
"%JAVA_HOME%"\bin\jconsole -J-Djava.class.path="%JAVA_HOME%"\lib\jconsole.jar;"%JAVA_HOME%"\lib\tools.jar;
C:\restClient\restConnector.jar -J-Djavax.net.ssl.trustStore=C:\restClient\key.jks
-J-Djavax.net.ssl.trustStorePassword=Liberty -J-Djavax.net.ssl.trustStoreType=jks
You may also need the following parameter:-J-Dcom.ibm.ws.jmx.connector.client.disableURLHostnameVerification=true
<?xml version="1.0" encoding="UTF-8"?>
<Config ASDisableNagle="false" AcceptAllContent="false" AppServerPortPreference="HostHeader"
ChunkedResponse="false" FIPSEnable="false" IISDisableNagle="false"
IISPluginPriority="High" IgnoreDNSFailures="false" RefreshInterval="60"
ResponseChunkSize="64" SSLConsolidate="false" SSLPKCSDriver="REPLACE"
SSLPKCSPassword="REPLACE" TrustedProxyEnable="false" VHostMatchingCompat="false">
<Log LogLevel="Error" Name=".\logs\defaultServer\http_plugin.log"/>
<Property Name="ESIEnable" Value="true"/>
<Property Name="ESIMaxCacheSize" Value="1024"/>
<Property Name="ESIInvalidationMonitor" Value="false"/>
<Property Name="ESIEnableToPassCookies" Value="false"/>
<Property Name="PluginInstallRoot" Value="."/>
<VirtualHostGroup Name="default_host">
<VirtualHost Name="*:80"/>
<VirtualHost Name="*:443"/>
<VirtualHost Name="*:9080"/>
</VirtualHostGroup>
<ServerCluster CloneSeparatorChange="false" GetDWLMTable="false" IgnoreAffinityRequests="true"
LoadBalance="Round Robin" Name="defaultServer_default_node_Cluster"
PostBufferSize="64" PostSizeLimit="-1" RemoveSpecialHeaders="true"
RetryInterval="60">
<Server CloneID="b564bdc7-2c27-4a4b-ad37-9213c66e60d1" ConnectTimeout="0"
ExtendedHandshake="false" MaxConnections="-1" Name="default_node_defaultServer0"
ServerIOTimeout="900" WaitForContinue="false">
<Transport Hostname="somehost.example.com" Port="9080" Protocol="http"/>
</Server>
<PrimaryServers>
<Server Name="default_node_defaultServer0"/>
</PrimaryServers>
</ServerCluster>
<UriGroup Name="default_host_defaultServer_default_node_Cluster_URIs">
<Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/myapp/*"/>
<Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/snoop/*"/>
</UriGroup>
<Route ServerCluster="defaultServer_default_node_Cluster"
UriGroup="default_host_defaultServer_default_node_Cluster_URIs"
VirtualHostGroup="default_host"/>
</Config>
The plugin-cfg.xml file is generated in the ${server.output.dir} directory.CHGAUT USER(QEJBSVR QTMHHTTP QNOTES) OBJ('plugin_profile_root/config/plugin-cfg.xml') DTAAUT(*RWX)
Find the location of your current plugin-cfg.xml by finding the value that is specified for the WebSpherePluginConfig directive at the end of the configuration file of the HTTP server. For example, <IHS_ROOT>/conf/httpd.conf.
LoadModule was_ap22_module "path/to/mod_was_ap22_http.so"
WebSpherePluginConfig "/opt/IBM/HTTPServer/conf/plugin-cfg.xml"
For IBM i, see Configuring IBM HTTP Server powered by Apache 2.x for instructions about enabling the plug-in within the httpd.conf file.