Solved

Setup tomcat on VPS

Posted on 2014-04-14
9
759 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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
LVL 62

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
 

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 62

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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
AWS New EC2 Instance and EBS Storage 2 85
Ways to assess https/ssl websites 3 103
.htaccess file settings 4 63
Why Xampp showing MySQL as Maria DB on Welcome Page ? 8 89
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…

829 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