9 2:Production environment on Windows

From Pnet-Community

Jump to: navigation, search

Contents

[edit] Installing Project.net on a Windows System

This document guides a user through the process of installing Project.net, version 9.2.*, on a Tomcat 6.* application server running on a Windows system. In addition to the application server, a Project.net installation will also require: web server, database server, mail (SMTP) server, document vault (file server) and LDAP server (optional).

En Español: 9.1.3: Instalación en un Ambiente Producción Windows (custom installation)

[edit] Review checklist of requirements

Please review the complete list of hardware and software requirements as described in Project.net Deployment Requirements. Make sure you can meet these requirements before installing Project.net. You will also need to read Installing Project.net.

[edit] Unpack the Project.net Installation Package

The installation package includes the Project.net software in a zip archive file. The first step to installing Project.net is to unpack the software onto an accessible file location.

  1. If it does not exist, create a temporary directory to unpack the installation package, suggested, C:\pnet. These instructions will refer to this location throughout the steps.
  2. Unzip the zip file from your download into the C:\pnet directory. Once unpacked, you will have c:\pnet\v9.2.0_OS directory.

[edit] Install and configure the Oracle database server

Project.net requires an Oracle database server. Follow the instructions in this section to install and configure an Oracle database server, if one is not prepared.

[edit] Prerequisites

  • If you are installing on a system with a non-static IP address, served from a DHCP-server, you will need to install a Microsoft Loopback Adapter. Follow How to install the Microsoft Loopback adapter in Windows XP. When complete, open the new adapter’s properties and set its IP address to a non-routing address, like 192.168.x.x (where x is any number between 0 and 255). Also, set its Subnet mask to 255.255.255.0. Make note of this address, you will need it further in the installation.

[edit] Instructions

  1. Install Oracle 10.2 Enterprise or Express Edition.

[edit] Create and configure the Project.net database

This section will guide you through the steps of creating the tables, stored procedures and such for the Project.net database.

[edit] Prerequisites

  • An Oracle database server, installed as above.
  • A working copy of sqlplus. Normally, this is installed with the Oracle database, but if not, the Oracle instant client is sufficient.
  • The system password for the Project.net database instance.
  • You will need to know the database server’s hostname.

[edit] Instructions

    1. After you have downloaded the Oracle xe then you can double click on the icon to install it.
    2. Accept the agreements and click next, chose the typical install.
    3. Specify the storage location where the Oracle database should be stored and click next.
    4. Enter and confirm the password for the database.
    5. Note the Global Database Name and SID that you use (Note: Oracle Express automatically sets the SID to XE).
    6. Select the remaining options, as appropriate to your installation, and create the database.
    7. Click Finish on the Welcome screen.
  1. CHECKPOINT: Ensure the Oracle Database listener services are running.
    1. On Windows systems, run the command lsnrctl status in a command window and check the values for:
      • ALIAS
      • Listener Parameter File
      • Listening Endpoints Summary
    2. For both Windows and L*nux systems, check TNS connect identifier with tnsping <database SID>.
    3. Also, check that sqlplus system/<database admin password>@<database name> connects.
    4. Close the command window (Windows).
  2. Change directory into the c:\pnet\v9.2.0_OS\database\create-scripts\versions\9.2.*\new\ directory.
  3. Using the editor, edit the pnetMasterDBBuild.bat file. Set the environment variables in this script to be appropriate for your installation. Further instructions are available in the file.
    • Note:
    • The PNET_BUILD_DB_SCRIPTS_PATH should be set to c:\pnet\v9.2.0_OS\database\create-scripts\versions\9.2.*\new\ directory.
    • If you are using Oracle Express set the PNET_BUILD_DB_DATABASE_NAME variable to the value XE.
    • The directory specified for PNET_BUILD_DB_LOG_PATH must exist; create it if it does not. Suggested is c:\pnet\pnetlogs.log
    • The PNET_BUILD_DB_DATAFILE_PATH should be set to the directory where Oracle keeps the database - it will be in the oradata directory in the Oracle folder area (ex. c:\\oraclexe\\oradata\\XE\\).
    • Change the default password for the system account PNET_BUILD_SYSTEM_PASSWORD=manager (ex. PNET_BUILD_SYSTEM_PASSWORD=mysyspass)
    • Change the default password for the schema owner PNET_BUILD_USER_PASSWORD=pnet (ex. PNET_BUILD_USER_PASSWORD=mypass)
    • Change the default password for the database user PNET_BUILD_APP_USER_PASS=pnet_user (ex. PNET_BUILD_APP_USER_PASS=mypass)
    • The following actions need to be done in order to run the script :
    • For PNET_BUILD_DB_LOG_PATH variable, the path must be completed with a file name.
  1. To start the database installation, run the batch command pnetMasterDBBuild.bat from the database\create-scripts\versions\9.2.*\new directory. The script will take some time to run; you can monitor its progress by checking the log file you specified inside of pnetMasterDBBuild.
  • If the script fails and you need to re-run it to clean everything up before trying again.
    a.Go to the database\create-scripts\tools folder
    b.Start Sqlplus with sqlplus pnet/<pnet password>@<database SID>
    c.Drop the existing database with @drop_pnet_and_user_schemas.sql

[edit] Install and Update Java Runtime Environment

[edit] Install the Java 6.0 Runtime Environment

[edit] Prerequisites

[edit] Instructions (Windows installations)

  1. Locate the Jave Runtime Environment installation package using Windows Explorer.
  2. Double-click on the file to initiate the installation.

[edit] Update the Java Security for Strong Encryption

[edit] Prerequisites

[edit] Instructions

  1. Copy c:\pnet\v9.2.*\lib\jce6\*.jar to the jre\lib\security directory of the Java runtime location. For Windows, the likely location is C:\Program Files\Java\jre6\lib\security.
  • Place the files directly into the security directory, overwriting any existing files that conflict.

[edit] Install and Configure the Apache Tomcat Server

This section outlines the Apache Tomcat installation and configuration for a production deployment of the Project.net application.

[edit] Install the Tomcat Application Server

[edit] Prerequisites

[edit] Instructions (Windows installations)

  1. Install Apache Tomcat 6.0 by running the installer 32-bit/64-bit Windows Service Installer (Windows service installer)
  2. Next Screen (Configuration Options)
  3. Expand the Tomcat tree and check the components "Service" and "Native" and click next
  4. Chose the destination folder to install (ex. C:\Program Files\Apache Software Foundation\Tomcat 6.0)
  5. HTTP/1.1 Connector Port : 9090
  6. Username and password are optional, so leave it blank.
  7. Select the path of J2SE 6.0 JRE installed on your system (example C:\Program Files\Java\jre6)
  8. Click the Install button.
  9. On the last screen uncheck the option for Run Apache Tomcat and click Finish.

[edit] Configure Tomcat application server

[edit] Prerequisites

  • Apache Tomcat installed as above.
  • A user name and password for the Tomcat Manager.
  • For more information on configuring and administering Apache Tomcat 6.0, see the following documentation:Tomcat Setup

[edit] Instructions

  1. Activate Tomcat Manager
    • Sample "tomcat-users.xml" file with a new user named "manager" and "manager" role associated with it (Note: it is strongly recommended that you use secure passwords in place of those listed below):
      <?xml version='1.0' encoding='utf-8'?>
      <tomcat-users>
      <role rolename="tomcat"/>
      <role rolename="role1"/>
      <role rolename="manager"/>
      <user username="tomcat" password="tomcat" roles="tomcat"/>
      <user username="role1" password="tomcat" roles="role1"/>
      <user username="manager" password="manager" roles="manager"/>
      </tomcat-users>
  1. Copy c:\pnet\v9.2.*\lib\mail.jar and c:\pnet\v9.2.*\lib\activation.jar to CATALINA_HOME\lib.
  2. Copy c:\pnet\v9.2.*\lib\jdbc\ojdbc14.jar to CATALINA_HOME\lib.
  3. Create the CATALINA_HOME\endorsed folder and copy serializer.jar, xalan.jar, xercesImpl.jar and xml-apis.jar from c:\pnet\v9.2.*\lib\endorsed.

[edit] Setting Java parameters

In order to ensure reliable service the Java virtual machine (JVM) will need to have its parameters tuned.

  • The Xmx parameter controls the maximum heap size the JVM can address.
    • For a development or test server -Xmx512m (512 MB) will be OK.
    • For a production server, the value should be at least -Xmx1024m (1024 MB), but not more than 3/4 the amount of RAM installed in the system.
    • On a 32-bit operating system it cannot exceed -Xmx2048m (2 GB)
  • The Xss parameter controls the stack size for the JVM.
    • Use -Xss128k for a 32-bit operating system.
    • Use -Xss256k if the system has a 64-bit JVM, like HP-UX or IBM-AIX.

[edit] Instructions (Windows systems)

  1. If Tomcat is not running go to the "Apache Tomcat x.x" folder in the Start Menu and select "Configure Tomcat". This will open the Apache Tomcat Properties dialog.
  2. If Tomcat is running you will see an Apache Tomcat icon in the taskbar, generally near the clock. Double-click the icon to open the Apache Tomcat Properties dialog.
  3. In the dialog click on the Java tab.
  4. Add the following value to the Java Options section:
    -XX:MaxPermSize=384m
    -Djava.awt.headless=true
  5. Set the Initial Memory Pool to 256.
  6. Set the Maximum Memory Pool to the Xmx value chosen above.
  7. Set the Thread stack size to the Xss value chosen above.
  8. Click [OK]
  9. You will need to stop and start the Tomcat service if Tomcat is running. You can do this from the icon in the task bar.

[edit] Configure Tomcat logging (Optional)

[edit] Prerequisites

[edit] Instructions

Turning on logging is an optional step but will come in handy when monitoring or troubleshooting your server; logging can be activated at any time, but it requires restarting Tomcat. Finally, the default level of logging is DEBUG, which is very verbose, you will want to change this to WARN or ERROR when creating the log4j.properties configuration file described below.

  1. Follow the four steps for configuring Logging in Tomcat http://tomcat.apache.org/tomcat-6.0-doc/logging.html.


[edit] Install Apache ActiveMQ

On the application server the JAVA_HOME environment variable must be set to the directory where the Java runtime (JDK or JRE) is installed.

  1. On the [Start] menu or the desktop, right-click My Computer, then [Properties].
  2. Click [Advanced] tab.
  3. Choose [Environment Variables] button.
  4. Look in "System Variables" for the JAVA_HOME environment variable. If it is not there, use the [New] button to create it. Most likely, Java is installed in C:\Program Files\Java\<version name>
  5. Click [OK] to close the dialog
  6. Download the latest stable Windows Distribution of Activemq from http://activemq.apache.org/download.html
  7. Unpack the zipped package into your Program Files, for example C:\Program Files\apache-activemq-5.3.2
  8. To install Activemq as a Windows service please follow these instructions
    a.Run the InstallService.bat script located in <apache_activemq_install_dir>\bin\win32
    b.Open the Windows Services panel through Control Panel -> Administrative Tools or using Run: services.msc
    c.Check for a Service named "ActiveMQ", right-click on it and start it
    d.Check the log file at <apache_activemq_install_dir>\data\wrapper.log
    e.You should have the message "INFO TransportConnector - Connector vm://localhost Started"

For more information please visit the ActiveMQ website at http://activemq.apache.org

[edit] Deploy Project.net to Tomcat Server

[edit] Prerequisites

  • Apache Tomcat installed as above.
  • Administrator's (manager) password for Tomcat installation.
  • Edit CATALINA_HOME/config/context.xml to configure the database connection pool and the connection to the SMTP mail server.
    <Context debug="5" reloadable="true" crossContext="true">
    <Resource name="jdbc/PnetDB" auth="Container"
    type="javax.sql.DataSource" username="pnet_user" password="<pnet_user password>"
    driverClassName="oracle.jdbc.OracleDriver" url="jdbc:oracle:thin:@<dns of db listener>:<listener port>:<db SID>"
    maxActive="125" maxIdle="25"/>
    <Resource name="mail/PnetSession" auth="Container"
    type="javax.mail.Session"
    mail.smtp.host="<SMTP host>"/>
    </Context>
  • Start Tomcat
    • Windows - use Service Manager to start the Tomcat service

[edit] Instructions (Manual Deployment)

  1. If you want to deploy application as ROOT, delete the existing CATALINA_HOME\webapps\ROOT folder since the Project.net application will be associated with the / URL and will be installed in this folder.
  2. Copy c:\pnet\v9.2.*\app\pnet.war to CATALINA HOME\webapps directory, this will install Project.net in the pnet context. To deploy as the default application, rename pnet.war to ROOT.war or, if you want to deploy the application as a different context, rename war file as <Your desired application name>.war.
  3. Start Tomcat, or restart it if it is running.
  4. Wait a minute, then log into !http://localhost:9090/<Your desired application name>/ OR http://localhost:9090/ ( if application is deployed as ROOT.war ) as appadmin.

[edit] Instructions (Using Tomcat Manager)

Project.net cannot be deployed as the default or Root application using the Tomcat Manager, since the Manager runs as the default application.

  1. Log into http://localhost:9090/manager/html/, use Username 'manager' and the password you defined in Step 6 (the default is 'manager').
  2. Browse WAR file to upload. If you want to deploy application as NON-ROOT context you can rename war file as <Your desired application name>.war.
  3. Log into !http://localhost:9090/<Your desired application name>/ as user appadmin.

[edit] Web server front-end integration

The final step is to link the Tomcat server to a web server. This is useful if you want Project.net to act as the default (Port 80) website on the system. Using Tomcat's built in web server to handle requests on Port 80 opens a security hole, therefore, you will need to use Apache httpd web server. The web server will handle the requests coming from the user and marshal the appropriate ones to the Tomcat server for processing by the Project.net application.

[edit] Prerequisites

[edit] Instructions (Apache installations)

[edit] Windows

  1. If running, stop the Apache server.
  2. Confirm the version of the Apache web server with the following command: apache.exe -v
  3. Verify that the Apache server was built with the mod_so module. Run the command apache.exe/httpd2 -l and look for mod_so.c in the results list. If you cannot find this module, you should reinstall or rebuild Apache.
  4. Edit c:\Program Files\Apache Software Foundation\Apache 2.2\conf\httpd.conf
  5. Search for and uncomment the following lines by removing the '#' at the beginning of each line:
    LoadModule proxy_module modules/mod_proxy.s
    LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
  6. Add the following lines to the end of the file:
    # tomcat integration
    ProxyPreserveHost On
    ProxyPass / ajp://<application server dns name>:8009/ min=5 ttl=120 keepalive=On ping=1
    ProxyPassReverse / ajp://<application server dns name>:8009/
  7. Verify the configuration settings by executing the command apache.exe/httpd2 -t. The command should display a 'Syntax OK' message.
  8. The integration is complete, re-start the Apache server.

[edit] Configuration and License Properties

Once the servers are set up and the software installed, you must configure a few basic Project.net settings in order to use the application:

  1. Update the application administrator user account
  2. Configure Project.net System Settings
  3. Install the Master License Properties for your Server

Follow Configuration and License Properties to finish these three steps and begin using Project.net.

[edit] More Help

Personal tools