开发者

Trying to connect to a remote server using Eclipse

开发者 https://www.devze.com 2022-12-28 19:56 出处:网络
I have an Ubuntu server running Tomcat, and I want to connect my Eclipse EE to it so I can work with JSP.

I have an Ubuntu server running Tomcat, and I want to connect my Eclipse EE to it so I can work with JSP.

I have no problem connecting to a similar Tomcat service when it's installed on my machine (not a server), but whenever I try to co开发者_Python百科nnect to the remote server I don't seem to have the option of choosing a Tomcat service.

Is there some guide you can recommend (I didn't find one), or is there something I did wrong?


The "remote" Tomcat (or more generally the app server) must be configured to permit such connection.

Did you start the remote server with these parameters:

-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n

Alternatively you can add the word jpda at the end of the startup.sh (or .bat) script just when calling the catalina.sh script.

Everything is documented on the Apache Tomcat Wiki.

After enabling those options, you have also another task to do: enabling the network connection to the configured port (8000 in the above options). It depends which firewall is installed on the server but usually it is iptables.

Example of iptables command to enable connection to port 8000:

sudo iptables -A INPUT -p tcp --dport 8000 -j ACCEPT

If your server have a GUI installed, one easiest way is to use the "ufw" – short for 'uncomplicated firewall' as explained in this site which is just a graphical way to configure the iptables.

One way to test the connectivity to the server (if the port is open) is to use telnet from your computer like this:

telnet your.distant.host 8000

and if the command opens, the port is accessible, if the telnet command times out, the port is closed.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号