Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

share resources for web and application server

Posted on 2008-10-08
3
Medium Priority
?
157 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 500 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

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

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses
Course of the Month5 days, 20 hours left to enroll

772 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