![]() |
|
Модераторы: LSD, AntonSaburov |
![]()
|
|
| Egik2 |
|
|||
![]() Опытный ![]() ![]() Профиль Группа: Участник Сообщений: 302 Регистрация: 29.7.2008 Где: Агудзера Репутация: 2 Всего: 11 |
приветствую всех!!!
Возникла задача использования tomcatа как веб-сервера для развертывания приложения. При этом погуглив нашел советы, что обычно если tomcat смотрит в интернет используется обычный apachе с соответствующими модулями в качестве прокси к нему. Так вот, хочу совета от знающих людей, кто этим уже занимался. Стоит ли заморачиваться, усложнять архитектуру и использовать апач? В чем преимущества от этого, в чем недостатки? Заранее спасибо... -------------------- Три великие добродетели программиста: лень, нетерпение и самомнение (Larry Wall) a-nav.com developer-blog.ru world-poetry.org |
|||
|
||||
| powerOn |
|
|||
![]() software saboteur ![]() ![]() ![]() ![]() Профиль Группа: Участник Сообщений: 4367 Регистрация: 7.10.2005 Репутация: 28 Всего: 159 |
||||
|
||||
| Egik2 |
|
|||
![]() Опытный ![]() ![]() Профиль Группа: Участник Сообщений: 302 Регистрация: 29.7.2008 Где: Агудзера Репутация: 2 Всего: 11 |
Вот выдержка из апачевского вики:
Why should I integrate Apache with Tomcat? (or not) There are many reasons to integrate Tomcat with Apache. And there are reasons why it should not be done too. Needless to say, everyone will disagree with the opinions here. With the performance of Tomcat 5 and 6, performance reasons become harder to justify. So here are the issues to discuss in integrating vs not. * Clustering. By using Apache as a front end you can let Apache act as a front door to your content to multiple Tomcat instances. If one of your Tomcats fails, Apache ignores it and your Sysadmin can sleep through the night. This point could be ignored if you use a hardware loadbalancer and Tomcat's clustering capabilities. * Clustering/Security. You can also use Apache as a front door to different Tomcats for different URL namespaces (/app1/, /app2/, /app3/, or virtual hosts). The Tomcats can then be each in a protected area and from a security point of view, you only need to worry about the Apache server. Essentially, Apache becomes a smart proxy server. * Security. This topic can sway one either way. Java has the security manager while Apache has a larger mindshare and more tricks with respect to security. I won't go into this in more detail, but let Google be your friend. Depending on your scenario, one might be better than the other. But also keep in mind, if you run Apache with Tomcat - you have two systems to defend, not one. * Add-ons. Adding on CGI, perl, PHP is very natural to Apache. Its slower and more of a kludge for Tomcat. Apache also has hundreds of modules that can be plugged in at will. Tomcat can have this ability, but the code hasn't been written yet. * Decorators! With Apache in front of Tomcat, you can perform any number of decorators that Tomcat doesn't support or doesn't have the immediate code support. For example, mod_headers, mod_rewrite, and mod_alias could be written for Tomcat, but why reinvent the wheel when Apache has done it so well? * Speed. Apache is faster at serving static content than Tomcat. But unless you have a high traffic site, this point is useless. But in some scenarios, tomcat can be faster than Apache httpd. So benchmark YOUR site. Tomcat can perform at httpd speeds when using the proper connector (APR with sendFile enabled). Speed should not be considered a factor when choosing between Apache httpd and Tomcat * Socket handling/system stability. Apache has better socket handling with respect to error conditions than Tomcat. The main reason is Tomcat must perform all its socket handling via the JVM which needs to be cross platform. The problem is socket optimization is a platform specific ordeal. Most of the time the java code is fine, but when you are also bombarded with dropped connections, invalid packets, invalid requests from invalid IP's, Apache does a better job at dropping these error conditions than JVM based program. (YMMV) -------------------- Три великие добродетели программиста: лень, нетерпение и самомнение (Larry Wall) a-nav.com developer-blog.ru world-poetry.org |
|||
|
||||
| COVD |
|
|||
|
Эксперт ![]() ![]() ![]() Профиль Группа: Завсегдатай Сообщений: 1655 Регистрация: 26.7.2005 Репутация: 4 Всего: 43 |
Не стоит. Решайте проблемы по мере их возникновения, а не сразу "по уму", "грамотно" |
|||
|
||||
| Vasay |
|
|||
|
Эксперт ![]() ![]() ![]() ![]() Профиль Группа: Завсегдатай Сообщений: 2097 Регистрация: 8.3.2006 Репутация: 18 Всего: 73 |
Egik2,
если уж и использовать что в паре с TomCat - то nginx. Повесив на него статику. -------------------- Придумать идеальную защиту от дурака невозможно, дураки, наудивление, изобретательны. |
|||
|
||||
![]()
|
| Правила форума "Java" | |
|
|
Если Вам помогли, и атмосфера форума Вам понравилась, то заходите к нам чаще! С уважением, LSD, AntonSaburov, powerOn, tux. |
| 0 Пользователей читают эту тему (0 Гостей и 0 Скрытых Пользователей) | |
| 0 Пользователей: | |
| « Предыдущая тема | Java EE (J2EE) и Spring | Следующая тема » |
|
|
По вопросам размещения рекламы пишите на vladimir(sobaka)vingrad.ru
Отказ от ответственности Powered by Invision Power Board(R) 1.3 © 2003 IPS, Inc. |