Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: Apache & Tomcat |
|
Author |
|
Xenobius
Joined: 13 Jul 2013 Posts: 2 Location: Malta
|
Posted: Sat 13 Jul '13 14:33 Post subject: Apache & Tomcat |
|
|
Hi all, I am new here and I would like to thank you for your time reading my query.
Problem: I host my online shop with a private hosting company and it is becoming expensive. Now I decided to host everything on my personal server. I have 2 websites.
I was told that if my shop contains lots of images and other static content, it would make sense to use Apache and integrate it with Tomcat and so I did using this guide. http://www.ntu.edu.sg/home/ehchua/programming/howto/ApachePlusTomcat_HowTo.html
Questions:
1. Apache is running on port 80 while Tomcat is running port 8080. Should Apache be the one accepting requests? (only port 80 will be accessible from outside)
2. I put a simple jsp file in Tomcat and accessed it from Apache and it worked. Is this the way to go? If so how will Apache know when to send out static content? I mean I intend to have lots of images... if they are in Tomcat, how will Apache serve them quickly?
3. If I have 2 websites with the aim of hosting them on a single IP, where should I do this configuration? Apache, Tomcat or both?
I would be very grateful if you could remove all these doubts so that I can continue searching and learning the right way.
Thanks
X |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Tue 16 Jul '13 16:17 Post subject: Re: Apache & Tomcat |
|
|
Xenobius wrote: |
Questions:
1. Apache is running on port 80 while Tomcat is running port 8080. Should Apache be the one accepting requests? (only port 80 will be accessible from outside)
|
Yes
Xenobius wrote: |
2. I put a simple jsp file in Tomcat and accessed it from Apache and it worked. Is this the way to go? If so how will Apache know when to send out static content? I mean I intend to have lots of images... if they are in Tomcat, how will Apache serve them quickly?
|
You should exclude the path of the static content to your rewriting / mod_jk proxying.
Xenobius wrote: |
3. If I have 2 websites with the aim of hosting them on a single IP, where should I do this configuration? Apache, Tomcat or both?
|
You can use a single IP if you use v(irtual)hosts |
|
Back to top |
|
Xenobius
Joined: 13 Jul 2013 Posts: 2 Location: Malta
|
Posted: Tue 16 Jul '13 22:44 Post subject: |
|
|
Thanks for your reply. Could you kindly:
2. Explain how please?
Oh and I managed to use VHosts in apache and in Tomcat and I managed to get through to 2 websites from one IP.
Thanks a lot
X |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
|
Back to top |
|
|
|
|
|
|