• 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

Disabling http://sitename:8080

 
Greenhorn
Posts: 17
Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have deployed a site using Tomcat 5. However, one problem im facing is that when i type the URL http://sitename:8080 from a remote machine, then the default Apache page gets opened.. How can I disable this??? Kindly help...
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's the web app set up in the TOMCAT_HOME/webapps/ROOT directory. If you don't want it, remove its contents, or -if you always want people to access the web app you've deployed- make the default page do a redirect to your web app.
 
Prateek Gupta
Greenhorn
Posts: 17
Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your reply
However, Using both these methods, I will not be able to see the tomcat homepage anywhere.
My requirement is that the page should not be visible to any remote computer, however at the same time, it should be visible to me as I need it for uploading web apps using Tomcat Manager.
Is there a way by which I can allow only certain IPs to view this page???
 
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
The ROOT web app has nothing to do with the manager web app. You can alter the former to your heart's content, and still be able to use the latter.
 
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can also add a <Host.....> section in "TOMCAT_HOME/conf/server.xml"

with the above Host config, you'll only be able to access the contents located in "TOMCAT_HOME/www/sitename.com" if it is called with "sitename.com" or "www.sitename.com" - localhost or 127.0.0.1 will still be the webapps folder.

If you then put a ROOT folder in "TOMCAT_HOME/www/sitename.com" then you can call the webpage without a context path

e.g.
sitename.com:8080 = www/sitename.com/ROOT
sitename.com:8080/test = www/sitename.com/test

localhost:8080 = webapps/ROOT
localhost:8080/test = webapps/test

The port # is the same on both hosts, because it is the same Server config (default port 8080)
 
Ranch Hand
Posts: 32
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi

i created a host in server.xml as you said.

its working when i call "http://mysite.com/ " in my local system. But its not working in LAN.


What to do to work in LAN?



 
Rene Larsen
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

vinoth Robert wrote:hi

i created a host in server.xml as you said.

i have created the dir "www" then i placed the mysite.com.war file in www.
mysite.com dir is created automatically.

then i created Root dir in "mysite.com".

but its not working when i call "http://mysite.com/ ".

is it correct? if wrong how to call it in browser?



When you use a WAR file like mysite.com.war, then the name of the application will be mysite.com - this means that it should be called like this: http://sitename/mysite.com

What I wrote is that you put a ROOT (in uppercase) folder in (depending on what you've written in Host->appBase) www/sitename.com, and this ROOT folder will act as your web application available at /.

The only thing you do with this configuration is to mirror the default webapps folder, where you also have a ROOT folder available at /, and then can install additional web application next to the ROOT folder.
 
vinoth Robert
Ranch Hand
Posts: 32
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


ya I got it and its working when i call "http://mysite.com/ " in my local system. But its not working in LAN.




What to do to work in LAN?
 
Rene Larsen
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

vinoth Robert wrote:


ya I got it and its working when i call "http://mysite.com/ " in my local system. But its not working in LAN.




What to do to work in LAN?


How do you call your server from another machine ??

Is there a local firewall that blocks port 80 on you server ??
 
vinoth Robert
Ranch Hand
Posts: 32
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

It works fine when call my ip in LAN

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic