Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/eclipse/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Eclipse 如何使用Glassfish将域:端口重定向到域?_Eclipse_Http_Https_Glassfish_Glassfish 3 - Fatal编程技术网

Eclipse 如何使用Glassfish将域:端口重定向到域?

Eclipse 如何使用Glassfish将域:端口重定向到域?,eclipse,http,https,glassfish,glassfish-3,Eclipse,Http,Https,Glassfish,Glassfish 3,我有一个类似www.example.com的域,我使用Glassfish,它在端口12544托管我的应用程序 所以我想知道两件事: 如何将此www.example.com:12544重定向到www.example.com 除了https,还有同样的方法吗?我是说,https://www.example.com ? 我是Glassfish的新手,非常感谢您的帮助。最好的方法是将Glassfish放在Apache http服务器后面,并将Apache配置为将请求指向Glassfish。因此http请

我有一个类似www.example.com的域,我使用Glassfish,它在端口12544托管我的应用程序

所以我想知道两件事:

如何将此www.example.com:12544重定向到www.example.com

除了https,还有同样的方法吗?我是说,https://www.example.com ?

我是Glassfish的新手,非常感谢您的帮助。

最好的方法是将Glassfish放在Apache http服务器后面,并将Apache配置为将请求指向Glassfish。因此http请求由Apache处理,所有www.example.com请求在内部都指向www.example.com:12544。下面是如何做到这一点的简要说明

安装Glassfish 3+确保您的侦听器已在8009上创建并激活,并且您的jk已启用 安装2.2+ 获取连接器并将其放入apachemodules文件夹中进行配置。 创建worker.properties文件并将其放入apache conf文件夹中。它应包含以下属性: 您还需要在conf文件中添加VirtualHost部分。这会将您的域映射到Glassfish中的路径,以便Apache能够看到它。下面告诉apache将所有/myapp/*链接映射到glassfish

<VirtualHost 111.111.111.111:80>
    ServerAdmin admin@domain
    ServerName domain
    JkMount /myapp/* worker1
</VirtualHost>
重新启动Apache和Glassfish以更新新配置。Apache现在应该可以在端口80上看到您的Glassfish。因此,您的www.example.com:12544将在www.example.com上提供。 LoadModule jk_module modules/mod_jk.so #location of the worker file JkWorkersFile conf/worker.properties #where to put jk logs JkLogFile logs/mod_jk.log #log level [deug/error/info] JkLogLevel debug #Log format JkLogStampFormat "[%a %b %d %H:%M:%S %Y]" # Indicate to send SSL KEY SIZE JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories # Set the request format JkRequestLogFormat "%w %V %T" # Send all jsp requests to Glassfish JkMount /*.jsp worker1 # Send all webapp requests to Glassfish JkMount /* worker1
<VirtualHost 111.111.111.111:80>
    ServerAdmin admin@domain
    ServerName domain
    JkMount /myapp/* worker1
</VirtualHost>
asadmin create-network-listener --protocol http-listener-1 --listenerport 8009 --jkenabled true jk-connector