Using Apache Web Server with Jboss AS 7
In real-world projects, it's common to find Apache web server as a front door to your application server. The advantages of such an architecture are as follows:
• Speed: Apache is generally faster at serving static content than
JBoss Web server.
• Security: The application server, which contains sensitive data, can then be
placed 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.
• Load balancing and clustering. By using Apache as a frontend you
can handle traffic to multiple JBoss Web server instances. If one of your
JBoss AS fails, the communication transparently continues to another
node in the cluster.
Connecting Apache and JBoss AS can be done by means of several libraries: in the past, most projects have adopted either Tomcat's mod_jk library or Apache's mod_proxy libraries. Because the installation of either mod_jk or mod_proxy does not differ from earlier AS releases, we will just include a quick setup guide for your reference.
If, however, you are planning to set up a high-performance, dynamic cluster of web servers, we suggest you migrate to the newer mod_cluster API.
Since Apache 1.3, there's support for an optional module, named mod_proxy, that configures Apache to act as a proxy server. This can be used to forward requests for particular web applications such as Tomcat or JBoss, without having to configure a web connector such as mod_jk.
So, mod_proxy just requires including the following directives in your Apache's httpd.conf file:
LoadModule proxy_module modules/mod_proxy.so
Then, include two directives in your httpd.conf file for each web application that you wish to forward to JBoss AS. For example, to forward an application at context path /myapp:
ProxyPass /myapp http://localhost:8080/myapp
ProxyPassReverse /myapp http://localhost:8080/myapp
This tells Apache to forward URLs of the form http://localhost/myapp/* to the JBoss HTTP connector listening on port 8080.
Apache's mod_proxy is TCP-based and uses the HTTP, so you don't need to add anything else in your JBoss configuration. By definition, this is the simplest way to put Apache in front of JBoss, but also the slowest way to do it .
In Apache 2.2, there's support for another module, named mod_proxy ajp, which can be used in much the same way as mod_proxy. However, it uses AJP protocol to proxy Apache requests to JBoss AS. In order to use it, add the following directive to your Apache configuration:
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
Then, enable proxy pass to JBoss AS with this directive:
ProxyPass / ajp://localhost:8009/
ProxyPassReverse / ajp://localhost:8009/
Here, we are simply redirecting all traffic ("/") to the web server listening on localhost at port 8009.
Since mod_proxy_ajp runs on a dedicated port, you have to activate it on your
JBoss side:
<subsystem xmlns="urn:jboss:domain:web:1.1">
<connector name="http" protocol="HTTP/1.1" socket-binding="http" scheme="http"/>
<connector name="AJP" protocol="AJP/1.3" socket-binding="ajp" />
<virtual-server name="localhost">
<alias name="example.com"/>
</virtual-server>
</subsystem>
. . . . . .
<socket-binding-group name="standard-sockets" default-interface="default">
<socket-binding name="http" port="8080"/>
<socket-binding name="ajp" port="8009"/>
. . . .
</socket-binding-group>
Using Apache Web Server with Jboss AS 7的更多相关文章
- 使用mod_cluster进行apache httpd server和jboss eap 6.1集群配置
本文简单介绍,使用mod_cluster进行apache httpd server和jboss eap 6.1集群配置.本配置在windows上测试通过,linux下应该是一样的.可能要稍作调整.后面 ...
- Django部署到Apache Web Server
Windows环境下,将Django部署到Apache Web Server 在Windows上部署Django(用mod_wsgi)会出现各种奇怪的问题,现简单记录下配置过程及遇到的错误及解决方法. ...
- 解决Apache Web Server的几个错误
一.安装好Apache后服务里没有Apache服务 在命令行进入安装apache的bin目录下,输入命令 httpd.exe -k install -n Apache2.4 二.Apache web ...
- yum安装Apache Web Server后各个文件存放位置
yum安装Apache Web Server后各个文件存放位置 用yum安装apache软件: yum -y install httpd 安装完成后,来查看理解yum安装软件的过程和安装路径. ...
- kill 挂起 Apache Web Server
[root@hadoop1 ~]# kill -l 1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL 5) SIGTRAP 6) SIGABRT 7) SIGBUS 8 ...
- 禁掉Apache web server签名 How to turn off server signature on Apache web server
有的时候,我们为了从安全角度考虑,防止黑客恶意攻击.我们会隐藏掉server信息,比方,一般我们会发现例如以下信息. 我用的是centos (fedora, RHEL也一样) $ sudo vi /e ...
- XAMPP 1.8.2-2 Apache Web Server won't start, always stops immediately
sudo apachectl stop apachectl是Apache超文本传输协议服务器的前端程序. 其设计意图是帮助管理员控制Apachehttpd后台的功能. MacOS中安装完Apache之 ...
- Windows环境下,将Django部署到Apache Web Server
在Windows上部署Django(用mod_wsgi)会出现各种奇怪的问题,现简单记录下配置过程及遇到的错误及解决方法. 环境搭建 ...
- What is the difference Apache (Http Server) and Tomcat (Servlet Container)
The Apache Project The Apache Project is a collaborative software development effort. Its goal is to ...
随机推荐
- PHP 通过随机数获得ASCII 值返回字符。
for($i=0;$i<20;$i++){ $Matrix .= chr(65 + rand(0,26)); }
- Web通信中的Get、Post方法
首先我们要了解Tomcat,Tomcat 服务器是一个免费的开放源代码的Web 应用服务器,属于轻量级应用服务器,在中小型系统和并发访问用户不是很多的场合下被普遍使用,是开发和调试JSP 程序的首选. ...
- 一个Socket数据处理模型
Socket编程中,如何高效地接收和处理数据,这里介绍一个简单的编程模型. Socket索引 - SocketId 在给出编程模型之前,先提这样一个问题,程序中如何描述Socket连接? 为什么这么问 ...
- 【POJ1442】【Treap】Black Box
Description Our Black Box represents a primitive database. It can save an integer array and has a sp ...
- cmd 命令行下复制、粘贴的快捷键
1.单击左下角“开始”菜单,选择“运行”,输入“cmd”. 2.在弹出的cmd窗口的标题栏上点击“右键”,选择“属性”. 3.在弹出的对话框中选择“选项”这个选项卡,在“编辑选项”区域中勾选“快速编辑 ...
- ubuntn 虚拟机NAT 静态IP 网络配置
在虚拟机安装ubuntu12.04自动获取IP 一切都没有问题 ssh连接也正常.关机重启后郁闷的发现网络已经不通了,于是开始了以下的摸索. 1.配置静态IP 网关: ip段: 命令: Vim /et ...
- java.math.BigDecimal类
BigDecimal类用于高精度计算.一般的float型和Double型数据只可以用来做科学计算或者是工程计算,由于在商业计算中,要求的数字精度比较高,所以要用到java.math.BigDecima ...
- dedecms织梦导航栏二级菜单的实现方法
dede导航下拉菜单,一级栏目增加二级下拉菜单 使用dedecms5.6——5.7 将这段代码贴到templets\default\head.htm文件里<!-- //二级子类下拉菜单,考虑 ...
- jQuery API中文文档
jQuery API中文文档 http://www.css88.com/jqapi-1.9/category/events/event-handler-attachment/ jQuery UI AP ...
- RemoteViews嵌入ListView复杂布局
from http://blog.csdn.net/liliang497/article/details/8308313 主要函数 public void setRemoteAdapter (int ...