deploy .war file to tomcat8 ubuntu16.04 - tomcat8

I followed this tutorial for setting the tomcat8 on ubuntu 16.04:
https://www.digitalocean.com/community/tutorials/how-to-install-apache-tomcat-8-on-ubuntu-16-04
I have configured tomcat/conf/tomcat-users.xml, added arsys.xml in tomcat/works/CATALINA/localhost/. I have updated .bashrc by setting CATALINA_HOME and JAVA_HOME.
It is now all set up and now when I click on Manager App, I get Tomcat Web Application Manager windows. Thereafter browsing the required .war file under the section WAR file to deploy, after clicking Deploy button I get that 'This site can't be reached'. (Google-Chrome)
What could be the possible reason for it? What shall I do to resolve it?

Related

Installing stackify in linux

The installation guide of Stackify states that we have to modify the catalina.sh of tomcat file to add the java agent. But in a spring-boot app, where can I find the tomcat location to modify the file.
I changed the application.properties file to set the custom location for tomcat by setting server.tomcat.basedir.
How can I change the catalina.sh file now?
Should be able to do the command cd $CATALINA_HOME/bin to get to the folder that contains the catalina.sh. After that you can add CATALINA_OPTS="$CATALINA_OPTS -javaagent:enter_path_stackify_apm_jar" to it.

Pass runtime arguments to grails project on tomcat server

I'm trying to pass in a variable at runtime to my application to configure where my external config files are stored.
I need external config files so that the config can be changed without having to deploy a new release every time the config changes, and want to be able to define the location of these at run time so the applications is more portable and the team deploying the application can follow their existing rules on where to store config.
I have read answers like this:
How to add custom "-Djava" arguments to Grails app? - but I'm not sure how this relates to me from the point of having the war file on my local machine, to deploying this with the param being passed in. I have been using the Tomcat Web Application Manager to simply select the war file to upload, and clicking delpoy - the file is uploaded and automatically exploded out and launched.
https://grails.github.io/grails-doc/latest/ref/Command%20Line/war.html - This suggests that the arguments have to passed in at the point of creating the war file which is not what I'm after.
In my code I have:
grails.config.locations = ["${System.properties['configFolder']}/application-config.properties"]
and I am looking for a way to include arguments when deploying from the Application Manager, or a command something like
deploy myApp.war -DconfigFolder="/usr/share/tomcat5/.grails/myApp/conf/application-config.properties"
EDIT
Turns out you're meant to pass in the runtime parameters when you start the tomcat server (or just after), not when you deploy the application.
The command needed is:
export CATALINA_OPTS="-DconfigLocation=/usr/share/tomcat5/.grails/TAPaS/"
or whatever params/values you want.
This can either be entered manually once the server has been started, or you can create a setenv.sh file containing that command within the CATALINA_HOME directory. This can be found out using the echo $CATALINA_HOME. Another way to find it is to use the start command below, and view the response, e.g.
bash catalina.sh start
Using CATALINA_BASE: /opt/apache-tomcat-7.0.61
Using CATALINA_HOME: /opt/apache-tomcat-7.0.61
Using CATALINA_TMPDIR: /opt/apache-tomcat-7.0.61/temp
Using JRE_HOME: /usr
Using CLASSPATH: /opt/apache-tomcat-7.0.61/bin/bootstrap.jar:/opt/apache-tomcat-7.0.61/bin/tomcat-juli.jar
If you have added the command to the setenv.sh file, use the command bash catalina.sh start to start the server. bash catalina.sh stop is used to stop it. You will need to use the path to .sh file if you're not in the directory of them.
As far as I can work out, this is not possible.
Whenever a .war file is dropped into the appBase
if autoDeploy attribute is "true" then the application will automatically be deployed while the Tomcat server is running
else, the application will be deployed when there Tomcat server is started
bash /opt/apache-tomcat-7.0.61/bin/shutdown.sh
bash /opt/apache-tomcat-7.0.61/bin/startup.sh
will shutdown and the start up the server again and any .war files that are in the appBase will be deployed.
The only instance I can see where an actual command is needed to deploy is when using the Client Deployer Package. More information on Tomcat Deployment found at: https://tomcat.apache.org/tomcat-8.0-doc/deployer-howto.html

can I install wamp twice in different folders?

I'm facing a problem due to the folder name "Program Files" in which my wamp is installed.
I'm using Yii Framework to create a web app.
While running a command
yiic webapp c:\Program Files\wamp\www\YiiApp
it gives error due to the white space in the folder name.
The error is as below:
C:\Program Files\wamp\www\yii-1.1.13.e9e4a0\framework>yiic webapp c:\Program Fil
es\wamp\www\YiiApp
Error: Unsupported VCS specified. Currently only git and hg supported.
USAGE
yiic webapp <app-path> [<vcs>]
DESCRIPTION
This command generates an Yii Web Application at the specified location.
PARAMETERS
* app-path: required, the directory where the new application will be created.
If the directory does not exist, it will be created. After the application
is created, please make sure the directory can be accessed by Web users.
* vcs: optional, version control system you're going to use in the new project.
Application generator will create all needed files to the specified VCS
(such as .gitignore, .gitkeep, etc.). Possible values: git, hg. Do not
use this argument if you're going to create VCS files yourself.
What should I do? Please suggest me something.
The second install will have superceeded the first. In other words Wampmanager and Apache and MySQL will be being started out of the new folder.
As per your question on wamp forum, copy wwww/subfolders into the new location and then copy ONLY YOUR databases from mysqlx.y.z/data into the same place in the new location.
Then delete the folders from program files.
You only need one wamp ( Apache/MySQL) per system.
I tried something else:
Without moving the previously installed wamp's content just read the
"uninstall_services.bat" file
just uninstall these services from that wamp directory which you want to disable.
Still the another wamp's services won't start. So install those services mentioned in "uninstall_services.bat" file manually from respective directories.
Now Restart All Services from the tray icon. The required wamp will be enabled.
If won't, try it again. No need to reinstall wamp.

Change Hippo repository path

Help me please!
My web application running on the server with Ubunta. Jenkins takes the code shown on Bitbucket, and then sets it and manually loads the war files in the Tomcat, that's not deployed by cargo. The problem is in the fact that when I manually brush my folder with the web application, then the next time when i install, all data from the repository( settings, users) disappear. I tried to configure auto export in the console, but the button is not active and press on the checkbox in the Configuration/ Modules/Autoexport also does not help. On the local machine everything works, button is active and data exported to the folder 'bootstrap' to the folder with the project. But on the server is no folders with the project, it on the Bitbucket. And the inclusion of auto exports to the configuration pom.xml file in the cargo.run plugin too does not fit, that's Jenkins not deployed through the cargo, and loads the war files in the Tomcat. Is there another way to change the Hippo repository path?
You can use -Drepo.path startup option. For more options please see this link:
Repository Deployment Settings
Automatic export functionality is there to help you during development, so on your local machine. It is started when configuring it in the cargo.run profile. This profile is typically not used on production servers.
More info on Automatic Export can be found here: http://www.onehippo.org/7_8/library/development/automatic-export-add-on.html
-Drepo.path = /path
-Drepo.Config = /repository.xml -> for database config http://www.onehippo.org/7_7/library/deployment/configuring/configuring-hippo-7-for-mysql.html

I want to know how to deploy the war file in apache tomcat and make it to run

I create a war file using apache ant and
i wanted to
deploy that .war file in tomcat and make it run
can u people help me with the steps..
i m not clear abt it
stop tomcat
move your war into [tomcat install dir]/webapps
start tomcat
tomcat will deploy the war on startup
for database connectivity copy the connector in the lib folder of project which is in WEB_INF folder
like point\war\WEB-INF\lib
create war File ...in war folder of the project
like c:/user/workspace/point/war/ there (point is project name)
...by command jar cvf point.war *
now type http://localhost/portnumber/ like mine is http://localhost/9090
press on tomcat manager and give user and password
go on the option deploy war file to upload ...browse and choice the war file create in war folder of project
upload the file
click on the /point which created by manager and their your file is uploaded