Setting up a server at home

Discussion in 'Computer Science & Culture' started by Rick, Sep 1, 2009.

Thread Status:
Not open for further replies.
  1. Rick Valued Senior Member

    Messages:
    3,336
    OK, So well I got my static IP address from Comcast, and I am trying to figure out how to open 8080 up so as to do something like:

    http://my.ip.address.255:8080/hudson

    where hudson is an application deployed and running on my JBOSS application server. BTW When I do something like:
    http://localhost:8080/hudson, it works like a charm.

    Please Register or Log in to view the hidden image!



    Any ideas?
    Rick
     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. one_raven God is a Chinese Whisper Valued Senior Member

    Messages:
    13,433
    Is 8080 opened up on your firewall?
    Your ISP's firewall/proxy?
     
  4. Google AdSense Guest Advertisement



    to hide all adverts.
  5. Stryder Keeper of "good" ideas. Valued Senior Member

    Messages:
    13,105
    Rick,
    Sometimes ISP's have rigged their routers to drop packets on loopbacks. What this basically means is that if you try to find a webpage hosted on your own computer using your static IP, it detects a loop through the connection to the ISP and blocks it.

    What you'll have to do is either ask someone else on a different IP to access your system or use a proxy to check it yourself.

    (I mention webpage because it's the simplest way of debugging if such a loop is causing the packets to be blocked, since there are a number of Http proxies you can use to test with should you not see a result.)
     
  6. Google AdSense Guest Advertisement



    to hide all adverts.
  7. Rick Valued Senior Member

    Messages:
    3,336
    Stryder,

    Well basically my issue was that the server that I was running was bound to 127.0.0.1 instead of my static IP address, I was told by comcast people (my ISP) that 8080 is by default open, I don't need to do any port forwarding etc. Anyways, I got it all sorted out.

    But the issue is that now I am trying to do this, I want users to go to my domain (owned by Yahoo!), on which I created a sub-domain (something like: http://hudson.mydomain.org) and be redirected to my http://my.ip.address.255:8080/hudson thingie.

    I tried creating a web-page with index.html which has a meta refresh URL = my whole ip address thing, but It isn't working, it somehow is going to an infinite loop, What am I doing wrong? Any suggestions?

    Rick
     
  8. Stryder Keeper of "good" ideas. Valued Senior Member

    Messages:
    13,105
    The way I've usually done website setups like this, is using apache and a Virtualhost entry.

    What you do is you run apache bound to your static IP address (you can even bind it to a different port than 80, like 8080) You then create a virtualhost of hudson (or hudson.mydomain.org). You then point the yahoo subdomain hudson.mydomain.org to your IP and port (in this case 8080).

    What will happen then is when someone types in hudson.mydomain.org, you'd end up with the apache server serving the page up with the canonical name rather than just a meta refresh to an IP address. (of course it will say http://hudson.mydomain.org:8080 )
    In honesty though you should be able to bind and use port 80 which is a default http setting. Then you won't have to bother appending the port to your domain name.

    Just remember to check your firewall settings aren't blocking any in/out on the port you use, otherwise people won't be able to connect.

    Of course this is only good if you are after a webpage being hosted.

    If you are still having problems, trying creating a diagram, sometimes gaining a visual perspective on what you are trying to achieve can explain where the failures are occurring. You just have to step through the process like you would in programming(debugging), just with networking.
     
  9. Rick Valued Senior Member

    Messages:
    3,336
    I used this script to redirect for now, I know its not a perfect solution; but for now till I move to a permanent hosting provider, this should work:

    Code:
    <html>
    <head>
    	<script type="text/javascript" defer="defer">
    	 // Summary
    	 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    	 // For now we set the location instead of meta refresh tag which doesn't work
    	 ;( function (){
    		window.location = "http://0.0.0.0:8080/hudson";
    	 })();
    	</script>
    </head>
    </html>
    
    Addendum:
    0.0.0.0 = is any (but this is off course just to show the concept).
     
  10. RubiksMaster Real eyes realize real lies Registered Senior Member

    Messages:
    1,646
    Rick,

    If you're using JBoss 5.0.1 (maybe it's the same in earlier versions), you need to explicitly set the binding address, because by default, it grabs the first one it finds, which happens to be 'localhost'.

    So if you use the run.bat script to start it up, specify the "-b" parameter.

    So like:
    Code:
    run.bat -b your.ip.addy.here
    if you choose 0.0.0.0 it will use the system default, which might give you undesirable results.
     
  11. Rick Valued Senior Member

    Messages:
    3,336
    I am running JBOSS ... undesirable as in? I was doing a run using bind param, but I thought 0.0.0.0 would be much better since it works on any IP (much less hard wired).

    Any suggestions?
     
  12. RubiksMaster Real eyes realize real lies Registered Senior Member

    Messages:
    1,646
    In my experience, I have always had mixed results using 0.0.0.0 as the bind parameter. It usually works, but I've encountered a few machines here at work where it didn't actually bind to all of the interfaces.

    Try explicitly specifying the external ip address that you want it exposed on (not 0.0.0.0). That way at least you will know whether your bind parameter is wrong, and you could go from there.

    Or maybe you could do a 'netstat -ao' to see what addresses jboss is listening on.
     
  13. Rick Valued Senior Member

    Messages:
    3,336
    It works both ways for me; I just find its a much more holistic script option when I running a server, but OK, I'll keep my eyes open, Thanks!

    Please Register or Log in to view the hidden image!


    Rick
     
  14. RubiksMaster Real eyes realize real lies Registered Senior Member

    Messages:
    1,646
    Oh, then maybe I'm not really understanding the problem. My understanding is that you can only access your deployed application by using 'localhost' as the domain name, whereas using the IP address doesn't work.
     
  15. Rick Valued Senior Member

    Messages:
    3,336
    yes, that was the original problem, but then I fixed the issue by running using "run -b" (as you later on replied) and it worked

    Please Register or Log in to view the hidden image!

    Thanks for your input though.

    My second issue was setting up Hudson and my framework and couple of other open source projects up on my own domain (like subdomain.mydomain.org) to redirect to my static IP server address, which I fixed using the above script (a hack really till I get a decent Java hosting provider) ... Know of any good ones out there?


    Rick
     
Thread Status:
Not open for further replies.

Share This Page