?
Solved

Sharing port 80 between IIS and Tomcan server on the same machine

Posted on 2010-09-02
6
Medium Priority
?
878 Views
Last Modified: 2012-08-14
hi, here is the situation:

we have two subdomains pointing to the same computer  (windows server 2008) and we are running IIS as webserver on one domain and Tomcat as webserver on another domain.  this is what we have now:

domain1.mycompany.com , ip 1.2.3.4 , IIS on port 80
domain2.mycompany.com , ip 1.2.3.4 , Tomcat on port 81

But it has become necessary to run both of them on port 80 and do routing based on the request (i guess by looking at the domain) .

How can i set this up in IIS and Tomcat? can anyone help ?

How can i
0
Comment
Question by:Softverkpro
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 20

Expert Comment

by:woolnoir
ID: 33585028
Its not possible (AFAIK) to have two services running on the same port/same IP in this way. Have you not considered adding another IP address to the NIC of the machine, and pointing each of the domains to separate IP's. That way you can have tomcat bound to 1.2.3.4:80 and iis bound to 1.2.3.5:80..

I know its not what you asked, but what scenario would you need two webservers on the same IP /port?
0
 
LVL 5

Expert Comment

by:helpnet
ID: 33585031
I suspect this will not work.  Is there a reason you cannot use two separate IP addresses?
0
 
LVL 3

Expert Comment

by:bobalob
ID: 33585037
You will need to add another IP to the NIC on this server ie 1.2.3.5 - you can do this in network connections from control panel, TCP/IP settings, advanced button.

once you have done this you need to bind IIS to one IP and Tomcat to the other (both port 80)

to bind IIS right click my comp, manage, services and apps, IIS, Web sites, right click web site and properties, choose IP address.

Not sure how to bind tomcat but it will be in one of the settings files (maybe server.xml) in the conf folder no doubt.

update your DNS to point domain1 to 1.2.3.4 and domain2 to 1.2.3.5
0
How Blockchain Is Impacting Every Industry

Blockchain expert Alex Tapscott talks to Acronis VP Frank Jablonski about this revolutionary technology and how it's making inroads into other industries and facets of everyday life.

 
LVL 5

Expert Comment

by:helpnet
ID: 33585041
(you beat me too it woolnoir)
0
 
LVL 9

Expert Comment

by:oheil
ID: 33585154
You propably want ot have a tomcat application served on the same domain or IP without needing clients to enter the specific port in their URL.
E.g.
http://www.yourdomain.com/    should give a website
http://www.yourdomain.com/application     should give a the tomcat application

And you do not like to have the application as
http://www.yourdomain.com:PORT/application

Let IIS route all request to http://www.yourdomain.com/application through internally to the tomcat server, which runs on another port. Configure IIS as a proxy for the tomcat server, which runs on the same machine but internally on another port. This port needs only be bind to localhost.

Regards,

Oli

0
 
LVL 15

Accepted Solution

by:
samri earned 2000 total points
ID: 33585200
hi Softverkpro,

I believe what you need is a method to divert to the corresponding server according to the request from client.  This could be done in Apache using VirtualHosting and Reverse Proxy facilities.

If you are stucked with IIS and Tomcat on the same box,  I would believe that this could be achieved as well.  

However, being naive on both IIS, and Tomcat, and with little experience on Apache, I would -

1.  setup up apache -- to listen on port 80
2.  Configure Tomcat to listed on 81
3.  configure IIS on port 82
4.  On apache, configure VirtualHosting -- one vhost for each servername - iis, and
5. setup reverse proxy for aeach ot the respective server:port

Some prev post on this subject.

http://www.experts-exchange.com/Software/Server_Software/Web_Servers/Apache/Q_23520183.html
http://www.experts-exchange.com/Software/Server_Software/Web_Servers/Q_22519249.html
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

Lync server 2013 or Skype for business Backup Service Error ID 4049 – After File Share Migration
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

770 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