如何在Centos中设置Cloudfare + Apche + Wildfly

时间:2018-09-04 16:30:28

标签: apache wildfly mod-jk underflow

我的服务器PC操作系统是CentOS。

我在CentOS中成功设置了wildfly服务器11。 然后,我在wildfly中成功设置了2个域。 即example.com,tools.example.com

秘密

<subsystem xmlns="urn:jboss:domain:undertow:4.0">
    <buffer-cache name="default"/>
    <server name="default-server">
        <http-listener name="default" socket-binding="http" redirect-socket="https" enable-http2="true"/>
        <https-listener name="https" socket-binding="https" security-realm="ApplicationRealm" enable-http2="true"/>
        <host name="default-host" alias="localhost">
            <location name="/" handler="welcome-content"/>
            <filter-ref name="server-header"/>
            <filter-ref name="x-powered-by-header"/>
            <http-invoker security-realm="ApplicationRealm"/>
        </host>
        <host name="example" alias="example.com,www.example.com" default-web-module="example.war"/>
        <host name="tools" alias="tools.example.com" default-web-module="tools.war"/>
    </server>
    <servlet-container name="default">
        <jsp-config x-powered-by="false"/>
        <websockets/>
    </servlet-container>
    <handlers>
        <file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>
    </handlers>
    <filters>
        <response-header name="server-header" header-name="Server" header-value="WildFly/11"/>
        <response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow/1"/>
    </filters>
</subsystem>

套接字绑定

<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
    <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:6990}"/>
    <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:6993}"/>
    <socket-binding name="ajp" port="${jboss.ajp.port:6009}"/>
    <socket-binding name="http" port="${jboss.http.port:6080}"/>
    <socket-binding name="https" port="${jboss.https.port:6443}"/>
    <socket-binding name="txn-recovery-environment" port="6712"/>
    <socket-binding name="txn-status-manager" port="6713"/>
    <outbound-socket-binding name="mail-smtp">
        <remote-destination host="localhost" port="25"/>
    </outbound-socket-binding>
</socket-binding-group>

最后,我使用cloudfare获取这两个域的免费SSL。

https://www.example.comhttps://tools.example.com

域工作正常。

几天前,我需要新的要求。即支持票证系统网站。 我找到了“ osTicket”-开源支持票务系统。但是它是用PHP编写的。

我决定在WILDFLY的前面添加APACHE。

我成功下载并安装了“ XAMPP”。然后我在“ XAMPP”中设置“ osTicket”。

'osTicket'在http://localhost/osTicket中正常工作

mod_jk的配置

/etc/extra/mod-jk.conf

ServerName    localhost
LoadModule    jk_module modules/mod_jk.so
JkWorkersFile /etc/extra/workers.properties
JkLogFile     /var/log/httpd/mod_jk_log
JkLogLevel    info
JKMount       / jboss1
JkMount       /* jboss1
JKMount       /jkstatus jkstatus
JKShmFile     /var/tmp/jk-runtime-status

/etc/extra/workers.properties

worker.list=jboss1,jkstatus
worker.jkstatus.type=status
worker.jboss1.type=ajp13
worker.jboss1.port=6009
worker.jboss1.host=127.0.0.1

尝试使用URL http://localhost/jkstatus,显示“ JK状态管理器”页面。

我已在云票价' support.example.com '中创建了一个新的子域,并指向我的服务器。

support.example.com无法正常工作。

如何设置3个域。 Wildfly中有2个域,Apache Web服务器中有1个域。我有一个公用IP地址。

此设置让我迷失了两天。最后问一下stackoverflow。

谢谢。

0 个答案:

没有答案