NPS Installation Guide

This guide is for initial installation only.

See also

top

Before you start

NPS is a WEB application, which is operated on the central server. NPS is a complete set of JAVA based enterprise CMS. It can help users to manage their own website through browser. Its client-side supports IE6+ and FireFox2+.

Hardwares
For trial, developing and debugging template, NPS could run on a relatively low-equipped PC (for example 1.5+Ghz, 512 MB memory). Allocating 128MB memory to the NPS’s virtual machine is advised. If you need to install ORACLE database server I n the meantime, we advised to equip your PC with a minimum of 1G memory.

The hardware needed for production environment depends on data scale and number of concurrent users using NPS. Production environment generally contains WEB server, application server, NPS server and ORACLE database server. We advise to run Aapche or light http on WEB server to serve static web page. Cluster solution is recommended for large scale application such as DNS round-robin.

With regard to application server, we propose to run open source servers such as TOMCAT or business servers such as IBM WAS. Application server should at least follow SERVLET 2.4 standard. In case of using TOMCAT, mod_jk or mod_webapp could be employed to enable communications between WEB server and application server. For server with memory over 2G, we advise to run minimum 2 application server. To attain optimal performance, we suggest that the maximum memory of every application’s JAVA virtual machine should be set as 768M.

In times of small-scale application, application server could be combined with WEB server. For example, Tomcat server can be run in mod_jserv mode or running TOMCAT and APACHE simultaneously.

Cluster solution should be employed for large-scale application. According to official direction, the maximum concurrent users are generally 200/CPU. For business server, please refers to manufacturer’s cluster guide.

NPS is internal-users oriented and mainly applied for managing and publishing information. Therefore, the concurrency value is small. If the number of websites that NPS manage is within 10, then it can be run on a 1G memory server. For configuring NPS server for large scale application, please refers to the configuration solution of application server.

To simplify the NPS configuration, we advise to allocate independent domain name for NPS server, such as nps.yourdomain.com.

Regarding to ORACLE database server, it is better to store users’ data and NPS data separately, which means establishing tablespace and owner respectively.
Oprating system
NPS can be run on every operating system which supports JAVA. All of Jwebstar’s server should run LINUX.
JAVA
NPS requires a minimum of JDK 1.5. SUN provides 32-bit and 64-bit JDK which is under platforms such as Windows, Solaris and Linux.
Application server
NPS is a WEB application, which is supported by application server. Application server must support SERVLET 2.4.
Jwebstar’s NPS server run on Apache Tomcat5.5.26.
Database server
The minimum version should be Oracle 9i. We recommend using Oracle 10g (over 10.2 version)
top

Downloading and installing NPS

Decompressing NPS to designated directory, for example: /opt/nps/. Such directory is NPS installation directory and expressed as {$NPS_HOME}.

Windows can be decompressed by winzip.

Linux:
    1.mkdir /opt/nps/
    2.mv nps_1.0.zip /opt/nps/
    3.unzip nps_1.0.zip

top

ORACLE configuration

ORACLE 10g is recommended. NPS have passed test on Oracle 9.2 and Oracle 10.2.

1.Creating an independent tablespace, such as T_NPS for storing data, and I_NPS for storing index.
2.Creating a database user, for example: NPS. Such user employs the tablespace above.
3.Grant the user authority of connect and resources.
4.Using tools such as SqLPlus or PL/SQL Developer to implement NPS_oracle.sql which is contained in db directory. The system will automatically generate a super administrator. The account name is system and password is manager.
5. If you didn’t use the version of 10.2, please replace the NPS defaulted driver 10.2 with oracle’s own driver of jdbc. Below is the replacing procedure:
     1)Delete {$NPS_HOME}/web/WEB-INF/lib/ojdbc14.jar.
     2)Copy {$ORACLE_HOME}/jdbc/lib/ojdbc14.jar to {$NPS_HOME}/web/WEB-INF/lib/.
     3){$ORACLE_HOME} is the installation directory of oracle database server, such as /u01/app/ora9i/
     4){$NPS_HOME} is the NPS installation directory of NPS server, such as /opt/nps/.

top

TOMCAT configuration

1.Verify web.xml

The system defaulted web.xml is generated according to Tomcat5.5.x. For other version, the format of web.xml is different. You can copy a web.xml which is in Tomcat’s own sample, and add the content of the table below to web-app.

<servlet>
<servlet-name>Config</servlet-name>
<servlet-class>nps.core.Config</servlet-class>
<load-on-startup>5</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Config</servlet-name>
<url-pattern>/servlet/Config</url-pattern>
</servlet-mapping>
<filter>
<filter-name>Set Character Encoding</filter-name>
<filter-class>nps.util.SetCharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>Set Character Encoding</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
2.Modify Tomcat’s server.xml files.

Opening the files of {$TOMCAT_HOME}/conf/server.xml, then add the content below to the Host part that you need.
Attention:please modify {$NPS_HOME} as the path above, for example: /opt/nps.

<Context path="" docBase="{$NPS_HOME}/web" debug="0"/>
top

NPS Configuration

1.Configuring database’s connection parameter

Open {$NPS_HOME}/web/WEB-INF/db.xml, then configure database’s connection. There are three configuration methods while the second one is recommended to adopt, namely ORACLE’s connection pool.

(1)Configuration without onnection pool
<?xml version="1.0" encoding="UTF-8"?>
<root>
<DataSource name="nps">
<driver>oracle.jdbc.driver.OracleDriver</driver>
<url>jdbc:oracle:thin:@192.168.1.1:1521:pubdb</url>
<user>nps</user>
<password>your password</password>
</DataSource>
</root>
(2)Configuration with Oracle’s connection pool
<?xml version="1.0" encoding="UTF-8"?>
<root>
<DataSource name="nps">
<driver>oracle.jdbc.driver.OracleDriver</driver>
<url>jdbc:oracle:thin:@192.168.1.1:1521:pubdb</url>
<user>nps</user>
<password>your password</password>
<pool>
     <min>5</min>
     <max>100</max>
</pool>
</DataSource>
</root>
(3)Configuration with external data source.This method requires adding database connection pool named nps to the application server’s connection pool management. JNDI address is java: comp/env/jdbc/nps.
<?xml version="1.0" encoding="UTF-8"?>
<root>
<DataSource name="nps">
</DataSource>
</root>
2.Core configuration

Opening {$NPS_HOME}/web/WEB-INF/nps.conf for configuration.

#For storing uploaded files, temporary files and log files that generated during operation, you must fill directory name for every temporary file’s root directory. Setting up independent partition is usually advised. Remember adding “ / ” in the end.
TEMP_ROOTPATH=/NPSTEMP/

#Compiling classpath, automatically contains /WEB-INF/classes;/WEB-INF/lib;${TEMP_ROOTPATH}/classes
#COMPILE_CLASSPATH=

#Caching data. For cluster mode, we do not advise to cache. It can be defaulted as “true”, which means cache.
#CACHE=true

#Locale,defaulted as CHINA
You can set country or region: US、UK、TAIWAN、KOREA、JAPAN、ITALY、GERMANY、FRANCE、CHINA、CANADA、CANADA_FRENCH You can also set language:ENGLISH、FRENCH、GERMAN、ITALIAN、JAPANESE、KOREAN、CHINESE 、TRADITIONAL_CHINESE。 In the defaulted condition (CHINA),all the prompt language is Chinese
#LOCALE=

#The interval time (second) for re-operating FTP、index, etc. DEFAULT=600
#SCHEDULE_INTERVAL=

#SOLR’s URL address is defaulted as http://localhost/solr
The URL root path of SOLR index server. Generally, http://localhost/solr/update is for updating index. While http://localhost/solr/select is for inquiring index.
If there is no parameter set for SOLR, the full-text index service will be closed, including updating and inquiring service.
SOLR=http://localhost/solr

#MAIL server address,default: localhost
MAIL_SERVER=localhost

#MAIL server SMTP port,default: 25
MAIL_SMTPPORT=25

#MAIL server POP3 port,default: 110
MAIL_POP3PORT=110

#MAIL certified user name,defaulted as NULL
MAIL_USER=your email account

#MAIL certified password,defaulted as NULL
MAIL_PASSWORD=the password of your mailbox
3.Configuring system log

NPS use LOG4J to record log. Opening {$NPS_HOME}/web/WEB-INF/log4j.properties for configuration.

log4j.rootLogger=nps
log4j.addivity.org.apache=true
log4j.appender.nps=org.apache.log4j.RollingFileAppender
log4j.appender.nps.Threshold=ERROR
#The log files’ name will be stored in /NPSLOG/nps.log file as defaulted. All files will be automatically divided by 100M.
#Given logs are big; it is advised to separate /NPSLOG into independent partition.
log4j.appender.nps.File=/NPSLOG/nps.log
log4j.appender.nps.Append=true
log4j.appender.nps.MaxFileSize=100MB
log4j.appender.nps.MaxBackupIndex=1
log4j.appender.nps.layout=org.apache.log4j.PatternLayout
log4j.appender.nps.layout.ConversionPattern=[framework] %d - %c -%-4r [%t] %-5p %c %x - %m%n
4.Configuring USERDIR

The function of USERDIR is to store the uploaded picture and attachment that generated during compilation (for preview use in the compilation period). Its directory is {$NPS_HOME}/web/userdir/.
This directory will be automatically created once system starting. For such massive-data users, it is better that manually create directory when configuring system and mount this directory into independent partition.

5.Configuring Quartz

The function of Quartz is to execute back-stage timing tasks. The NPS’s own defaulted Quartz configuration is based on Oracle and can realize cluster dispatching function.
Opening {$NPS_HOME}/web/WEB-INF/quartz.properties to configure Quartz.

#============================================================================
# Configure Main Scheduler Properties
#============================================================================
org.quartz.scheduler.instanceName = MyClusteredScheduler
org.quartz.scheduler.instanceId = AUTO
#============================================================================
# Configure ThreadPool
#============================================================================
org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
The NPS defaulted configuration is 25 dispatching threads.
org.quartz.threadPool.threadCount = 25
org.quartz.threadPool.threadPriority = 5
#============================================================================
# Configure JobStore
#============================================================================
org.quartz.jobStore.misfireThreshold = 60000
org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX
org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.oracle.OracleDelegate
org.quartz.jobStore.useProperties = false
org.quartz.jobStore.dataSource = myDS
org.quartz.jobStore.tablePrefix = QRTZ_
org.quartz.jobStore.isClustered = true
org.quartz.jobStore.clusterCheckinInterval = 20000
#============================================================================
# Configure Datasources
#============================================================================
Setting the connection parameters and maximum connection number for database.
org.quartz.dataSource.myDS.driver = oracle.jdbc.driver.OracleDriver
org.quartz.dataSource.myDS.URL = jdbc:oracle:thin:@192.168.1.1:1521:pubdb
org.quartz.dataSource.myDS.user = nps
org.quartz.dataSource.myDS.password = your password
org.quartz.dataSource.myDS.maxConnections = 5
org.quartz.dataSource.myDS.validationQuery=select 0 from dual