set JAVA_HOME=c:\jdk-11
export JAVA_HOME=/usr/java/jdk-11
[app.unzip.dir]/znize-platform-version/lib
and rename it to jdbc.jar.
MySql JDBC version: 6.0.6 or above. Oracle JDBC driver version: 11.2.0.3 or above.
cd [app.unzip.dir]
setup
Database and username consist of letters, digits and underscores. dash(-) is not allowed.
http://localhost:port (root context)
http://localhost:port/context
For example,
http://localhost:8080/myapp-1.0
Login with username "system" and the password that is set at Step 4.
If the application server is installed as a service, its default service name is tomcat9.
Start/stop on windows:
sc start tomcat9
sc stop tomcat9
Start/stop non-systemd service on Linux:
sudo service tomcat9 start
sudo service tomcat9 stop
Start/stop systemd service on Linux
sudo systemctl start tomcat9.service
sudo systemctl stop tomcat9.service
set "JAVA_OPTS=%JAVA_OPTS% -Dsilent=true -Dtext.mode=true -Dverbose=true"
set "ANSWER_FILE=answer.properties"
or invoke ZNize installer directly:
java -Dsilent=true -Dtext.mode=true -jar installer/znize-install-version.jar answer.properties
An answer.properties file must be provided for silent install in text mode.
Template answer files can be found under
[app.unzip.dir]/znize-platform-version/build-common/install
answer_mysql.properties
answer_oracle.properties
Make changes to one of the template answer file according to your environment,
and put it under [app.unzip.dir] as answer.properties.
For example,
MySql database:
znize.home=C\:\\myapp-1.0-install
system.username=system
system.password=123456
dbms.install=false
dbms.type=mysql
dbms.host=localhost
dbms.port=3306
db.rootUsername=root
db.rootPassword=welcome8
db.name=myapp_schema
db.username=znize
db.password=welcome
db.userHost=localhost
db.schemaName=myapp_schema
theme=nova-colored
as.install=true
as.name=tomcat
as.port.http=8080
as.service.install=true
as.service.name=tomcat9
as.service.displayName=Tomcat9
as.service.description=Tomcat9
as.service.start=true
as.emptyApps=true
Oracle database:
znize.home=C\:\\myapp-1.0-install
system.username=system
system.password=123456
dbms.install=false
dbms.type=oracle
dbms.host=localhost
dbms.port=1521
db.rootUsername=root
db.rootPassword=welcome8
db.name=XEPDB1
db.username=myapp_schema
db.password=welcome
db.userHost=localhost
db.schemaName=myapp_schema
theme=nova-colored
as.install=true
as.name=tomcat
as.port.http=8080
as.service.install=true
as.service.name=tomcat9
as.service.displayName=Tomcat9
as.service.description=Tomcat9
as.service.start=true
as.emptyApps=true
Change directories and database configuration according to your environment.
Pass through JVM system properties can be specified in answer file, which start with "jvm:". For example,
jvm:test.automation=true
defines a JVM system property "test.automation" whose value is "true".
sudo cp tomcat9.service /usr/lib/systemd/system/tomcat9.service
sudo systemctl daemon-reload
sudo systemctl enable tomcat9.service
sudo systemctl start tomcat9.service
tomcat9.service
[Unit]
Description=Tomcat 9
After=network.target
[Service]
Type=forking
ExecStart=/path/to/tomcat/bin/startup.sh
ExecStop=/path/to/tomcat/bin/shutdown.sh
SuccessExitStatus=143
# Security
User=tomcat
Group=tomcat
PrivateTmp=yes
#AmbientCapabilities=CAP_NET_BIND_SERVICE
NoNewPrivileges=true
ProtectSystem=strict
ReadWritePaths=/path/to/tomcat/webapps/
ReadWritePaths=/path/to/tomcat/logs
ReadWritePaths=/path/to/tomcat/work
ReadWritePaths=/path/to/tomcat/temp
[Install]
WantedBy=multi-user.target
The installed Tomcat instance directory is [znize.home]/tomcat-[tomcat_version].
[app.unzip.dir]/install/installer
to the deployment directory of target application server,
or deploy the war through its administration console if there is one.
set "CATALINA_OPTS=%CATALINA_OPTS% -Dznize.home=c:\path\to\myapp-1.0-install"
CATALINA_OPTS="${CATALINA_OPTS} -Dznize.home=/path/to/myapp-1.0-install"
[glassfish-dir]/glassfish/domains/domain1/autodeploy
Copy war file to the autodeploy directory, or use command line
[glassfish-dir]/bin/asadmin deploy /path/to/myapp-1.0/install/installer/myapp-1.0.war
Windows: [glassfish-dir]/bin/asadmin create-jvm-options -Dznize.home=C:/path/to/myapp-1.0-install
Linux: [glassfish-dir]/bin/asadmin create-jvm-options -Dznize.home=/path/to/myapp-1.0-install
[glassfish-dir]/bin/asadmin restart-domain domain1
To support a database, sqlserver for instance, its XML db descriptor sqlserver-descriptor.xml must be provided and put under [app.unzip.dir]/znize-platform-<version>/conf/db. See the Database Descriptors of ZNize Platform Developer Guide for detail.
In addition, database seed sql files for all the modules must be provided for creating tables in schema. For installation, seed sql files need to be put under [app.unzip.dir]/install/seed, and their relative paths are: [moduleName_lowercase]/db/[dbmsType]/seed.sql. For example,
[app.unzip.dir]/install/seed
system/db/sqlserver/seed.sql
system/db/sqlserver/seed-sys.sql
site/db/sqlserver/seed.sql
hr/db/sqlserver/seed.sql
For runtime, seed sql files need to be packaged in a module jar inside war,
and their entry names are the same as the relative paths under
[app.unzip.dir]/install/seed. For example,
system/db/sqlserver/seed.sql
system/db/sqlserver/seed-sys.sql
site/db/sqlserver/seed.sql
hr/db/sqlserver/seed.sql
When building a module jar, seed sql files will be packaged inside the jar.
Common Issues:
To manually install and configure the service for Tomcat: (for example, service name: tomcat9, installation directory: c:\path\to\myapp-1.0-install, tomcat home: c:\path\to\myapp-1.0-install\tomcat-version. Change the directories, service display name and description accordingly. Do not forget to replace -Dznize.home in the command with your installation directory.)
# install service, service name: tomcat9
[tomcat.home]\bin\service install tomcat9
# configure service, execute only once
[tomcat.home]\bin\tomcat9.exe //US//tomcat9
--DisplayName="Tomcat9"
--Description="Tomcat9"
--Startup=auto --ServiceUser=LocalSystem
++JvmOptions="-Xms64M;-Xmx512M;-XX:MaxPermSize=512M;-XX:+HeapDumpOnOutOfMemoryError;-Dznize.home=c:\path\to\myapp-1.0-install"
# verify that return code should be 0
echo %errorlevel%
# start service
sc start tomcat9
# stop service
sc stop tomcat9
# remove service
[tomcat.home]\bin\service remove tomcat9
If access denied when starting service, verify that all files under [znize.home] are
accessible to the service user.