set JAVA_HOME=c:\jdk-11 export JAVA_HOME=/usr/java/jdk-11
[app.unzip.dir]/cmobilecom-af-version/liband 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/contextFor example,
http://localhost:8080/myapp-1.0Login 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 tomcat9Start/stop non-systemd service on Linux:
sudo service tomcat9 start sudo service tomcat9 stopStart/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 Cmobilecom installer directly:
java -Dsilent=true -Dtext.mode=true -jar installer/cmobilecom-install-version.jar answer.propertiesAn answer.properties file must be provided for silent install in text mode. Template answer files can be found under
[app.unzip.dir]/cmobilecom-af-version/build-common/install answer_mysql.properties answer_oracle.propertiesMake 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:
cmobilecom.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=cmobilecom 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=trueOracle database:
cmobilecom.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=trueChange 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=truedefines 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.servicetomcat9.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 [cmobilecom.home]/tomcat-[tomcat_version].
[app.unzip.dir]/install/installerto the deployment directory of target application server, or deploy the war through its administration console if there is one.
set "CATALINA_OPTS=%CATALINA_OPTS% -Dcmobilecom.home=c:\path\to\myapp-1.0-install"
CATALINA_OPTS="${CATALINA_OPTS} -Dcmobilecom.home=/path/to/myapp-1.0-install"
[glassfish-dir]/glassfish/domains/domain1/autodeployCopy 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 -Dcmobilecom.home=C:/path/to/myapp-1.0-install Linux: [glassfish-dir]/bin/asadmin create-jvm-options -Dcmobilecom.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]/cmobilecom-af-<version>/conf/db. See the Database Descriptors of Cmobilecom AF 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 website/db/sqlserver/seed.sql hr/db/sqlserver/seed.sqlFor 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 website/db/sqlserver/seed.sql hr/db/sqlserver/seed.sqlWhen 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 -Dcmobilecom.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;-Dcmobilecom.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 tomcat9If access denied when starting service, verify that all files under [cmobilecom.home] are accessible to the service user.