3. JBoss 4.04 with Tomcat

  1. Download and install JBoss AS into your preferred directory. From now on, the directory where you installed Tomcat will be referred to as $JBOSS_HOME.

  2. Download and install JDK 5 . Set an environment variable called %JAVA_HOME% to point to your JDK directory.

  3. Download MySQL from www.mysql.com and install.

  4. Download liferay-portal-4.x.ear.

  5. Edit $JBOSS_HOME/server/default/conf/jboss-service.xml:

    <classpath codebase="${jboss.server.lib.url:lib}/ext" archives="*"/>
  6. Delete $JBOSS_HOME/server/default/deploy/jbossweb-tomcat55.sar/ROOT.war.

  7. Edit $JBOSS_HOME/server/default/deploy/jbossweb-tomcat55.sar/conf/web.xml:

    replace default servlet (lines 79-91) :

     <servlet>
          <servlet-name>default</servlet-name>
          <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
          <init-param>
             <param-name>debug</param-name>
             <param-value>0</param-value>
          </init-param>
          <init-param>
             <param-name>listings</param-name>
             <param-value>true</param-value>
          </init-param>
          <load-on-startup>1</load-on-startup>
       </servlet>

    with:

    <servlet>
          <servlet-name>default</servlet-name>
          <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
          <init-param>
             <param-name>debug</param-name>
             <param-value>0</param-value>
          </init-param>
          <init-param>
             <param-name>listings</param-name>
             <param-value>false</param-value>
          </init-param>
          <init-param>
             <param-name>input</param-name>
             <param-value>4096</param-value>
          </init-param>
          <init-param>
             <param-name>output</param-name>
             <param-value>4096</param-value>
          </init-param>
          <load-on-startup>1</load-on-startup>
       </servlet>
  8. Create $JBOSS_HOME/server/default/deploy/liferay-ds.xml with following content:

    <datasources>
       <local-tx-datasource>
         <jndi-name>jdbc/LiferayPool</jndi-name>
         <connection-url>
             jdbc:mysql://localhost/lportal?useUnicode=true&amp;characterEncoding=UTF-8
         </connection-url>
         <driver-class>com.mysql.jdbc.Driver</driver-class>
         <user-name></user-name>
         <password></password>
         <min-pool-size>0</min-pool-size>
       </local-tx-datasource>
    </datasources>
  9. Go to $JBOSS_HOME/server/default/lib/ and create new directory ext. Download mysql-connector-java-{$version}-bin.jar and copy to this directory. (This is the JDBC connector for MySQL, for other databases, go to appropriate website to download.)

  10. Populate your database with the portal schema and defult data.

    1. Download script create-mysql.sql from Liferay Portal 4.x SQL Scripts.

    2. In command prompt, run mysql script by entering mysql < create-mysql.sql.

  11. Download portlet.jar and portal-kernel.jar from liferay Portal 4.x Dependencies.

    1. Copy to $JBOSS_HOME/server/default/lib/ext.

  12. Set mail properties by replacing the contents of $JBOSS_HOME/server/default/deploy/mail-service.xml with:

    <?xml version="1.0"?>
    
    <server>
    	<mbean code="org.jboss.mail.MailService" name="jboss:service=MailSession">
    		<attribute name="JNDIName">mail/MailSession</attribute>
    		<attribute name="User">nobody</attribute>
    		<attribute name="Password">password</attribute>
    		<attribute name="Configuration">
    			<configuration>
    				<property name="mail.store.protocol" value="imap" />
    				<property name="mail.transport.protocol" value="smtp" />
    				<property name="mail.imap.host" value="localhost" />
    				<property name="mail.pop3.host" value="localhost" />
    				<property name="mail.smtp.host" value="localhost" />
    			</configuration>
    		</attribute>
    	</mbean>
    </server>
  13. Configure JAAS. Edit $JBOSS_HOME/server/default/conf/login-config.xml and comment out the entire XML for policy other in lines 140-156.

    <!--<application-policy name = "other">-->
        ...
           <!--<authentication>
              <login-module code = "org.jboss.security.auth.spi.UsersRolesLoginModule"
                 flag = "required" />
           </authentication>
        </application-policy>-->
  14. Deploy liferay-portal-4.x.ear.

    1. create new directory $JBOSS_HOME/server/default/deploy/liferay-portal.ear

    2. unzip liferay-portal-4.x.ear to directory

    3. go into $JBOSS_HOME/server/default/deploy/liferay-portal.ear/lib

      • move dom4j.jar,jaxen.jar to JBOSS_HOME/lib

      • move commons-collections.jar goes to JBOSS_HOME/server/default/lib

      • remove hibernate3.jar,jboss-hibernate.jar from JBOSS_HOME/server/default/lib

  15. Edit JBOSS_HOME/server/default/deploy/jbossjca-service.xml:

    change Debug attribute in line 63 from true to false:

    <attribute name="Debug">false</attribute>
  16. Edit JBOSS_HOME/server/default/deploy/jms/jbossmq-destinations-service.xml. Clear out text between server tags:

    <?xml version="1.0"?>
    
    <server>
    </server>
  17. Start JBoss. Open your browser to http://localhost:8080. Click on My Liferay at the upper right hand corner to enter the login screen. Your login is [email protected] and your password is test.