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.
Related
Where do I put my rabbitmq.conf file and how do I make it known to the rabbitmq-server?
All documentation and what I can find only clarifies that this file is not there initially, and the example config file is referenced. Official doc says that I can override the RABBITMQ_CONFIG_FILE env variable. It is unset on my system, but how would I set it so that it is known to rabbitmq-server?
As #Taschi mentioned, the default location of the rabbitmq.conf file is /etc/rabbitmq folder.
Also, you can place it in a custom location and let the rabbitmq-server know the location by setting in in the rabbitmq-env.conf file.
Contents of rabbitmq-env.conf file
CONFIG_FILE=/path/to/rabbitmq.conf
Reference: https://www.rabbitmq.com/configure.html#config-location
By default, the location is at /etc/rabbitmq, according to https://medium.com/#lukaszlenart/how-to-configure-rabbitmq-properly-fa39b2d4cda2.
How to properly set the env variable depends on your operating system, but you could just do it in a startup shell script.
ON MAC
If installed via Homebrew you possible find the rabbitmq-env.conf file at
/opt/homebrew/etc/rabbitmq/rabbitmq-env.conf
One way to find out as well is to read the plist file to see the config location
Once you start rabbitmq via brew services start rabbitmq
It displays "rabbitmq started {user} ~/Library/LaunchAgents/homebrew.mxcl.rabbitmq.plist"
RUN: vim ~/Library/LaunchAgents/homebrew.mxcl.rabbitmq.plist
This should display certain file location such as config that you need.
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?
I'm following this tutorial to setup a Redis server:
https://www.digitalocean.com/community/tutorials/how-to-install-and-use-redis
and getting this error message:
Mmmmm... the default config is missing. Did you switch to the utils directory?
I'm in the /utils directory, but there doesn't appear to be a default config. From the documentation I've read online, it seems like the config should have been created upon setup. Is this something I have to make manually or is this an installation error? My 'make test' command ran successfully, so I don't know why the config file wouldn't have been set up automatically.
If you're on WSL (Windows Subsystem for Linux), you can get this error if you put your Redis folder somewhere that has a path name containing whitespace.
So, like if you put it in the "Program Files" folder. I migrated mine out to just the C:\ drive (or /mnt/c/ for WSL), and it worked just fine.
Had to manually copy default config from the dir above into the correct dir.
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
I am new to apache tomcat and Jenkins. I have installed Tomcat Apache server and upload Jenkins on it.
So, now Jenkins is there in following directory :
C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\jenkins
But when I am trying to execute command as :
echo %JENKINS_HOME%
it simply returns %JENKINS_HOME%
Please tell me how to set Jenkins home directory. Thanks in advance.
To change the location of the Jenkins Configuration directory which is running inside the Apache Tomcat server can be done using the below steps:
Navigate to the conf directory in the apache-tomcat install path
Open the context.xml inside the conf directory and update as below
<Context ...>
<Environment name="JENKINS_HOME" value="/opt/jenikins" type="java.lang.String"/>
</Context>
The above code block will change the Jenkins Home to /opt/jenkins.
Replace it whatever you desire.
NOTE: It is important to change the Jenkins Config directory, by default it gets generated in the USER HOME directory where you may not have enough space to hold all the Jenkins Job config data.
To set some Windows environment variables, you can customise the following batch:
C:\Program Files\Apache Software Foundation\Tomcat 7.0\bin\startup.bat
Just add the following line at the beginning of the batch:
set JENKINS_HOME=C:\YOUR_JENKINS_HOME_PATH
In windows,
Open Apache Tomcat Directory,
Locate context.xml under conf folder.
add the following lines
<Environment name="JENKINS_HOME" value="C:\Jenkins\JK_HOME" type="java.lang.String"/>