Solved

share resources for web and application server

Posted on 2008-10-08
3
142 Views
Last Modified: 2012-05-05
Hi gurus,

Here I got a problem to solve. There are two domains on my web server (e.g. domain S and domain W). Domain S will use the JSPs on application server.

Let's assumed I have a new form placed on application server and I wanna make use of those images and stylesheets on web server.

Is there any way I can configure in my apache and tomcat, so that I can do the followings?

e.g.
Types                  Availability
html                  Domain W
jsp                  Domain S

jpeg                  Domain W & Domain S
css                  Domain W & Domain S
js                  Domain W & Domain S


If so, what files I have to configure? I knew there are some XMLs but i am not too sure.

Thanks for your help.
0
Comment
Question by:manfredino
  • 2
3 Comments
 
LVL 4

Accepted Solution

by:
urgoll earned 125 total points
ID: 22675606
Greetings,
With their default configuration, apache will listen on port 80 and Tomcat on port 8080. Casual web users will access port 80, as that's the standard port for web traffic.

The usual way to handle you situation is to setup two virtualhosts on your apache server, one for each domain, and to tell apache to proxy requests to your JSP files to your tomcat server.

See snippet below for sample config. What this does is setup your apache server to answer requests for both domains and server static files from /var/www/html/domain-s or /var/www/html/domain-w depending on the domain being accessed. Additionaly, any request path that starts with /jsp to domain S will be forward to the tomcat server transparently to the user.

If this does not meet your needs, please let me know and I'll address your concerns.

Regards,
Christophe
NameVirtualHost *:80
 

<VirtualHost *:80>

    ServerAdmin webmaster@domain-w.com

    DocumentRoot /var/www/html/domain-w

    ServerName www.domain-w.com

    ErrorLog /var/log/httpd/www.domain-w.com-error_log

    CustomLog /var/log/httpd/www.domain-w.com-access_log combined

</VirtualHost>

<VirtualHost *:80>

    ServerAdmin webmaster@domain-s.com

    DocumentRoot /var/www/html/domain-s

    ServerName www.domain-s.com

    ErrorLog /var/log/httpd/www.domain-s.com-error_log

    CustomLog /var/log/httpd/www.domain-s.com-access_log combined

    ProxyPass /jsp http://localhost:8080/jsp

    ProxyPassReverse /jsp http://localhost:8080/jsp

</VirtualHost>

Open in new window

0
 

Author Comment

by:manfredino
ID: 22699718
Hi Christophe,

Thanks for your information, it helps me a lot!

As there are several XML files for Apache and Tomcat, they look quite similar but I am wondering if I have to modify all those serverl.xml / web.xml.

Thanks for your help again.

Cheers,
Manfred
0
 

Author Comment

by:manfredino
ID: 22700096
Assume here's my case.
1.      s-stuff https://s-stuff.MySite.com (secured stuff with JSP from application server)
2.      www      http:/www.MySite.com (mainly static stuff like html and images, etc)


If I'm browsing a page through https (e.g. https://s-stuff.MySite.com/abc.jsp) and there are some images for navigation menu.

Would these images derived from https://www.MySite.com/images/menu1.gif or http://www.MySite.com/images/menu1.gif?
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

706 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

19 Experts available now in Live!

Get 1:1 Help Now