【问题标题】:Cant start adminctl because of @@ placeholders in admin.conf from Connections 6.5 IHS由于来自 Connections 6.5 IHS 的 admin.conf 中的 @@ 占位符,无法启动 adminctl
【发布时间】:2020-02-21 08:58:30
【问题描述】:

我做了一个 Connections 6.5 无头安装,它本身可以工作,但无法在

中启动 adminctl
# cd /opt/IBM/HTTPServer/bin/
# ./adminctl start
Syntax error on line 7 of /opt/IBM/HTTPServer/conf/admin.conf:
Port must be specified

第 7 行似乎是一个变量,在配置 IHS 时未正确解析

# grep Listen ../conf/admin.conf
Listen @@AdminPort@@

配置文件中还有其他这样的@@变量:

# grep @@ ../conf/admin.conf
Listen @@AdminPort@@
User @@SetupadmUser@@
Group @@SetupadmGroup@@
ServerName cnx65.internal:@@AdminPort@@

为什么这些值没有被正确替换?例如 Listen 8008(默认 IHS 管理端口)。

如何配置 IHS

使用 ansible 配置机器,其中运行以下 shell 命令以进行 IHS 插件配置:

./wctcmd.sh -tool pct -createDefinition -defLocPathname /opt/IBM/WebSphere/Plugins -response /tmp/plugin-response-file.txt -defLocName webserver1

响应文件/tmp/plugin-response-file.txt

configType=remote
enableAdminServerSupport=true
enableUserAndPass=true
enableWinService=false
ihsAdminCreateUserAndGroup=true
ihsAdminPassword=adminihs
ihsAdminPort=8008
ihsAdminUnixUserGroup=ihsadmin
ihsAdminUnixUserID=ihsadmin
mapWebServerToApplications=true
wasMachineHostname=cnx65.internal
webServerConfigFile1=/opt/IBM/HTTPServer/conf/httpd.conf
webServerDefinition=webserver1
webServerHostName=cnx65.internal
webServerOS=Linux
webServerPortNumber=80
webServerSelected=IHS

如您所见,替换所需的所有变量均已存在。因此该工具应该能够将@@AdminPort@@ 替换为值8008

【问题讨论】:

    标签: websphere ibm-connections ibmhttpserver


    【解决方案1】:

    wctcmd.sh 只是为 IHS 创建 WAS 定义,但不准备管理服务器。我们需要使用postinstsetupadm 作为documented here 手动执行此操作。这似乎不仅仅是 zip 安装所必需的。我的安装是使用 Installation Manager 完成的,如果没有这些步骤,管理服务器将无法工作。

    我在 Ansible 中这样自动化它:

    - name: Check if admin config is properly parsed
      become: yes
      shell: grep @@AdminPort@@ {{ http_server.target }}/conf/admin.conf
      register: admin_conf_check
      # File not found raise rc = 2, rc = 0 found, rc = 1 not found but file exists
      failed_when: admin_conf_check.rc != 0 and admin_conf_check.rc != 1
      changed_when: False
    
    - set_fact:
        admin_conf_is_configured: "{{ admin_conf_check.rc == 1 }}"
    
    - name: Parse IHS admin config
      become: yes
      # plugin_config_file is defined in http-plugin.yml
      shell: |
        ./bin/postinst -i $PWD -t setupadm -v ADMINPORT={{ http_server.admin_port }} -v SETUPADMUSER=nobody -v SETUPADMGROUP=nobody
        ./bin/setupadm -usr nobody -grp nobody -cfg conf/httpd.conf -plg {{ plugin_config_file }} -adm conf/admin.conf
      args:
        chdir: "{{ http_server.target }}"
      environment:
        LANG: "{{ system_language }}"
      register: ihs_setup
      # setupadm returns 90 if it was successfull: "Script Completed RC(90)"
      failed_when: ihs_setup.rc != 90
      when: not admin_conf_is_configured
    
    - name: Create htpasswd for admin config
      become: yes
      shell: ./bin/htpasswd -c conf/admin.passwd adminihs
      args:
        chdir: "{{ http_server.target }}"
        creates: "{{ http_server.target }}/conf/admin.passwd"
      environment:
        LANG: "{{ system_language }}"
    
    • http_server.target 是 IHS 基本路径,例如/opt/IBM/HTTPServer
    • http_server.admin_port 是 IBM 默认值 8008
    • plugin_config_file 设置为 /opt/IBM/WebSphere/Plugins/config/{{ http_server.name }}/plugin-cfg.xml,其中 http_server.name 与 WAS 中的定义名称匹配(在我的示例中为 webserver1
    • system_language 设置为 en_US.utf8 以确保我们获得用于输出验证的英文错误消息(需要时),与配置的操作系统语言无关

    运行这些配置工具后,我们可以看到所有的占位符都被替换成了对应的值:

    # grep -i listen ../conf/admin.conf
    Listen 8008
    

    通过在bin 目录中执行./adminctl start 来运行管理服务器现在可以正常工作了。

    【讨论】:

    • 这不是真的,您链接到的文档是一个手动过程,假设 pct/wctcmd 从未运行过,因为 iit 用于 IHS/plugin 的轻量级存档安装(也许您想 mvoe至!)。 PCT/wctcmd 应该调用该页面中的所有内容——它没有这样做,您只是在运行它应该自动运行的东西。
    【解决方案2】:

    我从 IBM 实验室的人那里听说,webServerSelected=IHS 未被识别,它必须是 webServerSelected=ihs(小写)

    https://www.ibm.com/support/knowledgecenter/SSAW57_8.5.5/com.ibm.websphere.nd.multiplatform.doc/ae/tins_pctcl_using.html

    webServerSelected
    Specifies the web server to be configured
    Specify only one web server to configure.
    
    apache22
    Apache Web Server Version 2.2
    64-bit configuration not supported on Windows
    
    apache24
    Apache Web Server Version 2.4
    64-bit configuration not supported on Windows
    
    ihs
    IBM® HTTP Server
    64-bit configuration not supported on Windows
    
    ...
    

    【讨论】:

    • 我尝试使用小写的ihs 并删除了对postinstsetupadm 的手动调用。但是在第一次香草部署后仍然在/opt/IBM/HTTPServer/conf/admin.conf 中得到Listen @@AdminPort@@,所以这似乎不会导致问题。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-09-15
    相关资源
    最近更新 更多