![]() ![]() Now Open your web browser and type url : As of now we have successfully installed Tomcat 9, but to Access Application Web manager and Virtual Host Manager we must define some user and its password in “ tomcat-users.xml” file. ![]() Restart the tomcat service using the below command, :~$ sudo systemctl restart tomcat :~$ sudo vi /opt/tomcat/webapps/manager/META-INF/context.xml Use the below command :~$ sudo ufw allow 8080īy default, we can access the tomcat web gui from Server itself either via local ip or localhost and if you want to access it from outside then we must comment out one line in both the files “ /opt/tomcat/webapps/host-manager/META-INF/context.xml” and “ /opt/tomcat/webapps/manager/META-INF/context.xml” :~$ sudo vi /opt/tomcat/webapps/host-manager/META-INF/context.xml In case OS firewall is enabled and configured on your server then we need to allow 8080 port. Output of above command should be something like below, :~$ sudo systemctl enable tomcatĬreated symlink /etc/systemd/system//rvice → /etc/systemd/system/rvice. Reload the systemd daemon and start tomcat service, :~$ sudo systemctl daemon-reload Now create a systemd file with name “ /etc/systemd/system/rvice” and insert the following contents :~$ sudo vi /etc/systemd/system/rviceĭescription=Apache Tomcat Web Application ContainerĮnvironment= JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64Įnvironment=CATALINA_PID=/opt/tomcat/temp/tomcat.pidĮnvironment='CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC'Įnvironment='JAVA_OPTS=true =file:/dev/./urandom' In the systemd file we must specify the java path, so first find java path using below command, :~$ sudo update-java-alternatives -l To configure tomcat as a service on ubuntu server we need to create systemd file. So now all the required permissions are set, let create tomcat systemd service so that tomcat service can be controlled by systemctl command. Make the tomcat as file owner of the following directories webapps, work, temp, and logs using the beneath chown command :/opt/tomcat$ sudo chown -R tomcat webapps/ work/ temp/ logs/ Set the required permissions on /opt/tomcat and its sub folder and files. Once the above file is downloaded, extract it into the tomcat user’s home folder (/opt/tomcat) using below tar command, :~$ sudo tar xzvf apache-tomcat-9.0.10.tar.gz -C /opt/tomcat -strip-components=1 In my case I am directly downloading it on my server using below wget command, :~$ wget #Ubuntu 18.10 install openjdk 11 download#If the folder or home directory of tomcat (/opt/tomcat) doesn’t exist then create it using mkdir command, :~$ sudo mkdir /opt/tomcatĬreate a tomcat user using below useradd command, :~$ sudo useradd -s /bin/false -d /opt/tomcat tomcat Step:3 Download & Install Tomcat 9 from command lineĭownload the latest version of tomcat 9 (i.e 9.0.10) from its official Web site. ![]() Tomcat service will be controlled by tomcat user, so let create a user with name “ tomcat“, whose home directory will be “ /opt/tomcat” and shell will be “ /bin/false”. ![]() OpenJDK 64-Bit Server VM (build 10.0.1+10-Ubuntu-3ubuntu1, mixed mode) OpenJDK Runtime Environment (build 10.0.1+10-Ubuntu-3ubuntu1) Once above packages are installed then verified the Java version using below command, :~$ java -version ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |