JBOSS端口设置

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了JBOSS端口设置相关的知识,希望对你有一定的参考价值。

JBOSS5

[[email protected] jbossweb.sar]# ll

total 4868

-rw-r--r-- 1 appman appman     625 Sep 15  2010 context.xml

-rw-r--r-- 1 appman appman 1410325 Sep 15  2010 jasper-jdt.jar

-rw-r--r-- 1 appman appman 2640860 Sep 15  2010 jbossweb.jar

-rw-r--r-- 1 appman appman  431060 Sep 15  2010 jboss-web-service.jar

drwxr-xr-x 2 appman appman    4096 Sep 15  2010 jsf-libs

-rw-r--r-- 1 appman appman  452458 Sep 15  2010 jstl.jar

drwxr-xr-x 2 appman appman    4096 Sep 15  2010 META-INF

-rw-r--r-- 1 appman appman    8485 Mar 15 10:28 server.xml

[[email protected] jbossweb.sar]# pwd

/opt/uums-ula/jboss-eap-5.1/jboss-as/server/default/deploy/jbossweb.sar


[[email protected] jbossweb.sar]# cat server.xml 

<Server>


   <!-- Optional listener which ensures correct init and shutdown of APR,

        and provides information if it is not installed -->

   <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />

   <!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->

   <Listener className="org.apache.catalina.core.JasperListener" />


   <Service name="jboss.web">


      <!-- A HTTP/1.1 Connector on port 8080 -->

      <Connector protocol="HTTP/1.1" port="8080" address="${jboss.bind.address}" 

               connectionTimeout="20000" redirectPort="8443" URIEncoding="UTF-8" />


      <!-- Add this option to the connector to avoid problems with 

          .NET clients that don‘t implement HTTP/1.1 correctly 

         restrictedUserAgents="^.*MS Web Services Client Protocol 1.1.4322.*$"

      -->


      <!-- A AJP 1.3 Connector on port 8009 -->

      <Connector protocol="AJP/1.3" port="8009" address="${jboss.bind.address}"

         redirectPort="8443" />


      <!-- SSL/TLS Connector configuration using the admin devl guide keystore

      <Connector protocol="HTTP/1.1" SSLEnabled="true" 

           port="8443" address="${jboss.bind.address}"

           scheme="https" secure="true" clientAuth="false" 

           keystoreFile="${jboss.server.home.dir}/conf/chap8.keystore"

           keystorePass="rmi+ssl" sslProtocol = "TLS" />

[[email protected] META-INF]# pwd

/opt/uums-ula/jboss-eap-5.1/jboss-as/server/default/conf/bindingservice.beans/META-INF

[[email protected] META-INF]# ll

total 60

-rw-r--r-- 1 appman appman 53910 Sep 15  2010 bindings-jboss-beans.xml

[[email protected] META-INF]# vim bindings-jboss-beans.xml

技术分享

技术分享


这样设置后

[[email protected] jboss-eap-5.1]# cat startApp.sh 

#cd /opt/jboss-eap-5.1/

#!/bin/bash

echo ===============================

NAME=ula

ID=`ps -ef | grep "$NAME" | grep -v "$0" | grep -v "grep" | awk ‘{print $2}‘`

if [ "$ID" != "" ]; then

   for id in $ID

     do

       echo "寮濮..姝㈡.?″...."

       kill -9 $id

     done

echo " ?..?ㄥ凡缁..姝??灏.?濮..??.."

sleep 5

else

echo "?..?ㄥ凡缁..?..?舵.?灏..?ュ.??.."

sleep 5

fi

rm -rf /opt/uums-ula/jboss-eap-5.1/jboss-as/server/default/tmp/*

#cp -f /opt/Jenkins/test_NewPackage/ula-*.war /opt/uums-ula/jboss-eap-5.1/jboss-as/server/default/deploy

cp /opt/Jenkins/test_NewPackage/ula-resource-web-*.war /opt/uums-ula/jboss-eap-5.1/jboss-as/server/default/deploy/ula-resource-web.war

cp /opt/Jenkins/test_NewPackage/ula-web-*-SNAPSHOT.war /opt/uums-ula/jboss-eap-5.1/jboss-as/server/default/deploy/ula-web.war

nohup ./jboss-as/bin/run.sh -debug -b  0.0.0.0 -Djboss.service.binding.set=ports-02  >/opt/uums-ula/jboss-eap-5.1/nohup.out 2>&1 &

tail -f /opt/uums-ula/jboss-eap-5.1/nohup.out|sed ‘/Started in /Q‘

echo "?..?.."                                             

这里设置 ports-02,端口就是8280或者也可以直接修改server.xml这里的端口设置的地方。但这种方法不适合多实例多实例的情况下最好再启动脚本中指定端口号。


JBOSS6 端口

[[email protected] configuration]# pwd

/opt/jboss6/jboss-eap-6.2/standalone/configuration

[[email protected] configuration]# ll

total 168

-rwxr-xr-x  1 root root   711 Mar 30  2015 application-roles.properties

-rwxr-xr-x  1 root root   935 Mar 30  2015 application-users.properties

-rwxr-xr-x  1 root root  1908 Mar 14 16:52 logging.properties

-rwxr-xr-x  1 root root   669 Mar 30  2015 mgmt-groups.properties

-rwxr-xr-x  1 root root  1112 Mar 30  2015 mgmt-users.properties

-rw-r--r--  1 root root     0 Mar 30  2015 standalone

-rwxr-xr-x  1 root root 27314 Mar 30  2015 standalone-full-ha.xml

-rwxr-xr-x  1 root root 21476 Mar 30  2015 standalone-full.xml

-rwxr-xr-x  1 root root 20914 Mar 30  2015 standalone-ha.xml

-rwxr-xr-x  1 root root 17846 Mar 30  2015 standalone-osgi.xml

-rw-r--r--  1 root root 23072 Mar 12 14:27 standalone.xml

-rw-r--r--  1 root root 23072 Mar  8 11:50 standalone.xml.bak

drwxr-xr-x 15 root root  4096 Mar 14 16:52 standalone_xml_history

[[email protected] configuration]# cat standalone.xml

<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">

        <socket-binding name="management-native" interface="management" port="${jboss.management.native.port:9999}"/>

        <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>

        <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9443}"/>

        <socket-binding name="ajp" port="8009"/>

        <socket-binding name="http" port="8080"/>

        <socket-binding name="https" port="8443"/>

        <socket-binding name="remoting" port="4447"/>

        <socket-binding name="txn-recovery-environment" port="4712"/>

        <socket-binding name="txn-status-manager" port="4713"/>

        <outbound-socket-binding name="mail-smtp">

            <remote-destination host="localhost" port="25"/>

        </outbound-socket-binding>

    </socket-binding-group>


</server>


以上是关于JBOSS端口设置的主要内容,如果未能解决你的问题,请参考以下文章

JBOSS端口设置

如何在特权端口上启动 JBoss?

如何在 jboss 版本 jboss-5.1.0.GA 上更改端口

如何在 jboss 7 中配置两个 https 连接器端口?

更改 JBoss 6.1.0 端口

使用另一个端口运行 jboss docker 命令