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的更多相关文章

  1. 使用mod_cluster进行apache httpd server和jboss eap 6.1集群配置

    本文简单介绍,使用mod_cluster进行apache httpd server和jboss eap 6.1集群配置.本配置在windows上测试通过,linux下应该是一样的.可能要稍作调整.后面 ...

  2. Django部署到Apache Web Server

    Windows环境下,将Django部署到Apache Web Server 在Windows上部署Django(用mod_wsgi)会出现各种奇怪的问题,现简单记录下配置过程及遇到的错误及解决方法. ...

  3. 解决Apache Web Server的几个错误

    一.安装好Apache后服务里没有Apache服务 在命令行进入安装apache的bin目录下,输入命令 httpd.exe -k install -n Apache2.4 二.Apache web ...

  4. yum安装Apache Web Server后各个文件存放位置

    yum安装Apache Web Server后各个文件存放位置   用yum安装apache软件: yum -y install httpd 安装完成后,来查看理解yum安装软件的过程和安装路径.   ...

  5. kill 挂起 Apache Web Server

    [root@hadoop1 ~]# kill -l 1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL 5) SIGTRAP 6) SIGABRT 7) SIGBUS 8 ...

  6. 禁掉Apache web server签名 How to turn off server signature on Apache web server

    有的时候,我们为了从安全角度考虑,防止黑客恶意攻击.我们会隐藏掉server信息,比方,一般我们会发现例如以下信息. 我用的是centos (fedora, RHEL也一样) $ sudo vi /e ...

  7. XAMPP 1.8.2-2 Apache Web Server won't start, always stops immediately

    sudo apachectl stop apachectl是Apache超文本传输协议服务器的前端程序. 其设计意图是帮助管理员控制Apachehttpd后台的功能. MacOS中安装完Apache之 ...

  8. Windows环境下,将Django部署到Apache Web Server

    在Windows上部署Django(用mod_wsgi)会出现各种奇怪的问题,现简单记录下配置过程及遇到的错误及解决方法. 环境搭建                                   ...

  9. 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 ...

随机推荐

  1. 转 sqlserver字段描述相关操作sql

    可以自己查询系统表: SELECT o.name AS tableName, c.name AS columnName, p.[value] AS Description FROM sysproper ...

  2. [原创] SQLite数据库使用清单(上)

    1. 介绍 1.1 安装 访问 SQLite 下载页面,从 Windows 区下载预编译的二进制文件. 您需要下载 sqlite-shell-win32-*.zip 和 sqlite-dll-win3 ...

  3. java中XMLGregorianCalendar类型和Date类型之间的相互转换

    import java.text.SimpleDateFormat;import java.util.Date;import java.util.GregorianCalendar;import ja ...

  4. sql查询过程中 update,insert,delete可视化收影响行数

    insert into test_tb output inserted.id,inserted.data values('c'),('d') delete from test_tb output de ...

  5. Linux下使用NMON监控、分析系统性能 -转载

    原帖地址:http://blog.itpub.net/23135684/viewspace-626439/ 谢谢原帖大人 一.下载nmon. 根据CPU的类型选择下载相应的版本:http://nmon ...

  6. 【转】iOS- 详解文本属性Attributes

    原文: http://www.cnblogs.com/qingche/p/3574995.html?utm_source=tuicool 1.NSKernAttributeName: @10 调整字句 ...

  7. node http.request请求

    var http = require('http'); var querystring = require('querystring'); var path = '/cricket/getRecord ...

  8. request.getSession()

    request.getSession(); 与request.getSession(false);区别 服务器把session信息发送给浏览器   浏览器会将session信息存入本地cookie中 ...

  9. 装了SVN,你的关联图标变了没有?

    装了SVN,你的关联图标变了没有? 开始合作之后,装上了SVN,非常高效,我在VS写了一部分的代码,上传之后,别人通过下载或是更新,就更新到了合作同伴的VS里,相当于大家在一个VS里写代码.和保强他们 ...

  10. php基于数组的分页实现

    关于数组的分页函数,用数组进行分页的好处是可以方便的进行联合多表查询,只需要将查询的结果放在数组中就可以了以下是数组分页的函数,函数page_array用于数组的分页,函数show_array用于分页 ...