Saturday, November 30, 2013

Jboss server start in ubuntu (commands)

1. Download jboss
     * download using
wget http://download.jboss.org/jbossas/7.1/jboss-as-7.1.1.Final/jboss-as- 7.1.1.Final.tar.gz
    OR


     * From the site
            http://www.jboss.org/products

I have downloaded from site (Red Hat® JBoss® Enterprise Application Platform)

2. Make sure you have java installed in your system using (java -version) command
3. Extract jboss to opt directory
    sudo unzip jboss.zip -d /opt
4. cd to the jboss bin directory
    cd /opt/jboss/bin
5. add a user for the jboss server
    ./add-user.sh

    * select management user
    *(no need to put any relm) use default
    *give username
    *give password
6. start jboss server
    ./standalone.sh


browse using localhost:9990
(user the user name and pass to enter the management console)

Additional monitoring 

1. netstat -an | grep 8080 (confirm jboss is listening to port 8080)
2. netstat -an | grep 9990
3. ps -ef (to see if jboss process is running or not)
4. ./jboss-cli.sh --connect command=:shutdown (shutdown jboss server)



Monday, April 22, 2013

servlet to jsp using json (object passing)

jquery


$('.snd').click(function (){
    $.ajax({
        url: '/M08CDECUStructuralOptimiser/NodeAction?action=test',
        data: {cl1: $('.t11').val()},
        dataType: "json",
        success: function (response){
            alert(response[1]);
        }
    });
});



Servlet



if (action.compareTo("test") == 0) {
           
            String[] ss= {"n1","n2"};
            Form f1=new Form(1,2,3);
            response.setContentType("text/html;charset=UTF-8");
            PrintWriter out = response.getWriter();
            try {

                Gson gson = new GsonBuilder().setPrettyPrinting().create();
                String json=gson.toJson(ss);
               
                out.println(json);
            } finally {
                out.close();
            }
        }

Friday, April 19, 2013

set conf file in linux

file name asenv.conf

add line

AS_JAVA="/home/szlynas/jdk1.6.0_45"

Thursday, April 18, 2013

run glassfish server on linux console command

./glassfish-3.1.2.2/bin/asadmin start-domain

Xampp setup in linux

This solution worked well for me: http://www.apachefriends.org/f/viewtopic.php?f=17&t=50902&p=196185#p196185
Edit /opt/lampp/etc/extra/httpd-xampp.conf and adding Require all granted line at bottom of block <Directory "/opt/lampp/phpmyadmin"> to have the following code:
<Directory "/opt/lampp/phpmyadmin">
  AllowOverride AuthConfig Limit
  Order allow,deny
  Allow from all
  Require all granted
</Directory> 
 


Extract the downloaded archive file to /opt: tar xvfz xampp-linux-1.8.1.tar.gz -C /opt


To start XAMPP simply call this command:
/opt/lampp/lampp start






# Close XAMPP sites here
<LocationMatch "^/(?i:(?:xampp|licenses|phpmyadmin|webalizer|server-status|server-info))">
    Order deny,allow
    Deny from all
    Allow from ::1 127.0.0.0/8 
    ErrorDocument 403 /error/HTTP_XAMPP_FORBIDDEN.html.var
</LocationMatch>