views:

24

answers:

2

I have a project which, for purposes of server configuration, is just a wicket quickstart archetype. I've added some application code, but haven't really done anything to change the default jetty configuration.

I can run and test my application locally using: http://localhost:8080 or: http://bekkar:8080 (my PC's network name) or: http://192.168.1.2:8080/ (my PC's local IP)

I want to access my wicket app from outside my router firewall. (I eventually will test it on my Blackberry, but for now I'm using Google Chrome to try to reach it externally.)

Using http://www.whatismyip.com/ I found my router's IP.

I use: http://###.###.###.###:8080 and I get a screen that says Authentication Required, asking for a username and password. I don't have any kind of authentication set up in my wicket app.

I have a NetGear router, WGR614v7. Using the router admin, under port forwarding, I add the following custom service:

Service Name=wicket
Starting Port=8080
Ending Port=8080
Server IP Address=192.168.1.2 //my computer's local IP

After adding the port forwarding service definition, I get a different message from Chrome: Oops! Google Chrome could not connect to ###.###.###.###:8080

How can I make my wicket jetty quickstart accessible from outside my router firewall? I don't know if this is a wicket/jetty issue (belonging on SO) or a firewall issue (belonging on serverfault), so I'll post it here, first.

Thanks!

+1  A: 

First, try with just simple apache, or woof. Be sure to bind it to 0.0.0.0 (all IPs). A) If you can't reach it, it's the router config problem. B) If that works, you know it't jetty/wicket config.

case A) I don't know that router, but look for port forwarding. I wasn't able to get ASUS WL500gP passing requests in, so I am not the right one to advice here :)

case B) Does Jetty bind to 0.0.0.0? Can you reach it from other machine on the local network?

Not much useful answer, but I hope it helps a bit.

Ondra Žižka
Thanks for these comments, I will try them out when I get the chance to
RMorrisey
+1  A: 

I run jetty/wicket apps on my system all the time and access them remotely. I don't think there is anything special that I've done with Jetty, and especially not wicket to make this work. But if it helps, here is an example Start.java file (this is from one of my apps -- not sure if it is the same as the one in quickstart, as I don't have a quickstart available right now):

public class Start {

    public static void main(String[] args) throws Exception {
        Server server = new Server();
        SocketConnector connector = new SocketConnector();

        // Set some timeout options to make debugging easier.
        connector.setMaxIdleTime(1000 * 60 * 60);
        connector.setSoLingerTime(-1);
        connector.setPort(8080);
        server.setConnectors(new Connector[] { connector });

        WebAppContext bb = new WebAppContext();
        bb.setServer(server);
        bb.setContextPath("/");
        bb.setWar("src/main/webapp");

        // START JMX SERVER
        // MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
        // MBeanContainer mBeanContainer = new MBeanContainer(mBeanServer);
        // server.getContainer().addEventListener(mBeanContainer);
        // mBeanContainer.start();

        server.addHandler(bb);

        try {
            System.out.println(">>> STARTING EMBEDDED JETTY SERVER, PRESS ANY KEY TO STOP");
            server.start();
            System.in.read();
            System.out.println(">>> STOPPING EMBEDDED JETTY SERVER"); 
            // while (System.in.available() == 0) {
            //   Thread.sleep(5000);
            // }
            server.stop();
            server.join();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(100);
        }
    }
}

I'm using a DLink router, so I'm not sure how to configure yours. However, you should also check your router to see if it has remote web admin turned on, and if it is on port 8080. If so, turn it off, as it might be interfering with your port forwarding.

Tauren
I tried changing the Jetty port to 4242, and changing the service definition, to see if that would do it. I still get the "Oops!" page in chrome, so it seems like this is not the issue. I also tried disabling my CA firewall. My Start.java looks like this one. +1 for the help anyway =)
RMorrisey
@Rmorrisey: I really think you should be looking more at your firewall and/or system configuration. Perhaps you have iptables, Norton, or some other firewall on your system in addition to your router's firewall. I am willing to bet that it is not related to your wicket configuration or implementation. Best of luck!
Tauren
Thank you! I am pretty sure you are right, I just haven't had time to sit down and experiment with it again
RMorrisey

related questions