Linux system will run all scripts defined in rc.d folders; Create Tomcat Auto startup script: login with root user Distribution Notes. I "installed" tomcat on ubuntu by just unzipping it. Save this script in a file named tomcat and change the file ownership and group to root, and then chmod it to 755: # chown root.root tomcat # chmod 755 tomcat. Make this script executable, and set it to autostart by default: $ sudo chmod 755 /etc/init.d/tomcat9 $ sudo update-rc.d tomcat9 defaults Optional – Helpful script file to startup/shutdown tomcat. # /etc/init.d/tomcat # # This is the init script for starting up the # Jakarta Tomcat server # # description: Starts and stops the Tomcat daemon. It is hence preferable to have Tomcat start automatically when the server starts. You cannot have Tomcat listen on port 80 for example. As a consequence Tomcat cannot listen to a privileged port which are ports below 1024. After installing JAVA on the system, now it’s time to download the latest version of Apache Tomcat (i.e. The script starting Tomcat is already running as unprivileged user. Is there a standard script I can use for /etc/init.d/tomcat? I've created the following link in order to startup apache tomcat on startup, however, it does not seem to run. This way Tomcat will start only after network interfaces have been configured. To achieve that the first step is to create init scripts. You can check out Linux Runlevels Explained and Understanding init scripts. 9.0.26) is the most recent stable version at the time of writing this article.If you want to make a cross-check, head over to following Apache download page and check if there is a newer version available. The Apache server is started as root because it uses port 80 (lower than 1024) but it spawns processes that run as "nobody". Or do I need to create one? You will start Tomcat as user "tomcat" to avoid running it as root. Init script contents: Put this in /usr/local/bin folder /etc/init.d lrwxrwxrwx 1 root root 16 Sep 5 14:59 K73ypbind -> ../init.d/ypbind lrwxrwxrwx 1 root root 16 Sep 11 13:09 S100tomcat -> ../init.d/tomcat drwxr-xr-x 2 root root 4096 Sep 11 13:09 . There are several ways to set up Tomcat for running on different platforms. In certain situations a server might reboot unexpectedly. Either start Tomcat as root, which I would not recommend or have a look at the Tanuki service wrapper or alternatively the commons daemon. Am I missing something out? Currently I have created one that works, but I didn't know if there was a more correct way to do this. Create a new file called tomcat and paste the below content into it (adjust the HOME variable to your environment): Copy the script to the /etc/rc.d/init.d directory after modifying the JAVA_HOME and CATALINA_HOME environment variables to fit your system. ... _HOME/bin/daemon.sh can be used as a template for starting Tomcat automatically at boot time from /etc/init.d with jsvc. 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). 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: # /etc/rc.d/init.d/tomcat start Starting tomcat: [ OK ] Or, on some Linux distributions, such as Fedora and Red Hat, to do the same thing, … There are a lot of articles already available on the Internet about Linux Runlevel. As you all know, all startup scripts are found in /etc/init.d folder. 9.13 Starting Tomcat at boot time. Save the following scripts as /etc/init.d/tomcat and /etc/init/apache . The ... Before running the script, the JAVA_HOME environment variable should be set to the base path of the JDK. To start tomcat on linux boot then below are primary steps: create tomcat script that starts,stop,restarts tomcat; create symbolic link of tomcat in rc.d folders. The number denotes the order.