$ sudo tar -xvf apache-tomcat-10*tar.gz -C /opt/tomcat -strip-components=1 Step 3) Create a new user and group for Tomcat Next, extract the binary file with tar command in the /opt/tomcat path. Next, create a directory in the /opt directory. Visit the official Apache Tomcat download page and grab the latest binary or use the wget command as follows. At the time of penning down this guide, the latest version of Apache Tomcat is v10.0.18. With the installation of Java out of the way, our next step is to download and install Apache Tomcat. Step 2) Download and install Apache Tomcat To confirm the version of Java installed, run the command: $ java -version Then run the following command to install OpenJDK 11. To install OpenJDK 11, update the package lists. We will install OpenJDK 11 which is the latest LTS release. StackOverflow didn't let me correctly format Bash script code.Since Tomcat is built on Java, the very first step will be to install Java which will be provided by OpenJDK. If you're going to use this for automated, unattended upgrades, good to check return values for things like curl so it stops if the download fails, etc. # edit this line for the correct user / group as neededĬhown -R tomcatuser:tomcatgroup $TOMCAT_NAME TOMCAT_NAME=$(echo $TOMCAT_URL | grep -E -o 'apache-tomcat-+')ĭIR="$( cd "$( dirname "$" )" & pwd )" Grep '>tar.gz' | head -1 | grep -E -o ' echo Downloading from $TOMCAT_URL # grep -e allows a pattern to start with a dash If you prefer you could change it to not use a symbolic link, if you don't want to retain the older versions.Įcho "UPGRADING TO THE LATEST VERSION OF TOMCAT 10" This unpacks it and uses a symbolic link. This basically greps through the HTML, which isn't beautiful, but it does work. You can modify as needed for other series. This one is designed for the 10.1.x series. Use the following script to automatically download and unpack the latest Tomcat binary. You can also set in your server.xml a docBase or xmlBase setting to have an additional location where your web applications will live. In particular, you want to set up a CATALINA_BASE that will contain all your configuration and web apps. Use the CATALINA_BASE and CATALINA_HOME settings.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |