折腾了好久,按照官网的安装流程安装了不止3次,发现还是不能成功,最终发现是linux机器本身的问题,因为我用的公司的virtual machine,可能是机器本身在一次迁移的过程当中出现了问题,导致了我的悲剧。最终的解决方案是重新setup了virtual machine,并且一路顺畅,安装成功。
This artical shows you how to install, configure Tomcat in linux machine. Noted that all of steps are based on root user.
Step 1: Verify Java version, if no java found, please install JDK
java -version
Step 2: download Tomcat
Step 3: unzip the package, and move it to target folder
tar zxf apache-tomcat-8.0.36.tar.gz
cp -R apache-tomcat-8.0.36/* /usr/local/tomcat
Step 4: add CATALINA_HOME
vi ~/.bashrc
#!/bin/bash CATALINA_HOME=/usr/local/tomcatsource ~/.bashrc
Step 5: Change execute permissions for following files
chmod +x $CATALINA_HOME/bin/startup.sh
chmod +x $CATALINA_HOME/bin/shutdown.sh
chmod +x $CATALINA_HOME/bin/catalina.sh
Step 6: Start Tomcat
$CATALINA_HOME/bin/startup.sh
Step 7: Check web site
http://localhost:8080
Step 8: Start catalina service
sudo $CATALINA_HOME/bin/catalina.sh start
Step 9: deploy web app or web service into $CATALINA_HOME/webapps folder.
Issues:
- Cannot access web site.
- Cannot stop catalina service.
- Could not contact localhost:8005
The problems are sovled by formatting linux server.