How To Deploy War File In Tomcat Using Command Line
Prerequisites
Create the iGrafx base of operations directory
Earlier you deploy the application you need to create the iGrafx base directory. The binder can exist anywhere on your disk, only you will need the path of that location later during the beneath deployment and you lot may need it during a future update of the iGrafx Platform or the Apache Tomcat.
Yous need to brand certain that the user who is running the tomcat service has write permissions to that folder.
sudo mkdir -p /var/igrafx sudo chown tomcat:tomcat /var/igrafx
At present let tomcat know nearly the changes by adding a setenv.sh file, assigning the required permissions and adding it to the tomcat get-go.
sudo touch /var/igrafx/setenv.sh sudo ln -south /var/igrafx/setenv.sh /opt/tomcat/bin/setenv.sh
So far we only created an empty file, now open information technology:
sudo half dozen /var/igrafx/setenv.sh
Add the below content to it. Y'all volition need to adjust the max heap size (Xmx), also known every bit JAVA memory, and basedirectory if necessary.
#!/bin/sh CATALINA_OPTS="$CATALINA_OPTS -Xms256m -Xmx1024m" JAVA_OPTS="$JAVA_OPTS -Digrafx.basedirectory=/var/igrafx/" JAVA_OPTS="$JAVA_OPTS -Dlog4j.configurationFile=/var/igrafx/log4j2.xml"
Add together log configuration files
Add together a log4j2.xml connfiguration file.
sudo touch /var/igrafx/log4j2.xml sudo vi /var/igrafx/log4j2.xml
Add the below content to it. Unless yous take the need of special centralized logging yous won't need to alter the logging options in this file. The iGrafx platform allows you to configure logging options directly from the Assistants area in your web browser without the need to brand setting to this file.
<?xml version="1.0" encoding="UTF-8"?> <Configuration> <Appenders> <!-- Set upwards panel output... --> <Panel name="Console" target="SYSTEM_OUT"> <PatternLayout pattern="[%p,%c{1}] %m%due north" /> </Panel> </Appenders> <Loggers> <!-- Root is the global logging configuration. This department says that the console volition log everything that is an fault or worse --> <Root level="mistake"> <AppenderRef ref="Console" /> </Root> </Loggers> </Configuration>
Add library to tomcat
Download the javax.mail-ane.5.5.jar file from http://mvnrepository.com/artifact/com.lord's day.mail/javax.mail/1.five.5 or http://central.maven.org/maven2/com/sunday/mail service/javax.mail/1.five.5/javax.mail-i.5.5.jar and identify information technology in the binder/opt/tomcat/lib
cd /opt/tomcat/lib sudo wget http://cardinal.maven.org/maven2/com/sun/postal service/javax.post/1.5.v/javax.mail-one.5.5.jar
Restart the service
To make the above changes effective y'all need to restart the tomcat service. The required command depends on your distribution and looks ordinarily similar one of the following.
sudo systemctl restart tomcat OR sudo service tomcat restart
Deploy the War file
Auto Deploy
- Connect to your tomcat server application manager i.e. https://yourURL/manager/html
- Undeploy the following applications. With the exception of /, which is also known equally ROOT the undeployment is optional, merely it removes unnecessary weight. The tomcat documentation is available directly from the spider web at http://tomcat.apache.org/tomcat-eight.0-physician/index.html
- /
- /docs
- /examples
-
Rename the war file to ROOT.war and place it in the awarding directory of Tomcat.
sudo mv iGrafxPlatform-*.state of war /opt/tomcat/webapp/ROOT.war
If you don't want to utilise the sudo command to put the files into the auto deployment folder y'all could give another user i.e. igrafx premissions.
sudo setfacl -k user:igrafx:rwx /opt/tomcat/webapps/
Tomcat Manager
- Connect to your tomcat server awarding manager i.e.https://yourURL/manager/html
- Undeploy the following applications. With the exception of /, which is also known every bit ROOT the undeployment is optional, but it removes unnecessary weight. The tomcat documentation is bachelor directly from the spider web at http://tomcat.apache.org/tomcat-8.0-doc/index.html
- /
- /docs
- /examples
-
Create a binder you tin put the War file you desire to deploy and can exist reached by the user running the tomcat service.
sudo mkdir /var/igrafx/deploy sudo chown tomcat:tomcat /var/igrafx/deploy/
-
The the tomcat manager deploy the war file to the root context path "/"
-
Consider irresolute the autoDeploy property in the server.xml to be set to imitation. This will prevent that applications can get deployed without a server restart, which increases the likelihood to discover a server intrusion or malfunction.
sudo vi /opt/tomcat/conf/server.xml
Related articles
How To Deploy War File In Tomcat Using Command Line,
Source: https://doc.igrafx.com/doc1604/installation-guide/deploy-the-igrafx-platform/deploy-a-war-file-on-tomcat-under-linux
Posted by: hutchinsonloulty.blogspot.com
0 Response to "How To Deploy War File In Tomcat Using Command Line"
Post a Comment