Web Hosting Talk







View Full Version : tomcat 6.0.26 configuration help required


Anuj Shukla
03-22-2010, 12:15 PM
Hi All,

I have put up my test site at tomcat server and am currently using it using IP address.
http://XXX.YYY.ZZZ.TTTT:7001/<AppName>/welcome.html
Where XXX.YYY.ZZZ.TTTT is the IP address
7001 is the connector port
<AppName> is the application base folder in \webapps
welcome.html is default action for this struts2 application.

Tomcat server is located at C:\apache-tomcat-6.0.26 folder.
And appbase is <AppName> under C:\apache-tomcat-6.0.26\webapps folder.

I have got domain name registered and I have got it point to my server's IP address.

I am not able to configure tomcat to serve my website (say www.MYWEBSITE.com ).

I don't have any web server like apache to act as web server.
I am planning to use tomcat as web as well as application server.

Could someone help me on this and let me know what and how to configure server.xml (or any other configuration) to serve my website from tomcat.


Thanks,

Vinayak_Sharma
03-22-2010, 01:08 PM
From where are you testing the domain resolution, from within the network or from out side of that network?

Also I think you are on a DSL or Home connection, so have you properly done a port forwarding in the modem/router?

Status2K
03-22-2010, 01:15 PM
You'll need to configure tomcat to run on port 80.

You'll also need to get your applciation to run as the root application. You can do this by re-naming it to ROOT.war

That way tomcat should start responding to requests on port 80 for you ip address.

qwidjib0
03-22-2010, 01:34 PM
Status2k is right. You should be just fine not using Apache, but Tomcat will not function on port 80 by default. You'll be looking for a line like this in your server.xml file:

<Http10Connector port="7001"
secure="false"
maxThreads="100"
maxSpareThreads="50"
minSpareThreads="10" />


Change it to port 80.

Anuj Shukla
03-22-2010, 11:53 PM
Thanks Status2k & qwidjib0.
I could get it working for me, thanks a ton!

But if I have to rename my website as ROOT.war, then does it mean that I can host only one web application from tomcat? What if I want to serve a website with folder name as mynewroot.war where

root.war points to (say) www.firstNewWebSite.com
&
mynewroot.war points to (say) www.secondNewWebSite.com

How do I serve these two sites from my tomcat?


Thanks,

qwidjib0
03-23-2010, 11:54 AM
You can really do it however you want. It becomes more of a DNS discussion at that point, or I believe you can use vhosts if you want to host them at the same IP just like with httpd. Here you go:

http://www.ex-parrot.com/pete/tomcat-vhost.html


The name of your .war archive should hold no bearing on the URL used to access your servlet.

Status2K
03-24-2010, 04:33 AM
Personally I would use Apache in front of Tomcat, it's more flexible in how it can be configured.