Configure tomcat on ubuntu server

Preface#

Well, I want to run a project on my Tencent [Cloud Server] (https://cloud.tencent.com/product/cvm?from=10680) recently. Since the server is a reinstalled system, I can only install tomcat manually.
However, tomcat is based on java, and tomcat can only be used in java environment, so the first thing to do is to install jdk.

Install jdk

First go to http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html to download a jdk to the local for subsequent use.
Then, after the download is complete, all we have to do is upload this file to the ubuntu server.

scp -r /home/jdk-8u161-linux-i586.tar.gz [email protected]:/svn

Enter the password and wait for uploading.
After the upload is complete, unzip the file to a suitable folder. Use the command:

tar zxvf /svn/jdk-8u161-linux-i586.tar.gz -C /home/java

Finally, configure the java environment variables
Edit the /etc/profile file and add the following content in the last line

export JAVA_HOME=/home/java/jdk1.8.0_161
export PATH=$JAVA_HOME/bin:$PATH 
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar 

Note that the path of JAV_HOME is the path where your java is located.
Then you can restart the machine to see if you can output relevant information by entering java.
If the output is successful, then your installation is successful. If there is no output, it is very likely that your jdk version is wrong. Note that 64-bit jdk must be installed for 64-bit and 32-bit jdk for 32-bit.
Generally, this problem occurs like this:

- bash: …… No such file or directory

Re-download and decompress, and the configuration is complete.

tomcat configuration#

Use the same command to upload the file locally to the ubuntu server.

scp -r /home/apache-tomcat-9.0.6.tar.gz -C /home/tomcat

Then unzip, use the tar command:

sudo tar zxvf apache-tomcat-9.0.6.tar.gz -C /home/tomcat/

Finally, if this happens when entering the bin directory of tomcat

- bash: cd: bin: Permission denied

Then it is the problem of file permissions. For convenience, we directly open all permissions of this folder

sudo chmod 777-R apache-tomcat-9.0.6

If it does not appear, then it is the best.
Generally, here, we don't need to configure any tomcat.
Finally, in the bin directory, start tomcat

. /startup.sh

The shell output this text is a successful startup

Using CATALINA_BASE:/home/tomcat/apache-tomcat-9.0.6
Using CATALINA_HOME:/home/tomcat/apache-tomcat-9.0.6
Using CATALINA_TMPDIR:/home/tomcat/apache-tomcat-9.0.6/temp
Using JRE_HOME:/home/java/jdk1.8.0_161
Using CLASSPATH:/home/tomcat/apache-tomcat-9.0.6/bin/bootstrap.jar:/home/tomcat/apache-tomcat-9.0.6/bin/tomcat-juli.jar
Tomcat started.

Conclusion#

After the configuration is completed, do you feel a sense of accomplishment? Do you want to know more professional knowledge, forward-looking information, and technical articles? Then please my personal official account: Attack program dog, make progress together!

Recommended Posts

Configure tomcat on ubuntu server
Ubuntu configure Tomcat
Configure Nginx Git server on Ubuntu system
Configure Wolfram Engine on Tencent Cloud ubuntu server
Configure automatic updates for Ubuntu Server on Azure
Install OpenSSL 1.0.2 on Ubuntu Server 14.04
Install and configure Mono production environment on Ubuntu Server
Install and configure MySQL on Ubuntu
Install Chef server workstation on Ubuntu 18.04
Build a file server on ubuntu
Configure ring after installation on Ubuntu 16.04
Install Oracle 11gR2 on Ubuntu Server 12.4.0
Install Gnome and VNC on Ubuntu Server
How to install Bacula Server on Ubuntu 14.04
How to optimize Tomcat installation on Ubuntu 14.04
lamp on ubuntu
How to use Samba server on Ubuntu 16.04
How to configure Redis cluster on Ubuntu 14.04
How to install Apache Tomcat 8 on Ubuntu 16.04
How to configure Redis replication on Ubuntu 16.04
Ubuntu configure Apache
How to install Zabbix on Ubuntu 16.04 Server
How to install Squid proxy server on Ubuntu 18.04
How to set up Shiny Server on Ubuntu 14.04
How to install and configure NATS on Ubuntu 16.04
How to set static IP on Ubuntu 18.04 Server
Install JDK and configure environment variables on Ubuntu 16.04
How to install and configure Gogs on Ubuntu 18.04
How to install and configure Cyberpanel on Ubuntu 18.04
How to install and configure ownCloud on Ubuntu 16.04
How to install and configure ownCloud on Ubuntu 16.04
How to install and configure GitLab on Ubuntu 18.04
How to install and configure Ansible on Ubuntu 18.04
How to quickly deploy docker on ubuntu server
How to install and configure Elasticsearch on Ubuntu 16.04
How to install and configure PostGIS on Ubuntu 14.04
How to install and configure VNC on Ubuntu 18.04
How to install and configure Sphinx on Ubuntu 16.04
How to install and configure OrientDB on Ubuntu 14.04
How to run the parsing server on Ubuntu 14.04
How to configure Apache content caching on Ubuntu 14.04
How to install and configure AppScale on Ubuntu 12.04
How to install and configure PostGIS on Ubuntu 14.04
install vscode on ubuntu18
Install Redis on Ubuntu
Install R4 on ubuntu20
Install nvtop on Ubuntu 18.04
Install postgresql-10 on Ubuntu 18.04
Install docker on Ubuntu
Install Docker on ubuntu18.04
Install nodejs10 on Ubuntu16
Install mysql on Ubuntu 14.04
Install Django on ubuntu
ubuntu 14.04 configure 3-wire 3IP
Install Pytorch+CUDA on Ubuntu 16.04
Ubuntu configure network commands
Install Python3 on Ubuntu 14.04
Install rJava on Ubuntu18
Install JDK10+ on Ubuntu
Install Python3 on Ubuntu 16.04
Ubuntu18.10 configure Java environment