android 安装tomcat服务器,Android版本更新(一)—Tomcat服务器安装配置及问题解决…

  • Post author:
  • Post category:其他


前言

几乎所有发布的APP都有版本监测、更新,自动监测更新的功能,力求解决软件自身的BUG,以及增加新功能,到底该如何实现这些功能。那么如何又该在本地模拟实现这些功能模块呢,为了能够掌握这些知识点,本章将模块化讲述如何对APP版本进行监测更新。

Tomcat7.0服务器安装配置

1. 下载安装

登录Tomcat官网:http://tomcat.apache.org/,下载Tomcat版本,根据需求选择版本,有压缩版和安装板,推荐使用压缩版。

6e7f0b1c0a7e?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

Paste_Image.png

下载完成后,解压到本地即可。

2. 环境配置

右击计算机->属性->高级系统设置->环境变量,新增“系统变量”:

变量名:CATALINA_HOME

变量值:D:\Program Files\apache-tomcat-7.0.70(为当前解压缩的地址)

变量名:CATALINA_BASE

变量值:D:\Program Files\apache-tomcat-7.0.70

修改变量值如下

变量名:CLASSPATH

添加变量值:%CATALINA_HOME%\ lib\servlet-api.jar

变量名:Path

添加变量值:%CATALINA_HOME%\bin

6e7f0b1c0a7e?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

Paste_Image.png

打开Tomcat目录下,进入\bin文件下,打开应用Tomcat7w.exe,然后点击“start”→“应用”→“确定”,

6e7f0b1c0a7e?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

Paste_Image.png

6e7f0b1c0a7e?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

Paste_Image.png

3. 错误原因

原因是8080的端口被占用,打开\bin\startup.bat,发现如下图错误

6e7f0b1c0a7e?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

Paste_Image.png

6e7f0b1c0a7e?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

Paste_Image.png

为了进一步确认是不是端口被占用,进入cmd,输入指令

netstat -ano|find “8080”

6e7f0b1c0a7e?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

Paste_Image.png

可以确定是被占用了。

4. 问题解决

修改server.xml中的端口地址

6e7f0b1c0a7e?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

Paste_Image.png

6e7f0b1c0a7e?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

Paste_Image.png

重新启动Tomcat7w.exe,然后输入修改后的地址:http://localhost:8181/,即可成功访问

6e7f0b1c0a7e?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

Paste_Image.png