GeeCON Prague 2014*
The moose likes Tomcat and the fly likes Using PC as server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » Tomcat
Bookmark "Using PC as server" Watch "Using PC as server" New topic
Author

Using PC as server

colin shuker
Ranch Hand

Joined: Apr 11, 2005
Posts: 744
Hi there,
I'm using netbeans 3.5 with its version of tomcat (4.0.1 is it?)
I'd like to use my PC as a server, so people can access my web
applications.
I know I have to use my IP address, but I'm not sure exactly
what address needs to be inserted into browser to access my web
applications.
Please can someone help me with this, I'm sure its possible, and
I would love to share my programs with people.

Thanks very much
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
You need to have either a real/live IP or a servlet web hosting service.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42058
    
  64
That depends on what your network setup is. If you're behind a firewall, possibly a NATed one, your machine probably isn't accessible from the outside without some configuration. Your sys admin can tell you what the IP is in that case (although he will have security objections about doing this). If you have a direct permanent connection with a static IP (through DSL or broadband), you can look it up in your network settings. If you have changing IP addresses, a servic elike DynDNS can help you.


Ping & DNS - my free Android networking tools app
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

From the machine with Tomcat running on it, open a browser and go to:
http://www.whatismyip.com
That will tell you what your external IP is.

If you don't have a static IP number, there is a chance it could change.
Some internet providers block incoming traffic on port 80 (mine does) because they really don't want people running webservers from their houses.

Read Ulf's post about DynDNS for workarounds.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
colin shuker
Ranch Hand

Joined: Apr 11, 2005
Posts: 744
Hi again,
I think I might need to change the settings on the modem to allow
access to the pc. I am currently using Broadband and have wireless connection.

Anyway, I opened a new folder in C called netbeansprogs,
then inside netbeans 3.5, I mounted the file system netbeansprogs.
and added a simple html page (Hello.html)

When I execute this from within netbeans 3.5, the address is
http://localhost:8081/Hello.html
I've found out my IP address, assuming this is WWW.XXX.YYY.ZZZ, then
to access the Hello.html page, would the address be..
http://WWW.XXX.YYY.ZZZ/localhost:8081/Hello.html ???

This doesn't seem right though, since I could have 2 filesystems each
with an Hello.html file, so surely the address needs to include the
netbeansprogs directory??

Please can someone explain what address I should use to access the
Hello.html file

Thanks very much for your time and help.
[ December 30, 2005: Message edited by: colin shuker ]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42058
    
  64
I'm not familiar with the mounted file systems of NetBeans, or its built-in server, but this

is not going to work. localhost is actually the name of your local machine, and is the equivalent of the address 127.0.0.1. Externally, it might be
, but you can only have a single server running on port 8081, so the netbeansprogs directory doesn't really figure into it.
[ December 30, 2005: Message edited by: Ulf Dittmer ]
colin shuker
Ranch Hand

Joined: Apr 11, 2005
Posts: 744
Thanks I tried the address you said, but it didn't work.
I might need to fiddle around with the netbeans settings.
I'm not sure
Thanks anyway
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using PC as server