How to set Jenkins_Home hosted on apache tomcat - apache

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"/>

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.

deploy .war file to tomcat8 ubuntu16.04

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?

Resin plugin for IntelliJ Ultimate- where is conf folder

I just installed Resin plugin for IntelliJ, but I couldn't set the configuration correctly.
Running Resin separately has worked for my application. Here's what I did to configure Resin (the standalone application)
Download http://www.caucho.com/download/resin-pro-3.1.12.zip
Copy some conf files to C:\resin-pro-3.1.12\conf
I figured the reason why my IntelliJ's Resin plugin doesn't behave as expected is because I haven't put my conf files into conf folder. But, I don't know where conf folder is located for Resin plugin for IntelliJ
Actually, just go to Run > Edit Configurations.. > Resin > Configure.. and select default resin configuration file

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

where is httpd.conf file in httpd-2.4.16 package?

I have downloaded httpd-2.4.16.tar.gz package from http://www.apache.org/dist/httpd/
and extracted on my ubuntu 14.04 LTS two times but i am unable to find conf directory so that i configure httpd.conf file present in this directory as mentioned in http://httpd.apache.org/docs/2.4/install.html#customize
One directory i found in this package at /docs/conf but in this package i found httpd.conf.in instead of httpd.conf is it correct directory for configuration?
Thanks
Use find /etc -name httpd
This will produce a list of all files within that directory that contain httpd
Or use:
find / -name httpd.conf
which will produce the full path of wherever httpd.conf is situated.
Actually conf file appear after installation of apache. I was finding it inside extracted directory of httpd-2.4.16.tar.gz.