First we have to install the Tomcat server, first of all must be installed Java running environment JDK, because Tomcat is a Java-written server, install JDK see: http://blog.csdn.net/u013412497/article/details/47000275
After installing the JDK, download Apache on the official web, I downloaded the current minimum version of apache-tomcat-8.0.24.tar.gz, of course, the high version is compatible with the low version, if we develop in the myeclipse, we can also choose a lower than the other version.
After downloading, unzip the file. Download the default place is/home/ranruilong/download, this is my directory, the default is home, everyone's directory only need to change the Ranruilong to your corresponding directory can
In terminal input: TAR-ZXVF apache-tomcat-8.0.24.tar.gz
After decompression, there is one more folder in the current directory: apache-tomcat-8.0.24
Then I created a new Apache directory in/opt and put the unpacked files under this folder.
Create a file with Mkdir/opt/apache in the terminal
Then under the original download directory: CP Apache-tomcat-8.0.24/opt/apache
It's simple, then you just need to configure the environment variables.
In Terminal input: Vi/etc/profile
At the back, add:
The catalog in export catalina_base=/opt/apache/apache-tomcat-8.0.24//Here is your own Tomcat directory
The catalog in export catalina_home=/opt/apache/apache-tomcat-8.0.24//Here is your own Tomcat directory
Finally, save the file. Then go to Tomcat's Bin directory to start startup.sh
In the terminal input./startup.sh can be started successfully.
If you encounter insufficient permissions during the operation, log in with the root user. In the terminal input su-root then enter the password, the root login succeeded, but the root user permissions are the highest, so in the root
In the process of logging in, do not arbitrarily change files
So tomcat is configured successfully.