aspose file tools*
The moose likes Tomcat and the fly likes Disabling http://sitename:8080 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Disabling http://sitename:8080 " Watch "Disabling http://sitename:8080 " New topic
Author

Disabling http://sitename:8080

Prateek Gupta
Greenhorn

Joined: May 31, 2010
Posts: 17

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...
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42283
    
  64
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.


Ping & DNS - my free Android networking tools app
Prateek Gupta
Greenhorn

Joined: May 31, 2010
Posts: 17

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
Marshal

Joined: Mar 22, 2005
Posts: 42283
    
  64
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.
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

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)


Regards, Rene Larsen
Dropbox Invite
vinoth Robert
Ranch Hand

Joined: Feb 02, 2011
Posts: 31

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?




vinoth.R
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

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

Joined: Feb 02, 2011
Posts: 31


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

Joined: Oct 12, 2001
Posts: 1179

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

Joined: Feb 02, 2011
Posts: 31

It works fine when call my ip in LAN
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Disabling http://sitename:8080