This guide is for initial installation only.
Downloading and installing NPS
ORACLE configuration
Tomcat configuration
NPS configurationNPS 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+.
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
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/.
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> |
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"/> |
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.
| <?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> |
| <?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> |
| <?xml version="1.0" encoding="UTF-8"?> <root> <DataSource name="nps"> </DataSource> </root> |
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 |
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 |
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.
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 |