is there a equivalent tomcat valves concept in websphere liberty profile? - websphere-liberty

I have a webapplication which was deployed on tomcat and uses tomcat values, now the application is moving to websphere liberty and am not sure similar concept exists in liberty.
Is there an equivalent tomcat valves concept in websphere libery profile? If yes, how can we achieve ?

You can white/blacklist hostnames and ip addresses on a per-endpoint basis in server.xml. Blocked ones will get a connection reset message.
<httpEndpoint httpPort="19080" httpsPort="19443"
id="defaultHttpEndpoint" tcpOptionsRef="myTcpOptions" host="*"/>
<tcpOptions id="myTcpOptions" hostNameExcludeList="*.foo.com,*.ibm.com" />
There's more info on that here:
https://www.ibm.com/support/knowledgecenter/en/SSAW57_8.5.5/com.ibm.websphere.nd.doc/ae/urun_chain_typetcp.html
If you need different exclusions per app, you can use configure multiple endpoints and map them to applications using virtual hosts.
https://www.ibm.com/support/knowledgecenter/en/SSEQTP_8.5.5/com.ibm.websphere.wlp.doc/ae/cwlp_virtual_hosts.html

Related

Mule application configured with ActiveMQ to be deployed in cloudhub

I have integrated JMS using ActiveMQ in one of my Mule application. I want to deploy it in cloudhub.
Could you please help me for the following queries:
For deploying the application with ActiveMQ configured JMS does it required anything groundwork to be done before deployment? (such as ActiveMQ is to be installed and configured for my CH account?)
For time being I have configured the ActiveMQ which is already installed in OnPremise server and is being used from cloudHub deployed application. Is it a proper or standard way to use externally installed ActiveMQ?
Appreciate the quick and best answer for the above queries.
Thank you,
Best Regards,
Krishna.
you have already installed MQ service on your server side, you can use those credentials to configure your mule MQ adapter through mule properties file same as like you are using with local runtime
e.g.
mq.host=
mq.port=
mq.vhost=
mq.username=
mq.password=
CloudHub will connect to your on premise MQ service. Your approach is correct and no any MQ specific groundwork required.

How to migrate WAS 7.5 to Liberty Profile 8.5?

I am looking to migrate my application to run on Liberty profile 8.5 instead of Websphere Application server 7.5. In this process, I need to do server configuration by setting up LDAP, Database source and JMS. As I am new to Liberty profile, I am looking for help in setting up these. May I get some suggestions from you to complete these settings?
This is a bit broad question, so I'll give you some pointers to documentation to get you started (There is no WAS 7.5, so you probably mean 7.0).
WebSphere Application Server Liberty Profile Guide for Developers - this will give you some basic general information to get you started with Liberty
Data source configuration - basic configuration is quite simple, you define it in server.xml file (you didn't mention which DB you are using, so here is sample with Derby)
<library id="derby">
<fileset dir="${shared.resource.dir}/derby"/>
</library>
<jdbcDriver id="derbyDriver" libraryRef="derby"/>
<dataSource jdbcDriverRef="derbyDriver" jndiName="jdbc/DataSourceJNDI" type="javax.sql.ConnectionPoolDataSource">
<properties.derby.embedded createDatabase="false" databaseName="D:\path\DB"/>
</dataSource>
For more specific information regarding migrating DB2 data sources see
Migrating a DB2 data source to the Liberty profile
LDAP configuration - basic configuration for MS Active Directory
<ldapRegistry id="ldap" realm="SampleLdapADRealm"
host="ldapserver.mycity.mycompany.com" port="389" ignoreCase="true"
baseDN="cn=users,dc=adtest,dc=mycity,dc=mycompany,dc=com"
bindDN="cn=testuser,cn=users,dc=adtest,dc=mycity,dc=mycompany,dc=com"
bindPassword="testuserpwd"
ldapType="Microsoft Active Directory">
<activedFilters
userFilter="(&(sAMAccountName=%v)(objectcategory=user))"&(sAMAccountName=%v)(objectcategory=user))"
groupFilter="(&(cn=%v)(objectcategory=group))"
userIdMap="user:sAMAccountName"
groupIdMap="*:cn"
groupMemberIdMap="memberOf:member">
</activedFilters>
</ldapRegistry>
For more details and other LDAP see Configuring LDAP user registries with the Liberty profile
JMS - as you didn't provide details, if you are acting as JMS server or client and which JMS provider are you using (default or MQ), check this page as starting point for JMS related configuration - Liberty profile: JMS messaging
Application migration - if you want to check, if there are any issues with your application code regarding migration, you can install plugin for Eclipse/RAD -
WebSphere Application Server Migration Toolkit – Liberty Tech Preview which will scan your code for incompatibilities.

How to have Liberty Profile eagerly load apps on startup

Liberty Profile is loading EARs and WARs we deploy to it only when the server receives it's first request. How can we tell it to eagerly load applications upon server start?
We're using the latest 8.5.5 WLP.
Thanks,
Stu
You can configure the WebContainer to fully initialize the application prior to the first request by adding the following to your server.xml:
<webContainer deferServletLoad="false"/>

haproxy - how to share a session between two different tomcats

Is it possible to share a session among 2 tomcats that runs the same web application and which is both balanced by haproxy? (haproxy is round robin based, and not using sticky-session)
by sharing i mean creating the session in one place (haproxy or tomcat) and be able to get it from the other tomcat.
(our goal is statless web application servers)..
Thanks!
It is possible. You can cluster your tomcat servers together.
Configure Tomcat to Share Sessions
The key to enable session sharing is to declare two XML elements: one
in your application's web.xml (1) and the other in Tomcat's server.xml
(2):
<distributable />
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster" />
Important Note: Your session attributes must be serializable.
Sources:
Krams - Clustering and Load Balancing... - very detailed step-by-step guide.
Apache - Clustering HOW-TO - manual.

Deploy MDB on WebLogic 10.3

I am new to MDB, so my questions may sound simple.
I implemented an MDB( serving as a Consumer ) using JDeveloper 11.1.7 and built a JAR file using deployment functionality. Now I need to deploy it to WebLogic 10.3 app server. I have several questions:
1) Should I deploy it as a library or as an application?
2) After I successfully deploy and it's in the "RUNNING" mode I assume it should be listening to the particular Queue I specified as a Resource in my MDB implementation. Is that correct?
3) When implementing an MDB all the examples only specify the "destination" but not the "ConnectionFactory". How does it know where to connect to?
Should I deploy it as a library or as an application?
Deploy as an application since the MDB will likely contain business logic specific to the app.
After I successfully deploy and it's in the "RUNNING" mode I assume it
should be listening to the particular Queue I specified as a Resource
in my MDB implementation. Is that correct?
Yes, if your JMS provider is local, specify the name bound in the local JNDI tree for the destination using destination-jndi-name.
When implementing an MDB all the examples only specify the
"destination" but not the "ConnectionFactory". How does it know where
to connect to?
If the MDB is consuming messages from the local WebLogic JMS provider, the container manages configuration for the connections and sessions automatically, so don't set provider-url, initial-context-factory, or connection-factory-jndi-name, unless you have a custom factory to use.
Refer to WebLogic 10.3 documentation for details:

Resources