Tuesday, May 5, 2015

Liferay-Jboss Bundle 6.2 with MSSQL Setup

1.Download liferay bundle from the link
2. Download SQL Server sqljdbc4.jar from link
3. create DB modules under ${JBOSS}/module as shown below


4. create following files and add downloaded jar file under this folder
5. create module.xml and add following content in the file
<resources>
<resource-root path="sqljdbc4.jar">
<!-- Insert resources here -->
</resource-root>
</resources>
<dependencies>
<module name="javax.api">
<module name="javax.transaction.api">
<module name="javax.servlet.api" optional="true">
</module>
</dependencies>

6. update the standanlone.xml file subsystems as mentioned in the below section

7. configuring datasource subsystem add the below content under
urn:jboss:domain:datasources:1.0 (update your settings as per your DB server )
NOTE: create empty database before start the server
<datasource jta="false" jndi-name="java:jboss/datasources/MSSQLXADS"
pool-name="MSSQLXADS" enabled="true" use-java-context="true">
<connection-url>
jdbc:sqlserver://localhost:1433;databaseName=Jboss_Liferay
</connection-url>
<driver>
 sqlserver
</driver>
<security>
<user-name>sa</user-name>
<password>xxxxx</password>
</security>
</datasource>

8. configured driver class with given module name from the point no 5
<driver name="sqlserver" module="com.db.sqlserver">
<xa-datasource-class>
com.microsoft.sqlserver.jdbc.SQLServerXADataSource
</xa-datasource-class></driver>

9. Configure email subsystem (update your settings as per mail server)
<subsystem xmlns="urn:jboss:domain:mail:1.0">
<mail-session jndi-name="java:jboss/mail/xxxxMAIL" from="noreply@xxxx.com">
<smtp-server outbound-socket-binding-ref="mail-gmail-smtp">
<login name="xxxx" password="xxxx"/>
</smtp-server>
</mail-session>
</subsystem>

10. add below section under (last section in the standalone.xml)
<outbound-socket-binding name="mail-gmail-smtp">
<remote-destination host="smtp.gmail.com" port="465"/>
</outbound-socket-binding>

11. change deployment time interval value to 6000 from 124
<subsystem xmlns="urn:jboss:domain:deployment-scanner:1.1">
<deployment-scanner path="deployments" relative-to="jboss.server.base.dir" scan-interval="5000" deployment-timeout="6000"/>
</subsystem>

12. increase heap in the standalone.conf.bat file as per server RAM ex: if the serve having 8 GB of RAM use
ex: if the serve having 8 GB of RAM use can use below settings  -Xmx4096m -XX:MaxPermSize=1024m

13. start the server using standalone.bat file

14. update ipAddress in standalone.xm to access from external system (by default jboss doesn’t allow to access other than localhost) under interface section
<interfaces>
<interface name="management">
<inet-address value="ipaddress"/>
</interface>
<interface name="public">
<inet-address value="ipaddress"/>
</interface>
<interface name="unsecure">
<inet-address value="ipaddress"/>
</interface>
</interfaces>

No comments:

Post a Comment