• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to change Context

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am a newbie to Apache/Tomcat. Can someone guide me to achieve the following.

Instead of typing http://localhost:8080/, I want to type the web server name like http://webserver/ and this should take me to default web page.

I tried couple context name changes, but couldn't get them to work.

Any help is greatly appreciated.

Thanks,
R
 
Ranch Hand
Posts: 405
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you are trying to configure Apache and Tomcat together, you will need to download and install/configure the mod_jk connector. Depending on your operation system, there may already be a binary version, otherwise you may have to download the source and compile it.
The Apache Jakarta Tomcat Connector

If you are trying to configure Tomcat as a stand alone server. I believe you will have to modify the server.xml and change the port from 8080 to 80, beacause by default Tomcat listens to port 8080.
[ August 01, 2005: Message edited by: Craig Jackson ]
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@Craig: Is configuring Tomcat to listen on port 80 as easy as that? I seem to remember from years ago that it was essentially impossible to do that (unless you were actually running Tomcat as root).
 
Craig Jackson
Ranch Hand
Posts: 405
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To be honest, I am not exactly sure, I am running the Apache/Tomcat collaboration. I have not tried to run Tomcat as a stand alone server, but I know that there are several members who are and can elaborate more on the subject.
 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Running on port 80, which is the default http port and necessary to not have a port number included in the URL, means running the server as root on UNIX systems. Any process running on any port below port 1000 (I think) has to be start by root as a security check.
 
Jim Babcock
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Instead of typing http://localhost:8080/, I want to type the web server name like http://webserver/ and this should take me to default web page.



BTW, using "webserver" vs "localhost" is a DNS matter. localhost is (most likely) hardcoded to 127.0.0.1 in etc/hosts (or C:\WINDOWS\system32\drivers\etc\hosts). For your machine to be know on the web as whatever.net, you need someone with a DNS server to publish the name and link it to your IP address. Most companies and universities have the ability to do this, but if you are sitting at home with a cable modem, you'll have to someone to do it for you. There are some free services out there, do a google search. If you don't have a static IP, you'll need to software running that will dynamically monitor it and update the service.

That's probably way more simplified than you needed, but I wasn't sure...

Jimbus
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Running on port 80, which is the default http port and necessary to not have a port number included in the URL, means running the server as root on UNIX systems. Any process running on any port below port 1000 (I think) has to be start by root as a security check.



The privileged ports are the ones below 1024, but it can't be that running servers on those requires root privileges, can it? Surely not all web servers on this world are running as root?
That's what I was getting at, that you can run Apache on port 80 w/o being root, but you can't run Tomcat on port 80 w/o being root.
 
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ulf,

Apache is started with root privileges i.e. the listener on port 80 has super-user privileges.

Before it processes a request it uses suexec to start up a thread that is non-privileged (usually httpd) to handle that request.

Most daemons who listen on < 1024 on Unix style machines do much the same. I don't believe that you can do that in java, so tomcat listening on port 80 will have to run as root.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Lewin, thanks for the explanation. That makes perfect sense.
 
reply
    Bookmark Topic Watch Topic
  • New Topic