配置IntelliJ,添加远程Tomcat服务器
-
点击“Edit Configurations”按钮,如下图所示
- 在“Run/Debug Configurations”窗口中添加Remote Tomcat
- 配置remote服务器如下图所示:
- 其中上图的Remote Staging的Host的配置如下(记得先点击左上角的"+")
- 配置Deployment 选项页
- 启用服务器的JMX端口(1009),在/etc/profile文件中加入如下代码,执行命令#source /etc/profile(最好是重启服务器)
export JAVA_OPTS="-Dcom.sun.management.jmxremote=
-Dcom.sun.management.jmxremote.port=1099
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
-Djava.rmi.server.hostname=10.1.1.98"
记得将上述的10.1.1.98改为你实际的服务器ip地址
- 重启tomcat
- 最后点击三角形状的运行按钮即可将web应用部署到远程tomcat上并运行