【问题标题】:List all my deployed applications in Websphere and their respective ports列出我在 Websphere 中部署的所有应用程序及其各自的端口
【发布时间】:2019-01-04 17:52:35
【问题描述】:

我想只使用命令行来管理我的 WebSphere Application Server 中的一些东西,但是我在获取我已部署的应用程序和端口的列表时遇到了麻烦。

我想要什么:

我需要获取我已部署的应用程序及其端口的列表。我是 WAS 管理的新手,与 Apache Web Server 相比,我想要类似命令 apachectl -t -D DUMP_VHOSTS

apachectl 输出示例:

虚拟主机配置:

*:80 mysite.com (/etc/apache2/sites-enabled/site.conf:1)

*:443 secure.com (/etc/apache2/sites-enabled/secure.conf:2)

注意:我知道 Apache 和 WAS 不是一回事(WAS 和 Apache Tomcat 之间有更多相似之处),但这只是我想要的输出的一个示例:我的应用程序列表(apache 示例中的虚拟主机) ) 及其各自的端口

到目前为止我所拥有的:

由于我需要从命令行执行此操作,因此我使用 wsadmin shell 按照以下步骤(Debian 服务器):

cd <Was_Root_Dir>/AppServer/bin
./wsadmin.sh -lang jython -user user -password pass
wsadmin>print AddminApp.list()

结果如下:

默认应用程序 地点 安全

这是我想要的列表,但我不知道每个应用程序的端口,我无法在任何地方找到如何实现它。

我认为该列表很广泛,包括所有服务器中的应用程序和我的 WAS 实例的所有配置文件。我在吗?

加:

包含所有已部署应用程序的列表非常好,但一个优点可能是仅过滤使用 SSL 安全端口的应用程序。

有可能吗?我是不是误会了什么?

【问题讨论】:

    标签: websphere jython administration wsadmin


    【解决方案1】:

    使用 wsadmin listApplicationServerPorts 命令列出端口,以便访问特定应用程序。有关详细信息,请参阅 IBM KC 链接 (listApplicationServerPorts)。

    我为你准备了一个脚本,将以下内容复制并粘贴到一个文件(script.py)并使用wsadmin运行它,如下所示

    ./wsadmin.sh -lang jython -user user -password pass -f script.py

    #Get the list of ALL installed APPs
    appList=AdminApp.list().splitlines()
    
    #Get the list of Application ports for each APP
    for app in appList:
        print "  "
        #print APP Name
        print app
        #Get the list of Application Ports
        portList=AdminTask.listApplicationPorts(app).splitlines()
        for port in portList:
            #Print the port Details for the APP
            print port
    

    这将打印 appName 和应用程序端口列表。

    从此列表中,“WC_defaulthost”端口可用于http和“WC_defaulthost_secure " 代表 https

    【讨论】:

      猜你喜欢
      • 2015-02-26
      • 2020-07-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多