Learn more. Asked 5 years, 4 months ago. Active 2 years, 3 months ago. Viewed 31k times. I tried to start tomcat 8 through the terminal, but I have an issue related to permissions. It appears that catalina. I'm new in Ubuntu, please advise how to solve this. Improve this question. Add a comment. Active Oldest Votes. To see permissions do ls -l. Here's an executable script on my system: -rwxr-xr-x 1 zanna zanna Jun 12 xta-iso2zip.
Improve this answer. However, there are options supplied to the java command that let you control the limits. The exact form depends upon the Java runtime, but if you are using the Sun runtime, you can enter:. This will run a class file called MyProg with a maximum memory size of MB for the entire Java runtime process. These options become important when using Tomcat, as running servlets can begin to take up a lot of memory in your Java environment.
Windows users should set this environment variable from the Control Panel, and Unix users should set it directly in a shell prompt or login script:. Other Tomcat environment variables you can set are listed in Table This sets the base directory for writable or customized portions of a Tomcat installation tree, such as logging files, work directories, Tomcat's conf directory, and the webapps directory. This sets the base directory for static read-only portions of Tomcat, such as Tomcat's lib directories and command-line scripts.
This passes through Tomcat-specific command-line options to the java command. This sets the address for the JPDA used with the catalina jpda start command. This variable may optionally hold the path to the process ID file that Tomcat should use when starting up and shutting down.
If you have installed Tomcat via an Apache binary release archive either a. Make sure it's set to the absolute path of the directory where the Java installation you want Tomcat to use resides.
If it's not, set it and export it now. Try running telnet localhost and telnet localhost to see if any existing server accepts a connection, just to be sure. You should see output similar to this when Tomcat starts up. If you've installed Tomcat via the RPM package on Linux, you can test it out by issuing a start command via Tomcat's init script, like this:. Or, on some Linux distributions, such as Fedora and Red Hat, to do the same thing, you may instead type the shorter command:.
If you installed the JPackage. You should see several Java processes scroll by. Another way to see whether Tomcat is running is to request a web page from the server over TCP port Also check out the " Common Errors " section, later in this chapter.
To use Tomcat's init script on Solaris, you must be the root user. Switch to root first. Then, you can start Tomcat like this:. Watch your catalina. On Microsoft Windows, Tomcat can be started and stopped either as a windows service or by running a batch file.
If you arrange for automatic startup detailed later in this chapter , you may manually start Tomcat in the control panel. If not, you can start Tomcat from the desktop icon. If you have Tomcat running in a console window, you can interrupt it usually with Ctrl-C and it will catch the signal and shut down:. If the graceful shutdown does not work, you need to find the running process and terminate it. The JVM running Tomcat will usually be identified as a Java process; be sure you get the correct Java if other people or systems may be using Java.
The Mac OS X installation of Tomcat is simply the binary distribution, which means you can use the packaged shell scripts that come with the Apache binary release. This provides a quick and easy set of scripts to start and stop Tomcat as required. Mac OS X sets all your paths for you so all you need to do is ensure that there are no TCP services already running on port the default Tomcat HTTP server socket port , nor on port the default Tomcat shutdown port.
This can be done easily by running the netstat command:. You should see no output. Do the same for port Because the user nobody is an unprivileged user, a lot of folders on your disk are not accessible to it. This is of course a good thing, but because the scripts for starting and stopping Tomcat attempt to determine the current directory, you will get errors if the scripts are not being called from a folder to which the user nobody has read access.
To avoid this, the above commands consist of three subcommands. If you are running the commands from a folder to which the user nobody has read access e. You may use the tomcat Several common problems can result when you try to start up Tomcat.
While there are many more errors that you can run into, these are the ones we most often encounter. Ensure that you don't have Tomcat already started. If you don't, check to see if other programs, such as another Java application server or Apache Web Server, are running on these ports. For more information on these elements, consult Chapter 7. At the time of this writing, there is no restart script that is part of the Tomcat 6. The reasons outlined below for Tomcat shutdowns being unreliable are almost exclusively edge conditions.
That means they don't usually happen, but that they can occur in unusual situations. Here are some reasons why shutdowns may be unreliable:. The Java Servlet Specification does not mandate any time limit for how long a Java servlet may take to perform its work. Writing a servlet that takes forever to perform its work does not break compliance with the Java Servlet Specification, but it can prevent Tomcat from shutting down.
The Java Servlet Specification also dictates that on shutdowns, servlet containers must wait for each servlet to finish serving all requests that are in progress before taking the servlet out of service, or wait a container-specific timeout duration before taking servlets out of service.
For Tomcat 6, that timeout duration is a maximum of a half-second per servlet. When a servlet misbehaves and takes too long to finish serving requests, it's up to Tomcat to figure out that the servlet has taken too long and forcibly take it out of service so that Tomcat can shut down.
This processing takes time, though, and slows Tomcat's own shutdown processing. Multithreading in Java virtual machines is specified in a way that means that Java code will not always be able to tell exactly how much real time is going by Java SE is not a real-time programming environment. Also, due to the way Java threads are scheduled on the CPU, threads can become blocked and stay blocked. Because of these limitations, the Java code that is called on invocations of shutdown.
That means that shutdowns are not completely reliable when written in pure Java. Star 5. Permalink main. Branches Tags. Could not load branches. Could not load tags. Latest commit b63 Jul 28, History. Raw Blame. Open with Desktop View raw View blame. This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below.
To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. You may obtain a copy of the License at. Unless required by applicable law or agreed to in writing, software.
See the License for the specific language governing permissions and. For supported commands call "catalina. Environment Variable Prerequisites. Do not set the variables in this script.
0コメント