Question:
When using Alibaba Cloud to configure the server, first install jdk, then install tomcat, and it can be started when startup.sh in tomcat is opened. But using 127.0.0.1:8011 or local ip:8011 cannot display the tomcat running interface.
When using shutdown.sh to shut down the tomcat service, it displays: ./bin/shutdown.sh: No such file or directory
Cause:
There is a problem with the jdk installation path configuration . It is not the real jdk installation path.
(Recommended tutorial:centos usage tutorial)
Solution:
Modify environment variables
The system environment variable modification command is as follows:
vi /etc/profile
Enter enter to enter the variable interface i perform the insert operation esc to exit the current operation :wq to save the changes.
After the changes are completed, enter:
source /etc/profile
to save the changes.
View jdk installation path
which java ls -lrt /usr/bin/java ls -lrt /etc/alternatives/java
jdk environment variable setting
Add the following code to the end of the system environment variable and save it.
export JAVA_HOME= (这里是jdk的安装路径)例:/usr/share/jdk1.6.0_14 export PATH=$JAVA_HOME/bin:$PATH export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
Related video tutorial recommendations:linux video tutorial
The above is the detailed content of centos cannot start tomcat. For more information, please follow other related articles on the PHP Chinese website!