Solved

share resources for web and application server

Posted on 2008-10-08
3
143 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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
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…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

911 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

25 Experts available now in Live!

Get 1:1 Help Now