Liferay Portal on Windows This guide will show you how to install Liferay Portal on a server (VM or dedicated hardware) with the following configuration: Web Server: Apache HTTP Server Application Server: GlassFish Community Database: Oracle
Please read through ALL of the steps before beginning the installation. Assumptions: VM or dedicated hardware has a server-grade operating system installed and the person installing Liferay Portal has local admin rights to the machine / VM. Server OS is patched with the latest security updates. A JDK is required on the server to precompile the JSPs. If server is already running JDK (version 5 (1.5) or later), you can skip the JDK installation step below. If it's running a version lower than 5 (1.5), update it to the latest version. If server is running Windows and there are no existing applications using IIS, it's recommended to install and use Apache for Windows (for uniformity and maintenance purposes). If IIS is in use on the machine, you can skip the Apache installation step below and use IIS instead. Note: The steps in this guide use Apache. The steps in this guide are using a VM with Windows Server 2003 installed. The steps may differ slightly for other operating systems. The steps in this guide are using the default GlassFish domain1 domain. If you want Liferay Portal installed on a different GlassFish domain, you will need to substitute the domain1 references below with your domain.
Installation: 1. Install JDK (version 5 (1.5) or later): a. Download the JDK installer (latest stable version): http://java.sun.com/javase/downloads/index.jsp b. Install JDK on the server: i. When the installer loads, place a check in the "Change destination folder" checkbox. ii. Click "Install >" to begin the installation. iii. Click "Browse" and change the default installation folder to a folder near the root folder on your machine, such as C:\Java. Use the subfolder name that it gives you (i.e., jdk1.6.0_17) so that the full path looks something like "C:\Java\jdk1.6.0_17\" iv. Save the new installation path and install JDK following the prompts. When prompted for a JRE path, change the default installation folder to a folder near
the root folder on your machine, such as C:\Java so that the full path looks something like "C:\Java\jre6\" v. When the installation completes, open a Command Prompt window. Type java version and press Enter. If you get a message telling you the version of Java, you've correctly installed JDK. c. Configure JDK on the server: i. Add a new system variable (not a user variable) called JAVA HOME, and point it to the directory to which you installed JDK (i.e., C:\Java\jdk1.6.0_17). For more details on how to create system variables, visit the Microsoft Support site at http://support.microsoft.com/kb/310519 ii. Edit the Path variable: At the beginning of the variable, add %JAVA_HOME%\bin; and save your change. iii. Click Start > Run. Type %JAVA HOME% and click OK. If the Java JDK (not JRE) directory opens, you've correctly configured the JDK. If not, check your JAVA_HOME variable to see if you have it pointing to the location of your JDK install correctly, and make sure your syntax is correct in your Path variable. 2. Install Apache HTTP Server (version 2 or later) -- note: see assumption above for Windows servers a. Download Apache HTTP Server: http://httpd.apache.org/download.cgi -- note: for Windows servers, use the "Win32 Binary without crypto" version b. Install Apache HTTP Server on the server: i. When prompted, change administrator's email to a Raytheon email. ii. When prompted, change the default destination folder to somewhere closer to the root directory (i.e. C:\Apache) iii. Use the default settings for the remaining screens. For more detailed installation instructions see: http://httpd.apache.org/docs/ c. When the installation completes, open a web browser on the server and browse to http://localhost/ -- it should say: It works! 3. Install GlassFish (version 2 or later): a. Download the GlassFish Community installer: https://glassfish.dev.java.net/public/downloadsindex.html b. Install GlassFish Community: i. Change the installation directory to somewhere closer to the root directory (i.e. C:\glassfish) ii. On the Administration Settings screen, change the radio button to "Provide username and password" iii. Keep the default Admin Port (4848) and HTTP Port (8080) iv. Use admin for username v. Create a strong password according to company security guidelines and store the password in an approved, encrypted location. vi. Click Next vii. On the Update Configuration screen, uncheck the "Install Update Tool" checkbox. viii. Click Next and then Install to install GlassFish ix. After GlassFish installs, skip the registration. You should see a "Complete" message. Click Exit c. Configure GlassFish Community: i. After GlassFish installs, open C:\Documents and Settings\
ii. iii. iv. v. vi. vii. viii. ix. x.
Copy the .asadminpass file to the C:\Documents and Settings\Default User folder Right-click the .asadminpass file in the Default User folder and select Properties Click on the Security tab and then click on the Advanced... button On the Permissions tab, uncheck the checkbox that says "Allow inheritable permissions from the parent to propagate..." On the resulting Security pop-up, click the Copy button Click OK to close the Advanced Security Settings window
In the Properties window, remove all users except Administrators and SYSTEM
Click OK to apply the changes. Download service.zip (contains appservService.exe from Glassfish v2 and some batch files to create/remove the service): http://drop.io/gqdnrdu xi. Extract the contents of the zip file to C:\glassfish\glassfish\domains\domain1 xii. Open C:\glassfish\glassfish\domains\domain1\service and double-click install_service.bat -- you should see a SUCCESS message. Press any key to continue. xiii. Click Start > All Programs > Administrative Tools > Services xiv. Find Liferay Portal in the list, right-click it and select Start xv. Once the service has started, open a web browser on the server and browse to http://localhost:8080/ -- it should say: Your server is now running xvi. Close the web browser. xvii. In the Services utility, right-click Liferay Portal and select Stop xviii. Once the service has stopped, open a web browser on the server and browse to http://localhost:8080/ -- it should say: The page cannot be displayed xix. Close the web browser and leave the service stopped for now. 4. Create and configure Oracle database: a. Create an Oracle database called LPORTAL and a database user account named lportal with at least SELECT, INSERT, UPDATE, and DELETE permissions (preferably also include CREATE, MODIFY, and DROP permissions). b. Download the "Liferay Portal SQL Scripts" zip file here: http://www.liferay.com/web/guest/downloads/additional c. Extract the zip file contents, open the create-minimal folder, and run (using TOAD, RapidSQL, etc.) the create-minimal-oracle.sql script. Note: You can ignore any errors from the first 5 lines of the SQL script. 5. Configure Oracle database drivers: a. Connect to the Oracle LPORTAL database (using TOAD, RapidSQL, etc.) and determine your database version by running this query: select * from v$version where banner like 'Oracle%'; b. Browse to the Oracle JDBC drivers page: http://www.oracle.com/technology/software/tech/java/sqlj jdbc/index.html c. Click on the link appropriate for your database version. d. Locate the section on the page that relates to your database version and download ojdbc##.jar, ojdbc##dms.jar, and orai##n.jar to the C:\glassfish\glassfish\domains\domain1\lib folder. 6. Create GlassFish data source for Oracle database: a. Click Start > All Programs > Administrative Tools > Services b. Find Liferay Portal in the list, right-click it and select Start c. Open a web browser on the server and browse to http://localhost:4848/
d. Once the GlassFish login page appears, login with admin username and password. (Click the "Never Register" button, if prompted to register.) e. On the Common Tasks page, find the Other Tasks section and select Create New JDBC Connection Pool f. In the first screen, give it a name of LiferayPool, a resource type of javax.sql.ConnectionPoolDataSource, and Oracle as the Database Vendor. g. Click the Next button h. Scroll down to the Additional Properties section i. Clear all default entries in the Value column j. In the User value field, enter the database username (i.e. lportal) k. In the Password value field, enter the database password in the Password field l. In the URL value field, type: jdbc:oracle:thin:@<server>:<port>:<sid> (replacing <server>, <port> and <sid> with your server information) m. Click the Finish button n. When the list of database pool connections appears, click the LiferayPool link o. Click the Ping button -- you should get a Ping Succeeded message p. Click the Logout button and close your web browser q. Click Start > All Programs > Administrative Tools > Services r. Find Liferay Portal in the list, right-click it and select Restart s. Open a web browser on the server and browse to http://localhost:4848/ t. Once the GlassFish login page appears, login with admin username and password. u. In the left-hand menu, find Resources and click on the JDBC submenu v. Click on the JDBC Resources link w. Click the New... button x. In the JNDI Name field type: jdbc/LiferayPool y. In the Pool Name dropdown, select LiferayPool z. Click OK aa. Click the Logout button and close the web browser. bb. Open the C:\glassfish\glassfish\domains\domain1\config folder cc. Create a text file in that folder and rename it to portal-ext.properties (Warning: make sure the file extension is .properties and NOT .properties.txt -- when you double-click the file it should ask you what program you want to use to open it) dd. Open the portal-ext.properties file in Notepad (or any text editor) and type: jdbc.default.jndi.name=jdbc/LiferayPool ee. Save and close the file. 7. Create GlassFish mail session: a. In the left-hand menu of GlassFish, find Resources. If the JavaMail Sessions submenu option is available, do the following: i. Select JavaMail Sessions and click the New... button ii. Give the JavaMail Session a JNDI name of mail/MailSession, and fill out the rest of the form with the appropriate information for your mail server. iii. Click OK iv. Open the C:\glassfish\glassfish\domains\domain1\config folder v. Open the portal-ext.properties file in Notepad (or any text editor), create a new line below any existing text, and type the following: mail.session.jndi.name=mail/MailSession vi. Save and close the file. b. If the JavaMail Sessions submenu is not available, you will have to use the Liferay mail session:
i. ii.
Open the C:\glassfish\glassfish\domains\domain1\config folder Open the portal-ext.properties file in Notepad (or any text editor), create a new line below any existing text, and type the following (you will likely need to alter the values for your specific environment): mail.session.mail.pop3.host=<server or IP address> mail.session.mail.pop3.password= mail.session.mail.pop3.port=110 mail.session.mail.pop3.user= mail.session.mail.smtp.auth=false mail.session.mail.smtp.host=<server or IP address> mail.session.mail.smtp.password= mail.session.mail.smtp.port=25
iii. Save and close the file 8. Prepare for Liferay Portal installation: a. Open the C:\glassfish\glassfish\domains\domain1\config\domain.xml file with Wordpad. b. Change <jvm-options>-Xmx512m to <jvm-options>-Xmx1024m c. Add another line after this line with the following JVM option: <jvm-options>XX:MaxPermSize=256m d. Add another line after this line with the following JVM option: <jvm-options>-Xrs e. Save and close the domain xml file f. Open the C:\glassfish\glassfish\domains\domain1\docroot folder g. Delete the index.html file h. Download the "Liferay Portal Dependencies" zip file found here: http://www.liferay.com/web/guest/downloads/additional i. Extract the dependencies zip file to a temporary location and copy the jar files to the C:\glassfish\glassfish\domains\domain1\lib folder j. Download the "Liferay Plugins SDK " zip file found here: http://www.liferay.com/web/guest/downloads/additional k. Extract the Plugins SDK zip file to a temporary location and copy the log4j.jar, serializer.jar, xalan.jar, xercesImpl.jar, and xml-apis.jar files to the C:\glassfish\glassfish\domains\domain1\lib folder. Warning: If these .jar files are not added, you will receive a java.lang.ExceptionInInitialization error when deploying the portal. l. Restart the Liferay Portal service 9. Install Liferay Portal .war file: a. Download the "Liferay Portal WAR" war file found here: http://www.liferay.com/web/guest/downloads/additional b. Open Task Manager (Start > Run > taskmgr) c. Login to GlassFish: http://localhost:4848/ d. On the Common Tasks page, find the Deployment section and select Deploy Web Application (.war) e. Ensure the "Packaged file to be uploaded to the server" radio button is selected and click Browse... f. Browse to the location of the Liferay .war file and select it
g. Change the Context Root field to a back-slash ( \ ). Note: Unix installations should use a forward-slash ( / ). Warning: A forward slash ( / ) on Windows may cause a Null Pointer Exception error when deploying the portal. h. Place a check in the Precompile JSPs checkbox i. Leave the rest of the defaults and click OK to deploy the war file. It will take up to 45 minutes to precompile and deploy the war file -- you can monitor the progress with Task Manager. j. After the war file has been deployed, click on the Launch link to verify the portal is functional (default initial login is [email protected] and password is test) 10. Verify database and email functionality: a. Create a Liferay user (Liferay Control Panel > Users) b. Verify the new user was created in the Oracle database (USER_ table) c. Verify an email was sent to the new user (sender: Joe Bloggs | subject: "http://localhost Your New Account")
You’re done! Congratulations! ____________________________________________________________________________________
Note: Once you create a new admin, you should disable the default accounts: update lportal.user_ set active_ = 0 where firstname = 'Test' and lastname='Test'; update lportal.user_ set active_ = 0 where firstname is null and lastname is null;