âEvery developer knows that for running any web applications it needs a web server. One of the most famous web servers for J2EE is Apache Tomcat
, but first, let me tell you more about Tomcat.
âAccording to Apache website
âThe Apache TomcatÂ® software is an open-source implementation of the Java Servlet, JavaServer Pages, Java Expression Language and Java WebSocket technologies. The Java Servlet, JavaServer Pages, Java Expression Language and Java WebSocket specifications are developed under the Java Community Process.âThe last stable release is Tomcat 8.5.15
If we were to install on Ubuntu desktop
we just had to go to Tomcat download page and choose the format to download it. Since we are using command line we have to download it using the link to the compressed file. This process was tested on from tomcat7 to tomcat9 alpha. To do it run the command bellow on the command line:Step 1:
âStep 2.5 (optional):âTo avoid asking for password change to superuser.
âStep 3:âExtract the files.
Note that if you didnât use step 2.5 you will have to use the above command with sudoStep 4:
Create the init script in /etc/init.d/tomcat8 and include the information below –
Step 5:Change its permissions and add the correct symlinks automatically:
Now your tomcat will start when your system starts and you can control it with service tomcat7 <stop|start|restart>Note for starting Tomcat you must have OpenJDK or JDK installed.
âThere are many solutions for running web server applications and this is only one of them. If you are a web developer or server admin, this script could help you keep your server always up, without needing to get worried if you forgot to run in on your system start. Leave your thoughts in the comment section below.