How can I enable remote debugging for the Jetty web server in Sophos XG?
To enable Jetty remote debugging, first locate the startup script at /usr/bin/jetty and remount the filesystem with `mount -o rw,remount /`. Add the JVM debugging parameter `-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:8000` to the exec line. Since the built-in OpenJDK lacks the debug library, replace it with a complete JDK (e.g., jdk-11.0.15) by backing up /lib/jvm/java-11-openjdk and extracting the new JDK there. Restart the service with `service tomcat:restart -ds nosync` and ensure the firewall allows port 8000 using `iptables -I INPUT -p tcp --dport 8000 -j ACCEPT`. You can then attach a remote debugger in an IDE like IntelliJ IDEA.
Jettyremote debuggingJDWPJDK replacementSophos XGtomcat