0

我想将我现有的 apache 与新的 glassfish 安装“结合”起来。Apache 在端口 80 上运行,glassfish 的部署工件正在侦听 8080。

Glassfish 安装了 X Server 的特定用户和开发人员权限“userX”。Apache 默认以“www-data”权限运行。

是否有机会以用户不会意识到重定向的方式将特定子域的所有数据(如“glassfish.localhost”)内部从端口 80 链接到 8080?

我意识到权限和凭据也存在问题。

你有想法吗?

4

1 回答 1

0

You need to configure an AJP connector between Glassfish and Apache using Apache mod_jk plugin.

By default glassfish has an AJP connector on port 8009, so you need to configure apache with a jk worker using the same port, and set a virtual host "glassfish.yourdomain.ext" using this worker.

The steps are :

1- install mod_jk plugin on apache and configure an AJP worker ajpworker using a worker.properties file containing :

worker.list=ajpworker
worker.ajpworker.type=ajp13
worker.ajpworker.host=localhost
worker.ajpworker.port=8009

2- configure apache to load mod_jk with the worker.properties file above, and redirect your subdomain to ajpworker by definig a virtual host :

LoadModule jk_module modules/mod_jk.so
JkWorkersFile /etc/httpd/workers.properties
JkLogFile     /var/log/httpd/mod_jk.log
JkLogLevel    info
NameVirtualHost *:80
<VirtualHost *:80>
        ServerName yourdomain.ext
        JkMount / ajpworker
        JkMount /* ajpworker
</VirtualHost>

3- Create a virtual host with your subdomain in glassfish (can be done on glassfish administration page)

Note that users won't be redirected to port 8080, the traffic will go trough port 80, Apache acting as a intermediate between the user and glassfish. You can even close HTTP 8080 listener on glassfish, the data between glassfish and apache will use the AJP 8009 port.

于 2013-03-25T14:52:32.203 回答