![]() To get the path, run the below command: $ sudo alternatives -list | grep ^java We require to pass java installation location as a variable in the systemd file. It is also quite helpful for tomcat autostart on system reboot. We can create a systemd file for starting and stopping Apache Tomcat. Sudo sh -c 'chmod +x /opt/tomcat/bin/*.sh' Step 7: Create Apache Tomcat Systemd file ![]() Also enable the scripts in the directory to be executable. We need to allow the tomcat user to read files in the tomcat directory. Wget $.tar.gz -C /opt/tomcat -strip-components=1 Step 6: Set Permissions on Tomcat directories Use wget to download Apache Tomcat binaries as below. Now, visit Apache Tomcat official site to download the latest Tomcat version. Sudo useradd -s /bin/nologin -g tomcat -d /opt/tomcat tomcat Step 5: Download Tomcat 10 on CentOS 8|7 / Rocky Linux 8 ![]() # Create tomcat user, disable login and give rights We also need a directory to place tomcat files. We need to create a non-root user that will only be accessing Tomcat and no other use. Sudo dnf install java-1.8.0-openjdk java-1.8.0-openjdk-devel Step 4: Create a non-root user and a Directory for Tomcat Sudo dnf -y install java-11-openjdk java-11-openjdk-devel ![]() For developers, they can opt for the development environment # OpenJDK 11 I am going to be installing version 11 but you can also choose to install version 8. We need to insall OpenJDK runtime environment as below. You can then reboot for the above changes to take effect sudo reboot Step 3: Install OpenJDK on CentOS / Rocky Set server hostname and configure hosts file with the below commands $ sudo hostnamectl set-hostname As always run package update on your server to ensure that you have the latest packages during installation sudo dnf -y update Step 2: Set Hostname and Hosts File ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |