Solved

share resources for web and application server

Posted on 2008-10-08
3
147 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
[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
  • 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
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…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

756 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