1 Reply Latest reply on Mar 5, 2017 7:54 AM by Nobu Teru

    JBoss 7 Final on Ubuntu and LAMP server

    Roberto M Newbie

      Hello,

      I am new at this forum, this is my first post, I just want to know if is possible to have an Ububuntu box (Kubuntu 16.10) with running :

      • eclipse [OK]
      • lamp [OK]
      • jboss 7 final [KO]

       

      • I downloaed eclipse neon JEE 4.6 from eclipse web site, all = ok
      • I downloaed from eclipse market place JBOSS and JTOOL = ok
      • I installed LAMP server, apache, php7 and mysql working = ok
      • Searched some how to on internet 1) https://www.digitalocean.com/community/tutorials/how-to-install-jboss-on-ubuntu-12-10-64bit
      • I download tar file from Jboss :
          • untarred everything in /opt
          • created user jboss and group jbossgroup
          • sudo chmod -R  jboss: jbossgroup  /opt/jbos**
          • ./add-user.sh

       

      What type of user do you wish to add?

       

       

      a) Management User (mgmt-users.properties)

       

       

      b) Application User (application-users.properties)

       

       

      (a): a

       

       

      Enter the details of the new user to add.

       

       

      Realm (ManagementRealm) :

       

       

      Username : app1

       

       

      Password :

       

       

      Re-enter Password :

       

      modifyed:

       

      nanow -w /opt/jboss-as-7.1.1.Final/standalone/configuration/standalone.xml

       

      <interface name="management">

        <!--<inet-address value="${jboss.bind.address.management:127.0.0.1}"/>-->

        <any-ipv4-address/>

      </interface>

      <interface name="public">

        <!--<inet-address value="${jboss.bind.address:127.0.0.1}"/>-->

        <any-ipv4-address/>

      </interface>

       

       

      tryed (also my internal ip from ifconfig) :

       

      ./standalone.sh -Djboss.bind.address=localhost-Djboss.bind.address.management=localhost&

       

       

      http://localhost:9990/console

       

      tryed also :

       

      http://localhost:8080

       

      but nothing...

       

       

      NOT AGAIN TRYED :

       

      I don't know what to set this varaiables:

      www.yourdomain.tld

      yourdomain.tld

       

      nano /etc/apache2/apache2.conf

       

       

      <VirtualHost *:80>

      ServerName www.yourdomain.tld

      ServerAlias yourdomain.tld

       

      DocumentRoot /var/www/demoWeb

      ProxyPassMatch ^/(.*)+\.php !

       

        ProxyRequests Off

       

        <Proxy *>

        Order deny,allow

        Allow from all

        </Proxy>

       

        ProxyPass / http://yourdomain.tld:8080/

        ProxyPassReverse / http://yourdomain.tld:8080/

       

        <Location />

        Order allow,deny

        Allow from all

        </Location>

      </VirtualHost>

       

       

      or not tryed

       

      The 9 steps to proxy success!

      1. Install Apache2.
      2. sudo a2enmod proxy
      3. sudo a2enmod proxy_http
      4. sudo a2enmod vhost_alias
      5. sudo a2dissite default (only if you are not using this site, or haven’t made changes to it)
      6. Create a file called jboss-as in /etc/apache2/sites-available:

        <VirtualHost *:80>    ServerAdmin admin@site.com    ServerName site.com    ProxyRequests Off    <Proxy *>       Order deny,allow       Allow from all    </Proxy>    ProxyPreserveHost on    ProxyPass / http://localhost:8080/ </VirtualHost>

      7. sudo a2ensite jboss-as
      8. Make sure your JBoss AS 7 instance is running on port 8080, and is accepting connections from localhost.
      9. sudo /etc/init.d/apache2 restart -or- service apache2 restart

       

      also not tryed :

       

      You can't have two applications listening to the same tcp port (80) at the same time. You can use mod_jk to have http requests on port 80 routed from Apache server to the JBoss server. This is the method I am most familiar with and prefer. mod_proxy should also work, but I find that method a little more complicated.

      Configuring https on Apache is probably best dealt with as a separate topic. There are issues with purchasing a ssl certificate, creating a self-signed certificate, etc.

      There are two steps to accomplish configure mod_jk to route requests from the Apache server to the JBoss server:

      Configure the Apache web server to forward some requests to the JBoss server.

      The Apache configuration will vary depending on the distribution of Apache that you are using (windows, RHEL, debian, built from source, etc.) but the concepts should be similar for any Apache installation.

      You need to download mod_jk for your platform from the tomcat web site:
      http://tomcat.apache.org/download-connectors.cgi
      Your OS vendor may provide a binary for you, so check there first. You may also compile mod_jk yourself if you prefer.

      Copy the mod_jk binary (mod_jk.so for Linux/UNIX system, not sure about windows) into your Apache servers modules directory (this depends on the Apache distribution you are using).

      Add the equivalent directive to your Apache configuration:

      LoadModule jk\_module /usr/lib/apache2/modules/mod\_jk.so

      You should add two configuration files to the Apache configuration directory: mod_jk.conf and workers.properties. You should include mod_jk.conf from the main Apache configuration file:

      Include /etc/apache2/mod\_jk.conf

      The workers.properties file is included by mod_jk.conf with the JkWorkersFile directive.

      More detailed settings for mod_jk.conf can be found at the tomcat documentation page:
      http://tomcat.apache.org/connectors-doc/reference/apache.html

      The important directives are:
      JkWorkersFile (specifies where the workers.properties file lives)
      JkMount (mount point for mapping of URI to tomcat worker)

      An example:

      JkWorkersFile /etc/apache2/workers.properties<br> JkMount  /examples/*  myworker<br> JkMount  /examples    myworker

      These directives map the /examples and /examples/ URI to the myworker tomcat worker.

      Conceptually you can think of a worker as representing a tomcat or JBoss instance and the mount as a way of mapping a URI to a worker. This way of representing things allows one Apache server to be the front end for several tomcat or JBoss servers. This can be handy if you have only one IP address you can use but wish to run several application servers behind one Apache server.

      The workers.properties files describes the tomcat or JBoss server(s) that the Apache server will connect to. Important entries in this file are:

      worker.list=myworker<br> worker.tomcat.type=ajp13<br> worker.tomcat.host=localhost<br> worker.tomcat.port=8009

      There are other worker properties that can be found in the tomcat documentation page for the workers.properties file:
      http://tomcat.apache.org/connectors-doc/reference/workers.html

      Configure the JBoss server to accept connections from the Apache server

      The JBoss server is configured to accept mod_jk connections on port 8009 (the default ajp port) out of the box, but it is good to know where to configure this in case you want to change any of this in the future.

      The configuration is in the tomcat based portion of the JBoss server located in ${JBOSS_SERVER_CONFIGURATION}/deploy/jbossweb.sar/server.xml. This is for JBoss AS 5.1.0.GA, previous versions are in a similar location. The mod_jk connector is configured in the Connector section for the AJP 1.3 protocol and looks like:

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

       

      The most common reason to modify this section is if you have multiple tomcat or JBoss servers connecting to apache via the AJP protocol, you can adjust the port number that the AJP connector will listens on so there are no conflicts.

       

      ANY HELP?

       

      what i should tye? i found only 3 method

       

      how to continue? please thanks to all can help me!

       

      find another method:

       

      Configuring AJP

      AJP stands for “Apache JServ Protocol” – this is the standard method of interfacing Apache with Tomcat (and later, JBoss) since the earliest versions of Tomcat. It is a packet-based protocol, which in it’s latest re-incarnation of 1.3 is very fast, while adding very little overhead. Tomcat (and by extension JBoss) speaks AJP out of the box. On the Apache side, the mod_proxy_ajp provides the necessary functionality. So let’s see how to put the whole thing together.

       

      Step 1.Enable the AJP connector In JBoss 7 the AJP connector is not enabled by default, so let’s enable it. Open $JBOSS_HOME/standalone/configuration/standalone.xml, find the subsystem tag and add the AJP connector:

      ..... <subsystem xmlns="urn:jboss:domain:web:1.1" native="false" default-virtual-server="default-host"> ... <connector name="ajp" protocol="AJP/1.3" scheme="http" socket-binding="ajp"/> ... </subsystem> .....

      Next, make sure that the ajp socket binding definition exists:

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

      Step 2. Configure mod_proxy_ajp Go to /etc/httpd/conf.d and create a file proxy_ajp.conf as follows

      <IfModule !proxy_ajp_module> LoadModule proxy_ajp_module modules/mod_proxy_ajp.so </IfModule> ProxyPass /mon_jmx_agent ajp://localhost:8009/mon_jmx_agent

      Step 3. Restart JBoss and Apache (in that order)
      Now, open a web browser and navigate to http://localhost/mon_jmx_agent. You should see the JMX agent’s login screen.

        • 1. Re: JBoss 7 Final on Ubuntu and LAMP server
          Nobu Teru Newbie

          SOLVED

           

           

          I completely uninstantiated LAMP, and re instaled with sudo tasksel

          after i manually install tomcat 8.0.41 and changed port 8080 -> 8181, 8005 -> 8015, 8009 -> 8019 in xml conf file

           

          and works together

           

          after some search i found jboss isn't working with oracle jdk 1.8, so i switch to wildfly, adding 10000 to port offset standalone.xml config file

           

          wrote .service file to start stop servers

           

          all 3 working !

           

          now i have to understand why sts eclipse (I quit with normal eclipse), don't see server status, in server panel...

           

          thanks the same!

          bye and sorry my bad English