Solved

Setup tomcat on VPS

Posted on 2014-04-14
9
729 Views
Last Modified: 2014-04-22
Hello there,

I have a VPS machine and I installed Tomcat on it. I tested the tomcat by running the localhost:8080 on the VPS and it works as expected. Now how do I config tomcat so when I enter the ip address of the vps I can see the tomcat home page.

cheers
Zolf
0
Comment
Question by:zolf
  • 4
  • 3
  • 2
9 Comments
 
LVL 35

Accepted Solution

by:
mccarl earned 500 total points
ID: 40002879
If http://localhost:8080/ works for you then (lets assume that your IP is 123.123.123.123) does the following also work? http://123.123.123.123:8080/

If not, then you have some routing/firewall issues to sort out to be able to access your server.

But if the above DOES work, then is the question that you have just.... How to get rid of needing to add the 8080 part? ie. you want to access it via http://123.123.123.123/

For this you need to edit the "server.xml" file that is in the "conf" directory of your Tomcat insallation. In that file, find a line that looks something like...
<Connector port="8080" protocol="HTTP/1.1"

Open in new window

...and change the port number to port 80, as below...
<Connector port="80" protocol="HTTP/1.1"

Open in new window

Now, restart Tomcat and assuming that there are no other web servers running on port 80 on this machine, it should start up fine and then you can access Tomcat via a URL similar to the above.
0
 

Author Comment

by:zolf
ID: 40003156
mccarl

thanks a lot for your comments.

 
does the following also work? http://123.123.123.123:8080/

no it is not working.
I have also setup IIS on that server for ftp features. Now when I type the IP only it shows me the IIS default page. But when I enter the ip with the 8080 in the browser it is not opening the tomcat default page.
0
 
LVL 35

Expert Comment

by:mccarl
ID: 40003177
no it is not working.
Ok, so I can only think of two issues that it could be...

- Firewall that is allowing traffic on port 80 but denying traffic on port 8080
- Check your "server.xml" file that I mentioned above, and in the <Connector> element that references port 8080, check that there is NO "address" attribute set. If there is anything like address="127.0.0.1" or such, remove that attribute from the connector and it should start listening on all IP addresses.
0
 
LVL 61

Expert Comment

by:gheist
ID: 40003245
What procedure you used to "install" tomcat? e.g. I unzip the zip file and that one listens on all addresses.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:zolf
ID: 40004723
mccarl

thanks for your comments. I will check firewall and get back


gheist

I used the .exe package to install tomcat. I used all default settings.as I mentioned I have IIS listening on port 80 and I have tomcat on 8080.

by the way is it possible to run the tomcat with entering that 8080,but also have IIS running.
0
 
LVL 61

Expert Comment

by:gheist
ID: 40005353
So it listens on all IPs
You have to configure firewall, depending on your windows version you may need to allow server access for java.exe, tomcat service .exe, port 8080, or more than one of them...
0
 
LVL 35

Assisted Solution

by:mccarl
mccarl earned 500 total points
ID: 40005587
by the way is it possible to run the tomcat with entering that 8080,but also have IIS running
Yes, it is possible to have IIS act as a sort of "proxy" for the Tomcat requests using a protocol known as AJP. In this sense, you can install a "redirector" in your IIS that intercepts a subset of the requests directed to IIS and passes them (via this AJP protocol) to your Tomcat instance. Have a look at this (just one particular) example of a IIS-AJP "redirector"...
http://tomcatiis.riaforge.org/

I will check firewall and get back
That is (as far as I can tell) probably the only possibility for why this isn't working now, if you have "used all default settings" from a default installation of Tomcat.
0
 

Author Closing Comment

by:zolf
ID: 40009996
cheers
0
 
LVL 35

Expert Comment

by:mccarl
ID: 40016473
Your welcome! :)
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now