需要使用 asadmin 配置 GlassFish 方面的帮助

发布于 10-10 10:57 字数 1593 浏览 5 评论 0原文

由于项目限制,我需要在 shell 脚本 (linux) 中使用 asadmin 配置 GlassFish 安装。我已经配置了所有参数,除了一个。我需要配置的部分是“网络侦听器”部分。默认domain.xml 文件的部分如下所示:

<network-config>
    <protocols>
        <protocol name="http-listener-1">
            <http default-virtual-server="server" max-connections="250" server-name="">
                <file-cache enabled="false"></file-cache>
            </http>
        </protocol>
        <protocol security-enabled="true" name="http-listener-2">
            <http default-virtual-server="server" max-connections="250" server-name="">
                <file-cache enabled="false"></file-cache>
            </http>
            <ssl ssl3-enabled="false" cert-nickname="s1as"></ssl>
        </protocol>
        <protocol name="admin-listener">
            <http default-virtual-server="__asadmin" max-connections="250" server-name="">
                <file-cache enabled="false"></file-cache>
            </http>
        </protocol>
    </protocols>
</network-config>

对于“http-listener-2”部分,我需要对“ssl”部分进行更改。我查看了很多地方,但找不到正确的 asadmin 命令来进行这些更改。我的 ssl 部分需要如下所示:

<ssl key-store="config/xxxxxServer.jks" trust-store="config/xxxxxTrustStore.jks" cert-nickname="xxxxxServer" />

正如我所说,我已经查找了几天,但找不到与 asadmin 一起使用来设置这些参数的正确命令行命令。我认为“asadmin create-ssl”将是我所需要的,但不幸的是,事实并非如此。在查看 GlassFish 的 Web 界面时,我看到了需要设置的参数。这告诉我,我应该能够通过asadmin 配置它。任何帮助我解决此问题的帮助将不胜感激。

感谢您的阅读,祝您有美好的一天。

Due to project limitations, I need to configure my GlassFish installation using asadmin within a shell script (linux). I have all of my parameters configured, except one. The section I need to configure is the "network listener" section. Here is what the section of the default domain.xml file looks like:

<network-config>
    <protocols>
        <protocol name="http-listener-1">
            <http default-virtual-server="server" max-connections="250" server-name="">
                <file-cache enabled="false"></file-cache>
            </http>
        </protocol>
        <protocol security-enabled="true" name="http-listener-2">
            <http default-virtual-server="server" max-connections="250" server-name="">
                <file-cache enabled="false"></file-cache>
            </http>
            <ssl ssl3-enabled="false" cert-nickname="s1as"></ssl>
        </protocol>
        <protocol name="admin-listener">
            <http default-virtual-server="__asadmin" max-connections="250" server-name="">
                <file-cache enabled="false"></file-cache>
            </http>
        </protocol>
    </protocols>
</network-config>

For the "http-listener-2" section, I need to make changes to the "ssl" section. I have looked many places but cannot find the correct asadmin command to make these changes. What my ssl section needs to look like is this:

<ssl key-store="config/xxxxxServer.jks" trust-store="config/xxxxxTrustStore.jks" cert-nickname="xxxxxServer" />

As I have said, I have looked for a couple of days now, and I cannot find the correct command line commands to use with asadmin to set these parameters. I thought "asadmin create-ssl" would be what I needed, but, unfortunately, it was not. In looking at the web interface for GlassFish, I see the parameters I need to set. This tells me that I should be able to configure it via asadmin. Any assistance in helping me with this would be greatly appreciated.

Thanks for reading, and have a great day.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

仙女2024-10-17 10:57:57

快速回答:使用 asadmin get 和 set。

这是命令的一些输出,以使其更清楚......我希望。

让我们看一下 get 的输出...

$ ~/GlassFish_Server/bin/asadmin get 'configs.config.server-config.network-config.protocols.protocol.http-listener-2.ssl.*'
configs.config.server-config.network-config.protocols.protocol.http-listener-2.ssl.allow-lazy-init=true
configs.config.server-config.network-config.protocols.protocol.http-listener-2.ssl.cert-nickname=s1as
configs.config.server-config.network-config.protocols.protocol.http-listener-2.ssl.classname=com.sun.enterprise.security.ssl.GlassfishSSLImpl
configs.config.server-config.network-config.protocols.protocol.http-listener-2.ssl.client-auth=
configs.config.server-config.network-config.protocols.protocol.http-listener-2.ssl.client-auth-enabled=false
configs.config.server-config.network-config.protocols.protocol.http-listener-2.ssl.key-store-password-provider=plain
configs.config.server-config.network-config.protocols.protocol.http-listener-2.ssl.ssl-inactivity-timeout=30
configs.config.server-config.network-config.protocols.protocol.http-listener-2.ssl.ssl2-enabled=false
configs.config.server-config.network-config.protocols.protocol.http-listener-2.ssl.ssl3-enabled=false
configs.config.server-config.network-config.protocols.protocol.http-listener-2.ssl.tls-enabled=true
configs.config.server-config.network-config.protocols.protocol.http-listener-2.ssl.tls-rollback-enabled=true
configs.config.server-config.network-config.protocols.protocol.http-listener-2.ssl.trust-max-cert-length=5
configs.config.server-config.network-config.protocols.protocol.http-listener-2.ssl.trust-store-password-provider=plain
Command get executed successfully.

现在,使用 set 来更改其他属性之一的值...

$ ~/GlassFish_Server/bin/asadmin set configs.config.server-config.network-config.protocols.protocol.http-listener-2.ssl.key-store=config/xxxxxServer.jks
configs.config.server-config.network-config.protocols.protocol.http-listener-2.ssl.key-store=config/xxxxxServer.jks
Command set executed successfully.

使用 get 验证该值‘拿’...

$ ~/GlassFish_Server/bin/asadmin get configs.config.server-config.network-config.protocols.protocol.http-listener-2.ssl.key-store
configs.config.server-config.network-config.protocols.protocol.http-listener-2.ssl.key-store=config/xxxxxServer.jks
Command get executed successfully.

The quick answer : use asadmin get and set.

here is a bit of output from commands to make it clearer... I hope.

Let's take a look at the output from get...

$ ~/GlassFish_Server/bin/asadmin get 'configs.config.server-config.network-config.protocols.protocol.http-listener-2.ssl.*'
configs.config.server-config.network-config.protocols.protocol.http-listener-2.ssl.allow-lazy-init=true
configs.config.server-config.network-config.protocols.protocol.http-listener-2.ssl.cert-nickname=s1as
configs.config.server-config.network-config.protocols.protocol.http-listener-2.ssl.classname=com.sun.enterprise.security.ssl.GlassfishSSLImpl
configs.config.server-config.network-config.protocols.protocol.http-listener-2.ssl.client-auth=
configs.config.server-config.network-config.protocols.protocol.http-listener-2.ssl.client-auth-enabled=false
configs.config.server-config.network-config.protocols.protocol.http-listener-2.ssl.key-store-password-provider=plain
configs.config.server-config.network-config.protocols.protocol.http-listener-2.ssl.ssl-inactivity-timeout=30
configs.config.server-config.network-config.protocols.protocol.http-listener-2.ssl.ssl2-enabled=false
configs.config.server-config.network-config.protocols.protocol.http-listener-2.ssl.ssl3-enabled=false
configs.config.server-config.network-config.protocols.protocol.http-listener-2.ssl.tls-enabled=true
configs.config.server-config.network-config.protocols.protocol.http-listener-2.ssl.tls-rollback-enabled=true
configs.config.server-config.network-config.protocols.protocol.http-listener-2.ssl.trust-max-cert-length=5
configs.config.server-config.network-config.protocols.protocol.http-listener-2.ssl.trust-store-password-provider=plain
Command get executed successfully.

Now, use set to alter the value of one of the other properties...

$ ~/GlassFish_Server/bin/asadmin set configs.config.server-config.network-config.protocols.protocol.http-listener-2.ssl.key-store=config/xxxxxServer.jks
configs.config.server-config.network-config.protocols.protocol.http-listener-2.ssl.key-store=config/xxxxxServer.jks
Command set executed successfully.

Use get to verify that the value 'took'...

$ ~/GlassFish_Server/bin/asadmin get configs.config.server-config.network-config.protocols.protocol.http-listener-2.ssl.key-store
configs.config.server-config.network-config.protocols.protocol.http-listener-2.ssl.key-store=config/xxxxxServer.jks
Command get executed successfully.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文