rookie wants makeshift home website

Felecha

Golden Member
Sep 24, 2000
1,434
0
0
Here's the deal.

I'm starting out, trying to build my skills, become employable. I study stuff on my own, buy a book, figure out how to do things. I wrote a webapp for the small school where my wife works. It's actually very useful. I put it on Tomcat, built the database, wrote all the servlets, etc. So far it has only been deployed on my home network and on the network at the school.

I would like to be able to put on my resume -- "Here's what I can do. Click over to ****** and look at my webapp, play around with it, look at the copy of the source to see what my coding looks like ..."

I could let people mess it up even, and restore it from backups whenever I need to. I started looking into the cheapest possible way of getting it hosted, but someone said -- hey, you've got a cable internet connection, and your ISP gives you a small webspace for static stuff. Just put a page out there with a link to your IP at home, and people can go there and click and it will take them right to your app on your home box.

Sounds too good to be true, that I could have my own home website, although I would probably do it without even bothering with a domain name. The link would just point to my IP. I tried it already, just using the IP, and sure enough it brings up the DHCP setup program on my router, just as if I typed it in from my desktop.

But I don't know much yet about security (working hard at learning everything, but it takes time). And I have a home network, so the IP goes to the modem and it's DHCP at that point on to my several computers. I've tried to figure out what the address would be. From inside the router, it's just <machine-name>:8080/appname/index.jsp, but I can't figure out what it would look like from outside.

Anyone want to chip in?

 

xSauronx

Lifer
Jul 14, 2000
19,582
4
81
youd have to have a web server, and point the router to forward requests to your ip to that server on your network

but your isp may have limitations. daily traffic limits, is your ip static or dynamic...does your ISP ALLOW for you to run a server on your cable connection? most dont. i have cox cable internet, the TOS states you arent allowed to run a server without getting permission beforehand. some providers may not notice if you even do if you dont have much traffic to it.

check with your isp about hosting, or running your own server on your connection. may be beneficial to get a static ip, may not. but will definitely be benificial to check with your provider so you dont get yourself in trouble and your service terminated.
 

Felecha

Golden Member
Sep 24, 2000
1,434
0
0
xSauronx - I have tomcat installed on my home machine, and the app deployed to it. It is set by default to listen on 8080. I was already on the phone today with the help desk at the ISP, talking about things, and that guy didn't mention anything about it being a problem, although I didn't ask directly "Is this idea OK?". I should ask someone explicitly, it seems. We were talking about static IP's, which mine is not, but he looked in the log and it hasn't changed in months. I thought since there would be essentially no traffic, just a very rare employer who bothered to look, that I could check it myself and change the link, if needed. Or put up an error message if it failed, with my email to notify me. Just playing with ideas.

JackMDS - thanks, I'll look

What do you mean, "point the router to forward requests"? I'm still learning, and that's something I don't know about.
 

Felecha

Golden Member
Sep 24, 2000
1,434
0
0
Beginning to wonder, since I'm such a beginner still - I have a server, Tomcat, but is that perhaps not what I need for a WEBSERVER? It is what is running my webapp as I use it on a local network, but is that why all my efforts to find ways to call to it (it uses its default of 8080) are not working? I had a course in school where we used Apache, but back then our assignments were CGI stuff, and my present app is java jsp's and servlets. Is tomcat just a local server and it needs Apache or something like if for requests from outside?
 

Buddha Bart

Diamond Member
Oct 11, 1999
3,064
0
0
Tomcat can be a regular webserver, but its generally nowhere near as good at or more importantly well documented for doing so. Typically people will use apache as the webserver, and then install a 'worker module' such as mod_jk or mod_webapp, that is configured to say "all requests for /webapps/blah/ are handed off the tomcat for being served by the blah servlet.

You could also write yourself a bash script (though perl might be easier) that ran an "ifconfig" every day, and parsed out your IP address. It would then comapre it to what it stored in a file the day before. If it had changed, it would ftp into your ISP's hosting space and do a search and replace for your IP in any links on your html pages.
A slightly easier option would be to sign up for one of those free dynamic dns services and installing one of their client applications.

Back to your original point, here's a list of the 'worker modules' from tomcat's documentation:
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/connectors.html

Here's some documentation for it:
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jk2/index.html

If you're not going to be doing anything but jsp/servlets though you may not want to bother.
 

Felecha

Golden Member
Sep 24, 2000
1,434
0
0
Buddha - that idea of the daily dynamic update of the link was also suggested to me by the guy with the original idea. Cool, and I might try it. I have just barely enough skills to do it, and a good little challenge. Still a beginner.

But for me right now the big question is how to get a request to go through the router to the correct box on the network and to its 8080 and the app. What would be the URL for the link on the public page? xSauronx said to " point the router to forward requests to your ip to that server on your network". How? I went into the DHCP setup utility (Linksys BEFSR41) and found a tab for Forwarding and set both 80 and 8080 to point to the server machine, and I read in the tutorial that JackMDS suggested, that I have to set the IP for the server as a static IP, so I did that. Beyond that, I don't know what to do. What's the link supposed to say? I tried just <IP-address> and <IP-address:80> and they both got me the login for the router setup, followed by the setup itself. Not what I want available from the web. Any help?
 

ClearToLand

Member
Jul 9, 2001
90
0
0
Originally posted by: Felecha:

But for me right now the big question is how to get a request to go through the router to the correct box on the network and to its 8080 and the app. What would be the URL for the link on the public page? xSauronx said to " point the router to forward requests to your ip to that server on your network". How? I went into the DHCP setup utility (Linksys BEFSR41) and found a tab for Forwarding and set both 80 and 8080 to point to the server machine, and I read in the tutorial that JackMDS suggested, that I have to set the IP for the server as a static IP, so I did that. Beyond that, I don't know what to do. What's the link supposed to say? I tried just <IP-address> and <IP-address:80> and they both got me the login for the router setup, followed by the setup itself. Not what I want available from the web. Any help?
Sounds like you're "close", but "no cigar" yet...

  • Assign the PC running the web server a static IP, on the same subnet, but outside the range allotted to the DHCP server in the router. (You can leave the port at 80 since you are the only one able to access it "locally" and you'll save yourself some keystrokes when testing. If you give the range 192.168.0.1 thru 192.168.0.20 to the DHCP server, use something like 192.168.0.100 for your web server.
  • Next, look for a "Virtual Server" setup page in the router. It will associate a "port" with a specific PC on the local LAN. Pick a non-standard port to avoid being hammered by the "script kiddies" (avoid 80 or 8080). Assign port 8123 to PC 192.168.0.100.
  • The IP address that you give out is the public IP address assigned to the router (not a 192.168.xxx.yyy address), with the non-standard port number appended. Give out your public IP address with the non-standard port to your prospective employers (i.e. 24.123.456.78:8123)
  • When the router sees a request come in for port 8123, it will re-direct it to PC 192.168.0.100, and the index.htm or default.htm page will display.
Originally posted by: Felecha:

I'm starting out, trying to build my skills, become employable. I study stuff on my own, buy a book, figure out how to do things.
Same thing here - bought a TON of books via Half.Com over the past few months. Let me know how you make out...
 

Felecha

Golden Member
Sep 24, 2000
1,434
0
0
Ok, that's pretty much what I've done.

Server machine is set to 192.168.1.10, static

DHCP range is set to 100 and up, 10 users

reset the port in Tomcat and rebooted and verified that I can get to the app through 8123

set the forwarding in the Linksys Setup utility to sent 8123 to 192.168.1.10

still get the "Page not found" error

BTW, for fun I connected my desktop straight to the cable modem, so the IP was direct to my desktop. I edited the link in my public webpage, and went to the house next door and clicked to the page and clicked the link and sure enough, there was my webapp -- bingo! So using the IP with the port appended will work, but something is wrong with the forwarding still.
 

Felecha

Golden Member
Sep 24, 2000
1,434
0
0
I don't care for cigars generally, but I really want this one. Thanks for the help
 

ClearToLand

Member
Jul 9, 2001
90
0
0
Originally posted by: Felecha:

reset the port in Tomcat and rebooted and verified that I can get to the app through 8123
No. Set Tomcat to port 80.

Originally posted by: Felecha:

set the forwarding in the Linksys Setup utility to sent 8123 to 192.168.1.10
Yes. 24.123.456.78:8123 Public gets routed to 192.168.1.10:80 Private. [To confirm, your entire LAN is on subnet 192.168.1.xxx?

Originally posted by: Felecha:
still get the "Page not found" error

BTW, for fun I connected my desktop straight to the cable modem, so the IP was direct to my desktop. I edited the link in my public webpage, and went to the house next door and clicked to the page and clicked the link and sure enough, there was my webapp -- bingo! So using the IP with the port appended will work, but something is wrong with the forwarding still.
This part sounds wrong - your direct connect shouldn't have an appended non-standard port. By using port 80 on Tomcat, you can leave the port off (which is probably what the Linksys software is "assuming"). So, the Linksys is trying to route to 192.168.1.10 (which assumes :80), but you have it at 192.168.1.10:8123.

Like I initially said, put the Tomcat at port 80, but use port 8123 appended to your Public IP to tell the Linksys "Virtual Server" which PC to route to.

Send me a PM with your Public IP if you like and I'll play around with it...

 

Felecha

Golden Member
Sep 24, 2000
1,434
0
0
Still something missing

Yes, my LAN is 192.168.1.xxx

I set tomcat port to 80 in server.xml, rebooted, verified with fport that 80 is now running tomcat.exe. Also I can call from my laptop to just 192.168.1.10 and it gets the Tomcat home page, so just calling the LAN IP for my desktop is going to the assumed 80 there.

And forwarding is set for 8123 -> 192.168.1.10

I've tried it both with DHCP enabled and the range set to 100-120, and with DHCP disabled (BTW, do I really need DHCP? I've only got 4 home computers and they never move, can't I just give them all statics for 192.168.1.xxx and be done?).

But again, from outside I only get "Page not found" when I call <modem-IP-address>:8123

???
 

Felecha

Golden Member
Sep 24, 2000
1,434
0
0
just now I tried 192.168.1.1:8123, thinking that would do a forward. Same thing, page not found
 

ClearToLand

Member
Jul 9, 2001
90
0
0
Originally posted by: Felecha:

I set tomcat port to 80 in server.xml, rebooted, verified with fport that 80 is now running tomcat.exe. Also I can call from my laptop to just 192.168.1.10 and it gets the Tomcat home page, so just calling the LAN IP for my desktop is going to the assumed 80 there.
Now that Tomcat is on Port 80, go next door again and try it. I recall having problems testing out my web and ftp servers from the LAN (behind the firewall / "Virtual Server"). I got "more accurate" results using my dialup account and coming in from "outside".

Originally posted by: Felecha:

And forwarding is set for 8123 -> 192.168.1.10

I've tried it both with DHCP enabled and the range set to 100-120, and with DHCP disabled (BTW, do I really need DHCP? I've only got 4 home computers and they never move, can't I just give them all statics for 192.168.1.xxx and be done?).
Yes. Works just as well. Just for the "learning experience", I have my servers at static addresses and everything else at dynamic - more "real world", eh?

Originally posted by: Felecha:

But again, from outside I only get "Page not found" when I call <modem-IP-address>:8123

???
From next door?
 

Felecha

Golden Member
Sep 24, 2000
1,434
0
0
here I am next door, same failure

I found in the Help at the Linksys Setup tab for Forwarding, it said that "For this to work, DHCP must be disabled". So I did that. I have all 4 of my family's computers set to static now, so I expect that's OK.

But, no luck here. I tried not just the link, but a direct http://xxx.xxx.xxx.xxx:8123 and same thing.

It's just not forwarding
 

ClearToLand

Member
Jul 9, 2001
90
0
0
Originally posted by: Felecha:

here I am next door, same failure

I found in the Help at the Linksys Setup tab for Forwarding, it said that "For this to work, DHCP must be disabled". So I did that. I have all 4 of my family's computers set to static now, so I expect that's OK.
IMHO, that's only a CYA warning - they want the PC that's the object of the re-direct to be static. Using the mix of static and dynamic that you had before s/b just fine...

Originally posted by: Felecha:

But, no luck here. I tried not just the link, but a direct http://xxx.xxx.xxx.xxx:8123 and same thing.

It's just not forwarding
Have you rebooted the Linksys after changing settings? Go to their site and search their Tech Support. Also, try some Google searches. I've got to repair a jammed drive belt on my mower and cut some WAY OVERGROWN grass, so, I'll be "away" for a few hours. I am interested in the final solution though...

 

Felecha

Golden Member
Sep 24, 2000
1,434
0
0
rebooted the linksys (that is, I stuck the straightened paperclip into the little hole till the red light went on).

I also found in the Help in the Filters tab the following:

Block WAN Request

This feature is designed to prevent users from attacking through the internet. When it is enabled, the router will drop both the unaccepted TCP request and ICMP packets from WAN site. The hacker will not find the router by pinging the WAN IP address.

That sounded promising. It was enabled, so I thought the router was simply refusing to let anything in from outside. But when I disabled it, rebooted, everything, still fails.
 

Felecha

Golden Member
Sep 24, 2000
1,434
0
0
I also just found that rebooting the router clears out everything I had set. The password was back to default, DHCP was reset to enabled and the default range, the 8123 forwarding was gone. Glad I found it, it was an accidental discovery.
 

ClearToLand

Member
Jul 9, 2001
90
0
0
Originally posted by: Felecha:

Block WAN Request

That sounded promising. It was enabled, so I thought the router was simply refusing to let anything in from outside. But when I disabled it, rebooted, everything, still fails.
Disable SPI per Google - LOTS of messages there regarding "Linksys 'Port Forwarding'" - take a look - gotta get back to mower...

 

Buddha Bart

Diamond Member
Oct 11, 1999
3,064
0
0
Felecha:

First just to check: things work find inside your LAN, you just can't get them to work from outside (crossing through the router)?

Make sure the forwarding is setup cable-modem-IP:external-port -> server-internal-IP:internal-port

Which in this case would be something like 24.x.x.x:8123 -> 192.168.1.10:80
 

Felecha

Golden Member
Sep 24, 2000
1,434
0
0
Bart -

Things work fine inside the LAN in the sense that I can get to the app on my desktop from any other machine on my network, just calling to <machine-name>/<webapp-name>. The machine picks up the request without even a port, since tomcat is listening on 80, which I now understand to be a default port for any unspecified http request (am I getting that right, didn't know it before this thread), just like the index.html is called without even mentioning it.

I can also get to the app from out in the world, by pulling the router out and plugging my desktop straight into the cable modem (and setting the desktop from 192.168.1.10 to "Obtain IP automatically"). Then a call from outside to <modem-IP-address>/<webapp-name> also will do just fine.

It's when the router is there, and I try to get in from outside by giving it a forwarding port number, that fails.

In the Linksys Setup program, which I get into the browser by just going to http://192.168.1.1, there's a tab-page for Forwarding, where all I get is little textfields, and I can only enter the last octet of the IP -- 192.168.1.___. There's no way to add a port as a suffix, as far as I can see. I guess that means Linksys can forward any request on a designated port, but only to the http default on the target machine (I will guess that ftp requests go to the ftp default?).

So I understand your suggestion, but don't know if I can do it
 

Felecha

Golden Member
Sep 24, 2000
1,434
0
0
I found on a website question someone said

For some reason I could not forward port 80 through my Linksys Router.
The settings were there but it would not do it. I read about setting
your max MTU to 1492 to fix this problem and it worked. Just to let
you know.

I tried that but again no luck
 

ClearToLand

Member
Jul 9, 2001
90
0
0
Just came in to sharpen the mower blade on the grinder (and stopped by to see where you were at). Found this on Google (why aren't you looking there too?):
I spent several days trying to make FTP and Web servers work on the Linksys
BEFW11S4 router and I finally got it That's ports 20-21 and 80.

Here is how I did it.

1) The machine you will be forwarding like 20-21 or 80 must use one of the
router's static IP(s). This means you will have to go to the machine's
TCP/IP properties as follows:

a) Set - Use the following IP address
1) IP = 192.168.1.2 --- 2 through 99 are static IP(s), and 100
and out are DHCP IP(s)
2) Subnet = 255.255.255.0
3) Default Gateway = 192.168.1.1 --- the router's IP.

b) Set - Use the following DNS server addresses:
1) Preferred DNS server = ISP's IP
2) Alternate DNS server = ISP's IP

2) You can find what the ISP's IP(s) are by using that Status tab on the
router. You will need the first two DNS IP(s). And while you're there go
over to Port Forwarding and change IP to be forwarded to the static IP you
created for the machine.

4) SPI must be disabled.

5) Block WAN must be enabled.

6) reboot the machine and make sure you can access the Internet. If you
cannot access the Internet, one of the IP(s) you have entered is wrong.

7) This is for testing only. If you have a software firewall on the machine
or where ever it is located, either disable the firewall or ACCEPT all IP(s)
on the ports you are trying to test.

This worked for me and I hope it works for you --- it should work.

If doesn't, take two aspirin and go to bed.

Duane