1 2 Previous Next 21 Replies Latest reply on May 9, 2008 12:51 AM by Priya Rao

    How to access JBOSS by providing IP address

    Priya Rao Newbie

      Hi,
      i'm not able to access my jboss server using my ip address like http://192.168.55.147:8080/... but it is working fine when i use with the name localhost like http://localhost:8080/

      So plz tell me the which file i hav to modify r anything related to dis.... any help is appriciated,,, thanks in advance.........


      Regards,
      Priya

        • 1. Re: How to access JBOSS by providing IP address
          aneesh vasanthan Newbie

          add the -b 0.0.0.0 as start argument

          run.bat -b 0.0.0.0

          which will bind the localhost and ipaddress to jboss.bind.address

          • 2. Re: How to access JBOSS by providing IP address
            Priya Rao Newbie

            thankQ aneesh dats fine but i have to access the JBOSS server which is running in another machine through IP address. For that what i hav 2 do ?

            • 3. Re: How to access JBOSS by providing IP address
              aneesh vasanthan Newbie

              Did u make any changes to the server.xml?

              If u set the localhost and ipaddress both pointing to jboss.bind.address

              u can access the site using both http://localhost and http://ipaddress

              And u will be able to access through the ipaddress from a remote host

              • 4. Re: How to access JBOSS by providing IP address
                Priya Rao Newbie

                dats fine but in server.xml file i don't know where to give ip address.... plz send me code if possible

                • 5. Re: How to access JBOSS by providing IP address
                  aneesh vasanthan Newbie

                  did u make any changes to ur server.xml.
                  Can u post ur server.xml

                  • 6. Re: How to access JBOSS by providing IP address
                    Priya Rao Newbie

                    hi Aneesh, Thanks 4 Reply..... I didn't made any changes in my server.xml which is avaolable at
                    C:\jboss-4.2.2.GA\server\default\deploy\jboss-web.deployer\server.xml

                    my server.xml file is like this only..... Plz specify where i have to do modifications....






                    <!--APR library loader. Documentation at /docs/apr.html -->

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


                    <!-- Use a custom version of StandardService that allows the
                    connectors to be started independent of the normal lifecycle
                    start to allow web apps to be deployed before starting the
                    connectors.
                    -->


                    <!-- A "Connector" represents an endpoint by which requests are received
                    and responses are returned. Documentation at :
                    Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
                    Java AJP Connector: /docs/config/ajp.html
                    APR (HTTP/AJP) Connector: /docs/apr.html
                    Define a non-SSL HTTP/1.1 Connector on port 8080
                    -->


                    <!-- Define a SSL HTTP/1.1 Connector on port 8443
                    This connector uses the JSSE configuration, when using APR, the
                    connector should be using the OpenSSL style configuration
                    described in the APR documentation -->
                    <!--

                    -->

                    <!-- Define an AJP 1.3 Connector on port 8009 -->




                    <!-- The JAAS based authentication and authorization realm implementation
                    that is compatible with the jboss 3.2.x realm implementation.
                    - certificatePrincipal : the class name of the
                    org.jboss.security.auth.certs.CertificatePrincipal impl
                    used for mapping X509[] cert chains to a Princpal.
                    - allRolesMode : how to handle an auth-constraint with a role-name=*,
                    one of strict, authOnly, strictAuthOnly
                    + strict = Use the strict servlet spec interpretation which requires
                    that the user have one of the web-app/security-role/role-name
                    + authOnly = Allow any authenticated user
                    + strictAuthOnly = Allow any authenticated user only if there are no
                    web-app/security-roles
                    -->

                    <!-- A subclass of JBossSecurityMgrRealm that uses the authentication
                    behavior of JBossSecurityMgrRealm, but overrides the authorization
                    checks to use JACC permissions with the current java.security.Policy
                    to determine authorized access.
                    - allRolesMode : how to handle an auth-constraint with a role-name=*,
                    one of strict, authOnly, strictAuthOnly
                    + strict = Use the strict servlet spec interpretation which requires
                    that the user have one of the web-app/security-role/role-name
                    + authOnly = Allow any authenticated user
                    + strictAuthOnly = Allow any authenticated user only if there are no
                    web-app/security-roles

                    -->



                    <!-- Uncomment to enable request dumper. This Valve "logs interesting
                    contents from the specified Request (before processing) and the
                    corresponding Response (after processing). It is especially useful
                    in debugging problems related to headers and cookies."
                    -->
                    <!--

                    -->

                    <!-- Access logger -->
                    <!--

                    -->

                    <!-- Uncomment to enable single sign-on across web apps
                    deployed to this host. Does not provide SSO across a cluster.

                    If this valve is used, do not use the JBoss ClusteredSingleSignOn
                    valve shown below.

                    A new configuration attribute is available beginning with
                    release 4.0.4:

                    cookieDomain configures the domain to which the SSO cookie
                    will be scoped (i.e. the set of hosts to
                    which the cookie will be presented). By default
                    the cookie is scoped to "/", meaning the host
                    that presented it. Set cookieDomain to a
                    wider domain (e.g. "xyz.com") to allow an SSO
                    to span more than one hostname.
                    -->
                    <!--

                    -->

                    <!-- Uncomment to enable single sign-on across web apps
                    deployed to this host AND to all other hosts in the cluster.

                    If this valve is used, do not use the standard Tomcat SingleSignOn
                    valve shown above.

                    Valve uses a JBossCache instance to support SSO credential
                    caching and replication across the cluster. The JBossCache
                    instance must be configured separately. By default, the valve
                    shares a JBossCache with the service that supports HttpSession
                    replication. See the "jboss-web-cluster-service.xml" file in the
                    server/all/deploy directory for cache configuration details.

                    Besides the attributes supported by the standard Tomcat
                    SingleSignOn valve (see the Tomcat docs), this version also
                    supports the following attributes:

                    cookieDomain see above

                    treeCacheName JMX ObjectName of the JBossCache MBean used to
                    support credential caching and replication across
                    the cluster. If not set, the default value is
                    "jboss.cache:service=TomcatClusteringCache", the
                    standard ObjectName of the JBossCache MBean used
                    to support session replication.
                    -->
                    <!--

                    -->

                    <!-- Check for unclosed connections and transaction terminated checks
                    in servlets/jsps.

                    Important: The dependency on the CachedConnectionManager
                    in META-INF/jboss-service.xml must be uncommented, too
                    -->









                    • 7. Re: How to access JBOSS by providing IP address
                      Priya Rao Newbie

                      dis s my complete server.xml



                      <!--APR library loader. Documentation at /docs/apr.html -->

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


                      <!-- Use a custom version of StandardService that allows the
                      connectors to be started independent of the normal lifecycle
                      start to allow web apps to be deployed before starting the
                      connectors.
                      -->


                      <!-- A "Connector" represents an endpoint by which requests are received
                      and responses are returned. Documentation at :
                      Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
                      Java AJP Connector: /docs/config/ajp.html
                      APR (HTTP/AJP) Connector: /docs/apr.html
                      Define a non-SSL HTTP/1.1 Connector on port 8080
                      -->


                      <!-- Define a SSL HTTP/1.1 Connector on port 8443
                      This connector uses the JSSE configuration, when using APR, the
                      connector should be using the OpenSSL style configuration
                      described in the APR documentation -->
                      <!--

                      -->

                      <!-- Define an AJP 1.3 Connector on port 8009 -->




                      <!-- The JAAS based authentication and authorization realm implementation
                      that is compatible with the jboss 3.2.x realm implementation.
                      - certificatePrincipal : the class name of the
                      org.jboss.security.auth.certs.CertificatePrincipal impl
                      used for mapping X509[] cert chains to a Princpal.
                      - allRolesMode : how to handle an auth-constraint with a role-name=*,
                      one of strict, authOnly, strictAuthOnly
                      + strict = Use the strict servlet spec interpretation which requires
                      that the user have one of the web-app/security-role/role-name
                      + authOnly = Allow any authenticated user
                      + strictAuthOnly = Allow any authenticated user only if there are no
                      web-app/security-roles
                      -->

                      <!-- A subclass of JBossSecurityMgrRealm that uses the authentication
                      behavior of JBossSecurityMgrRealm, but overrides the authorization
                      checks to use JACC permissions with the current java.security.Policy
                      to determine authorized access.
                      - allRolesMode : how to handle an auth-constraint with a role-name=*,
                      one of strict, authOnly, strictAuthOnly
                      + strict = Use the strict servlet spec interpretation which requires
                      that the user have one of the web-app/security-role/role-name
                      + authOnly = Allow any authenticated user
                      + strictAuthOnly = Allow any authenticated user only if there are no
                      web-app/security-roles

                      -->



                      <!-- Uncomment to enable request dumper. This Valve "logs interesting
                      contents from the specified Request (before processing) and the
                      corresponding Response (after processing). It is especially useful
                      in debugging problems related to headers and cookies."
                      -->
                      <!--

                      -->

                      <!-- Access logger -->
                      <!--

                      -->

                      <!-- Uncomment to enable single sign-on across web apps
                      deployed to this host. Does not provide SSO across a cluster.

                      If this valve is used, do not use the JBoss ClusteredSingleSignOn
                      valve shown below.

                      A new configuration attribute is available beginning with
                      release 4.0.4:

                      cookieDomain configures the domain to which the SSO cookie
                      will be scoped (i.e. the set of hosts to
                      which the cookie will be presented). By default
                      the cookie is scoped to "/", meaning the host
                      that presented it. Set cookieDomain to a
                      wider domain (e.g. "xyz.com") to allow an SSO
                      to span more than one hostname.
                      -->
                      <!--

                      -->

                      <!-- Uncomment to enable single sign-on across web apps
                      deployed to this host AND to all other hosts in the cluster.

                      If this valve is used, do not use the standard Tomcat SingleSignOn
                      valve shown above.

                      Valve uses a JBossCache instance to support SSO credential
                      caching and replication across the cluster. The JBossCache
                      instance must be configured separately. By default, the valve
                      shares a JBossCache with the service that supports HttpSession
                      replication. See the "jboss-web-cluster-service.xml" file in the
                      server/all/deploy directory for cache configuration details.

                      Besides the attributes supported by the standard Tomcat
                      SingleSignOn valve (see the Tomcat docs), this version also
                      supports the following attributes:

                      cookieDomain see above

                      treeCacheName JMX ObjectName of the JBossCache MBean used to
                      support credential caching and replication across
                      the cluster. If not set, the default value is
                      "jboss.cache:service=TomcatClusteringCache", the
                      standard ObjectName of the JBossCache MBean used
                      to support session replication.
                      -->
                      <!--

                      -->

                      <!-- Check for unclosed connections and transaction terminated checks
                      in servlets/jsps.

                      Important: The dependency on the CachedConnectionManager
                      in META-INF/jboss-service.xml must be uncommented, too
                      -->









                      • 8. Re: How to access JBOSS by providing IP address
                        aneesh vasanthan Newbie

                        HI priya. My server.xml is attatched below.

                        <Server>
                        
                         <!--APR library loader. Documentation at /docs/apr.html -->
                        
                        
                        
                         <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" />
                        
                        
                        
                         <!-- Use a custom version of StandardService that allows the
                         connectors to be started independent of the normal lifecycle
                         start to allow web apps to be deployed before starting the
                         connectors.
                         -->
                        
                        
                        
                         <Service name="jboss.web">
                        
                        
                        
                         <!-- A "Connector" represents an endpoint by which requests are received
                         and responses are returned. Documentation at :
                         Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
                         Java AJP Connector: /docs/config/ajp.html
                         APR (HTTP/AJP) Connector: /docs/apr.html
                         Define a non-SSL HTTP/1.1 Connector on port 8080
                         -->
                        
                        
                        
                         <Connector port="8080" address="${jboss.bind.address}"
                         maxThreads="250" maxHttpHeaderSize="8192"
                         emptySessionPath="true" protocol="HTTP/1.1"
                         enableLookups="false" redirectPort="8443" acceptCount="100"
                         connectionTimeout="20000" disableUploadTimeout="true" />
                        
                        
                        
                        
                         <!-- Define a SSL HTTP/1.1 Connector on port 8443
                         This connector uses the JSSE configuration, when using APR, the
                         connector should be using the OpenSSL style configuration
                         described in the APR documentation -->
                         <!--
                         <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
                         maxThreads="150" scheme="https" secure="true"
                         clientAuth="false" sslProtocol="TLS" />
                         -->
                        
                         <!-- Define an AJP 1.3 Connector on port 8009 -->
                        
                        
                        
                         <Connector port="8009" address="${jboss.bind.address}" protocol="AJP/1.3"
                         emptySessionPath="true" enableLookups="false" redirectPort="8443" />
                        
                        
                         <Engine name="jboss.web" defaultHost="localhost">
                        
                        
                        
                         <!-- The JAAS based authentication and authorization realm implementation
                         that is compatible with the jboss 3.2.x realm implementation.
                         - certificatePrincipal : the class name of the
                         org.jboss.security.auth.certs.CertificatePrincipal impl
                         used for mapping X509[] cert chains to a Princpal.
                         - allRolesMode : how to handle an auth-constraint with a role-name=*,
                         one of strict, authOnly, strictAuthOnly
                         + strict = Use the strict servlet spec interpretation which requires
                         that the user have one of the web-app/security-role/role-name
                         + authOnly = Allow any authenticated user
                         + strictAuthOnly = Allow any authenticated user only if there are no
                         web-app/security-roles
                         -->
                        
                        
                        
                         <Realm className="org.jboss.web.tomcat.security.JBossSecurityMgrRealm"
                         certificatePrincipal="org.jboss.security.auth.certs.SubjectDNMapping"
                         allRolesMode="authOnly"
                         />
                        
                        
                        
                         <!-- A subclass of JBossSecurityMgrRealm that uses the authentication
                         behavior of JBossSecurityMgrRealm, but overrides the authorization
                         checks to use JACC permissions with the current java.security.Policy
                         to determine authorized access.
                         - allRolesMode : how to handle an auth-constraint with a role-name=*,
                         one of strict, authOnly, strictAuthOnly
                         + strict = Use the strict servlet spec interpretation which requires
                         that the user have one of the web-app/security-role/role-name
                         + authOnly = Allow any authenticated user
                         + strictAuthOnly = Allow any authenticated user only if there are no
                         web-app/security-roles
                        
                        
                         <Realm className="org.jboss.web.tomcat.security.JaccAuthorizationRealm"
                         certificatePrincipal="org.jboss.security.auth.certs.SubjectDNMapping"
                         allRolesMode="authOnly"
                         />
                         -->
                        
                        
                        
                        
                         <Host name="localhost" autoDeploy="false" deployOnStartup="false" deployXML="false"
                         configClass="org.jboss.web.tomcat.security.config.JBossContextConfig"
                         >
                        
                        
                        
                        
                        
                         <!-- Uncomment to enable request dumper. This Valve "logs interesting
                         contents from the specified Request (before processing) and the
                         corresponding Response (after processing). It is especially useful
                         in debugging problems related to headers and cookies."
                         -->
                         <!--
                         <Valve className="org.apache.catalina.valves.RequestDumperValve" />
                         -->
                        
                         <!-- Access logger -->
                         <!--
                         <Valve className="org.apache.catalina.valves.AccessLogValve"
                         prefix="localhost_access_log." suffix=".log"
                         pattern="common" directory="${jboss.server.home.dir}/log"
                         resolveHosts="false" />
                         -->
                        
                         <!-- Uncomment to enable single sign-on across web apps
                         deployed to this host. Does not provide SSO across a cluster.
                        
                         If this valve is used, do not use the JBoss ClusteredSingleSignOn
                         valve shown below.
                        
                         A new configuration attribute is available beginning with
                         release 4.0.4:
                        
                         cookieDomain configures the domain to which the SSO cookie
                         will be scoped (i.e. the set of hosts to
                         which the cookie will be presented). By default
                         the cookie is scoped to "/", meaning the host
                         that presented it. Set cookieDomain to a
                         wider domain (e.g. "xyz.com") to allow an SSO
                         to span more than one hostname.
                         -->
                         <!--
                         <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
                         -->
                        
                         <!-- Uncomment to enable single sign-on across web apps
                         deployed to this host AND to all other hosts in the cluster.
                        
                         If this valve is used, do not use the standard Tomcat SingleSignOn
                         valve shown above.
                        
                         Valve uses a JBossCache instance to support SSO credential
                         caching and replication across the cluster. The JBossCache
                         instance must be configured separately. By default, the valve
                         shares a JBossCache with the service that supports HttpSession
                         replication. See the "jboss-web-cluster-service.xml" file in the
                         server/all/deploy directory for cache configuration details.
                        
                         Besides the attributes supported by the standard Tomcat
                         SingleSignOn valve (see the Tomcat docs), this version also
                         supports the following attributes:
                        
                         cookieDomain see above
                        
                         treeCacheName JMX ObjectName of the JBossCache MBean used to
                         support credential caching and replication across
                         the cluster. If not set, the default value is
                         "jboss.cache:service=TomcatClusteringCache", the
                         standard ObjectName of the JBossCache MBean used
                         to support session replication.
                         -->
                         <!--
                         <Valve className="org.jboss.web.tomcat.service.sso.ClusteredSingleSignOn" />
                         -->
                        
                         <!-- Check for unclosed connections and transaction terminated checks
                         in servlets/jsps.
                        
                         Important: The dependency on the CachedConnectionManager
                         in META-INF/jboss-service.xml must be uncommented, too
                         -->
                         <Valve className="org.jboss.web.tomcat.service.jca.CachedConnectionValve"
                         cachedConnectionManagerObjectName="jboss.jca:service=CachedConnectionManager"
                         transactionManagerObjectName="jboss:service=TransactionManager" />
                        
                         </Host>
                        
                         </Engine>
                        
                         </Service>
                        
                        </Server>
                        


                        • 9. Re: How to access JBOSS by providing IP address
                          Priya Rao Newbie

                          thankQ Aneesh..... that server.xml file is fine...... but what i want is server is running in another machine ... that machines IP address is (for ex: 192.116.25.23).... now in my application i.e running in another machine, I have to use that server which is running in (192.116.25.23)....like in my file
                          i have configured like this ..

                          Hashtable env = new Hashtable();
                          env.put(Context.INITIAL_CONTEXT_FACTORY,
                          "org.jnp.interfaces.NamingContextFactory");
                          env.put(Context.URL_PKG_PREFIXES,
                          "=org.jboss.naming:org.jnp.interfaces");
                          env.put(Context.PROVIDER_URL, "jnp://192.116.25.23:1099");

                          like that i need to access that server in my application..... for that tell me what changes i hav to mak in that 192.116.25.23 machine...........

                          • 10. Re: How to access JBOSS by providing IP address
                            jaikiran pai Master

                            Priya,

                            As already mentioned by aneesh in his first post, all you have to do is start the server (on 192.116.25.23) using the -b 0.0.0.0 option. Like this:

                            run.bat -b 0.0.0.0


                            See this for more details http://wiki.jboss.org/wiki/JBoss42FAQ

                            • 11. Re: How to access JBOSS by providing IP address
                              aneesh vasanthan Newbie

                              What do u want is to access any resource in your server from a client application?


                              Or are you not able to access the apllications from another machine connected to it from the browser by giving the ip http://ipaddress?

                              • 12. Re: How to access JBOSS by providing IP address
                                Priya Rao Newbie

                                Hi Kiran,,.. dats fine like that i can access my server with ip address...... But in my program how can i configured that JBOSS configuration..... if the Server is running in my machine i can provide the following code and it works fine....
                                Hashtable env = new Hashtable();

                                env.put(Context.INITIAL_CONTEXT_FACTORY,
                                "org.jnp.interfaces.NamingContextFactory");
                                env.put(Context.URL_PKG_PREFIXES,
                                "=org.jboss.naming:org.jnp.interfaces");
                                env.put(Context.PROVIDER_URL, "jnp://localhost:1099");

                                ....................


                                But if i'm using the server which is running in another machine then how can i configure that server.

                                if i tried like below it shows an error....
                                ....
                                ....
                                env.put(Context.PROVIDER_URL, "jnp://192.116.23.25:1099");


                                So plz tell me or post the code and tell me what configuraion (if required) i have to make in the server machine.....


                                • 13. Re: How to access JBOSS by providing IP address
                                  Priya Rao Newbie

                                  Hi Aneesh ,,.. ...... i'm waiting 4 ur reply.....what i configured in myApp if the server is running on my machine only ..... is below....



                                  Hashtable env = new Hashtable();

                                  env.put(Context.INITIAL_CONTEXT_FACTORY,
                                  "org.jnp.interfaces.NamingContextFactory");
                                  env.put(Context.URL_PKG_PREFIXES,
                                  "=org.jboss.naming:org.jnp.interfaces");
                                  env.put(Context.PROVIDER_URL, "jnp://localhost:1099");

                                  ....................


                                  But if i'm using the server which is running in another machine then how can i configure that server.

                                  if i tried like below it shows an error....
                                  ....
                                  ....
                                  env.put(Context.PROVIDER_URL, "jnp://192.116.23.25:1099");


                                  So plz tell me or post the code and tell me what configuraion (if required) i have to make in the server machine.....

                                  • 14. Re: How to access JBOSS by providing IP address
                                    Mary Abu Newbie

                                    What eror you are getting?
                                    Is it an IOException?

                                    Is your jndi on the same port 1099?

                                    If so try to telnet to that port and c?

                                    1 2 Previous Next