Hot answers tagged

117

This should do the trick: Open terminal (Ctrl + Alt + T) and enter the following command: sudo update-rc.d tomcat disable Basically update-rc.d will modify existing runlevel links for the script /etc/init.d/tomcat by renaming start links to stop links.


55

You can try this: Just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command below. gksudo gedit /etc/default/tomcat7 When the file opens, uncomment the line that sets the JAVA_HOME variable. Save and restart tomcat7 server.


48

There are three important directories for Tomcat: /etc/tomcat{X} for configuration /etc/tomcat{X} for runtime, called CATALINA_HOME /usr/share/tomcat{X}-root for webapps The alternative path to Tomcat, called CATALINA_BASE, is /var/lib/tomcat{X} The temp folder for Tomcat is /tmp/tomcat{X}-tomcat{X}-tmp All the above paths work for Tomcat 6, 7, and 8. ...


37

After installing Tomcat with apt-get on Ubuntu 12.04, Tomcat creates and uses these directories: /etc/tomcat6/ /etc/tomcat6/ ├── Catalina │   └── localhost │   ├── ROOT.xml │   └── solr.xml -> ../../../solr/solr-tomcat.xml ├── catalina.properties ├── context.xml ├── logging.properties ├── policy.d │   ├── 01system.policy │   ├── 02debian.policy ...


30

The disable|enable API is not stable and might change in the future. I suggest you use the following command to remove all the symlinks in /etc/rc?.d/: update-rc.d -f tomcat remove


30

Both are stored and can be set in /etc/default/tomcat6. By default, CATALINA_HOME is /usr/share/tomcat6, and CATALINA_BASE is /var/lib/tomcat6.


30

You can run the command dpkg -L package to list all the files in the package. For example dpkg -L ubuntu-minimal will only list a couple of small files related to packaging, as it is only an empty meta-package that depends on other packages. dpkg -L tomcat7 is probably what you want.


28

More generic and more visual, with a nice UI: sysv-rc-conf Uncheck the boxes for tomcat7 (runlevels 2 to 5), quit and that's it.


26

Yes, it is possible to install Tomcat 7.0.42, but you'll have to do it "manually".Here are steps on how to do so: Note: visit this question if you want to know why it's not in the repositories: Why don't the Ubuntu repositories have the latest versions of software? Prerequisite: you need to have Java installed, and we need its path. Java is ...


25

Create the init script in /etc/init.d/tomcat7 with the contents as per below (your script should work too but I think this one adheres more closely to the standards). This way Tomcat will start only after network interfaces have been configured. Init script contents: #!/bin/bash ### BEGIN INIT INFO # Provides: tomcat7 # Required-Start: $network # ...


15

For upstart jobs, you need to disable service like this (e.g. mysql): $ sudo -s # echo "manual" > /etc/init/mysql.override


10

Why are these two variables separated? catalina.home points to the location of the common information. catalina.base points to the directory where all the instance specific information are held. So you have 1 home and can have more than 1 base. When should they be separated? When should these two variables be the same? If you have 1 tomcat you ...


10

This is because the package tomcat6-common is still residing in the system. do this sudo apt-get remove tomcat6-common This will remove the conflicting package. Installing Tomcat7 Should work fine now


10

There is a help text in catalina.sh. I will quote it here: # Do not set the variables in this script. Instead put them into a script # setenv.sh in CATALINA_BASE/bin to keep your customizations separate. # # JAVA_HOME Must point at your Java Development Kit installation. # Required to run the with the "debug" argument. # ...


9

You can use sudo apt-get install tomcat7 to install Tomcat. To disable autostarting, run the following command after installing: sudo update-rc.d tomcat7 disable


9

Here's the way I did it, it keeps the system tomcat and your own personal tomcat instance separate. Install tomcat as per normal: sudo apt-get install tomcat7 Install private instance support: sudo apt-get install tomcat7-user Create local instance in your home folder: tomcat7-instance-create -p 10080 -c 10005 mytomcat Note: -p sets the port number ...


7

You do not own the files, neither do you have the permission to write to /usr/share/tomcat6/webapps. The following command will change the ownership of the webapps folder and files recursively to yourusername. That enables user yourusername to write to that directory. sudo chown -R yourusername /usr/share/tomcat6/webapps


7

The "Permission denied" error for the logs directory most likely means that the OS user running the Tomcat process does not have write permission on that directory. Assuming you are running Tomcat with user "tomcat7", try setting the ownership and filesystem permissions of the logs directory, e.g.: sudo chown -R tomcat7:tomcat7 /usr/share/tomcat7/logs sudo ...


6

If you install Tomcat 7 using apt: sudo apt-get install tomcat7 Then the webapps are located in /var/lib/tomcat7 $ tree /var/lib/tomcat7 -L 2 /var/lib/tomcat7 ├── common │   └── classes ├── conf -> /etc/tomcat7 ├── logs -> ../../log/tomcat7 ├── server │   └── classes ├── shared │   └── classes ├── webapps │   └── ROOT └── work -> ...


6

Run following command to find out the tomcat process ps auxwww | grep -v grep | grep tomcat From there you will find out the tomcat process and from there you can see which user is starting this. For eg see the following output vidyadhar@ubuntu:~$ ps auxwww | grep -v grep | grep tomcat root 1941 0.2 1.7 419224 35208 ? Sl Aug12 0:06 ...


6

You can just sudo apt-get install apache2 or sudo apt-get install apache2.2 If Tomcat is working on 80 port, than you might need more configurations, like default port etc... Hope it helps.


6

To run Tomcat on a port below 1024 in Ubuntu/Unix, the service needs root privileges. And that you do not want. Use a port redirection via iptables iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080


6

Your tomcat7 user has no login shell, have a look at /bin/false in the output below % grep tomcat /etc/passwd tomcat7:x:134:149::/usr/share/tomcat7:/bin/false and there is no need to switch your user. To run a command as tomcat7 use % sudo -u tomcat7 whoami tomcat7


5

If you do want to create your own start up script for whatever reason. Then to run tomcat under another user use su -c "$TOMCAT_HOME/bin/tomcat.sh start" nobody when starting tomcat. (nobody is the user in this case that tomcat will start under) http://www.jguru.com/faq/view.jsp?EID=455567


5

11.10 or later sudo apt-get install tomcat7 or the really easy way:


5

Tomcat will not actually use your JAVA_HOME environmente variable, but look in some predefined locations and in the JAVA_HOME variable set inside the startup script, as other answers point out. If you don't like messing with the tomcat startup script, you could create a symlink for your preferred java installation, which will be picked up by tomcat. For ...


5

I noticed two problems here. Two lines in the error log stood out to me: SEVERE: Cannot find specified temporary folder at /var/lib/tomcat7/temp and: java.io.FileNotFoundException: /var/lib/tomcat7/conf/tomcat-users.xml (Permission denied) Doing a bit of diagnosis with Lucio, I figured out that the tomcat-users.xml file was not owned by Tomcat, ...


5

sudo ./startup.sh command will execute the startup.sh script in your current directory. This you should do: Add this line to /etc/profile for setting path while booting( Permanent change) export CATALINA_HOME=/opt/apache-tomcat-8.0.24 To set path temporarily execute above command in the current shell. and excute this: sudo ...


5

Firstly, there should be zero reason to login as the tomcat7 user. There's no logical use case for this, so therefore I'm not sure why you'd try and use it. You state in your question you want to set up a virtual X server for a webapp - you don't need to login as tomcat7 to do this, though your question isn't "How can I launch a virtual X server for my ...


4

Short answer: Using pinning, you can select which packages come from maverick, and automatically get their dependencies, and keep them up-to-date through your package manager. https://help.ubuntu.com/community/PinningHowto Long answer copied from http://askubuntu.com/a/103338/42024: You would be much better off exploring apt pinning, see man ...



Only top voted, non community-wiki answers of a minimum length are eligible