Friday, December 14, 2012

Jboss 7 Installation on RHEL 6.3

Check the server hostname correctly assigned:

# vim /etc/hosts
# vim /etc/sysconfig/network

Check http service running or not:

#/etc/init.d/httpd status.
It should running....

Create jboss user :

#useradd jboss

Download latest  jdk 7 to /user/local and install it:

# rpm -ivh jdk-7u7-linux-x64.rpm
 
To check java installed or not:
# java --version  

Set java variable path:

#JAVA_HOME=/usr/java/latest
#export JAVA_HOME
#PATH=$JAVA_HOME/bin:$PATH:$HOME/bin


Also add the above 3 lines  in vim /etc/bash_profile save and close it.

Download jboss7 to /usr/local/ and unzip it.

#unzip jboss-as-7.1.1.Final.zip  (It will unzip as jboss-as-7.1.1 )
#mv jboss-as-7.1.1 jboss-as

Assign the owner permission to jboss for /usr/local/jboss-as directory.
 
#chown -R jboss:jboss /usr/local/jboss-as


To create service user /etc/init.d do as follow:

#cp /usr/local/jboss-as/bin/init.d/jboss-as-standalone.sh /etc/init.d/jboss
#mkdir /etc/jboss-as
#cp /usr/local/jboss-as/bin/init.d/jboss-as.conf /etc/jboss-as/

#chmod 755 /etc/ini.d/jboss

Edit and add the below entries in /etc/init.d/jboss:

#vim /etc/init.d/jboss

# chkconfig: - 234 80 20  to run jboss in 234 run level
 

# Set defaults.

JBOSS_USER=jboss
export JBOSS_USER

if [ -z "$JBOSS_HOME" ]; then
  JBOSS_HOME=/usr/local/jboss-as

Save and close text editor...


To access jboss console through browser from remote system:

change 0.0.0.0 instead of 127.0.0.0. only in the below lines.

# vim /usr/local/jboss-as/standalone/configuration/standalone.xml 

 <interface name="management">
            <inet-address value="${jboss.bind.address.management:0.0.0.0}"/>
        </interface>
        <interface name="public">
            <inet-address value="${jboss.bind.address:0.0.0.0}"/>



save and close text editor.

#chkconfig --add jboss
#chkconfig jboss on

Now we can start the jboss as system service:

#/etc/init.d/jboss start

and 

We can access it through browser.
10.0.0.1:8080




     *************************************************************

To add jboss mnagement user:

Go to /usr/local/jboss-as/bin/
#./add-user.sh
You should see the following message on the console after executing the command:
What type of user do you wish to add?
a) Management User (mgmt-users.properties)
b) Application User (application-users.properties)
(a): a
We select “a”, next you should see the following message:
Enter the details of the new user to add.
Realm (ManagementRealm) :
Username : jboss
Password :
Re-enter Password :
* hit enter for Realm to use default, then provide a username and password
We select the default value for the Realm (ManagementRealm), by hitting enter, and select “jboss” as our username and password.


 

 




Thursday, October 25, 2012

Acl in linux



1.To set acl for a folder :

# setfacl -m u:username:rwx foldername

2.To set acl for solder and their sub folder.

.#setfacl -R -m u:username:rwx foldername 

3.To view acl for a folder :
#getfacl foldername

4.To remove acl for a folder :
setfacl -b u:username:rwx foldername

 
 
 

Tuesday, October 23, 2012

How to import store proceedure in mysql

To fix this.

Export store procedure from existing database with below command;

#mysqldump -p --no-create-db --no-create-info --no-data --routines DBNAME > DBNAME_23Oct2012.sql
 
And imoprt .sql file to running db.
 
#mysql -u root -p DBNAME < DBNAME_23Oct2012.sql  
 
 
Restart Mysql DB
 
To check Store procedure in Mysql
 
#Login into mysql DB and type the below command
 
SHOW PROCEDURE STATUS;
SHOW FUNCTION STATUS;
 
Thats it!!!!

Thursday, October 18, 2012

Starting MySQL.Manager of pid-file quit without updating fi[FAILED]

Am getting below eror on of my mysql server while starting mysql service"Starting MySQL.Manager of pid-file quit without updating fi[FAILED] "


 To resolve this issue i tried the below
# ps -ef | grep -i mysql
kill the all running process 

Try to start mysql
#services mysqld start

It worked for me..



Wednesday, October 10, 2012

How to import and Export Mysql db

To export mysqlDB:


1.Type the below command to export mysql db:

# mysqldump -u root -p dbname> dbname11092012.sql

To import mysql DB:

1.Go to file location where you saved  backup db and type following command.

 2.login into mysql and create new database.

> create databases newdb

3.exit from sql and type as following

# mysql -u root -p  newdb < db_04102012-0700.sql

[where newdb is newly created db and db_04102012-0700.sql is going to restore newly created db.]

Friday, October 5, 2012

How to Allow MySQL Client to Connect to Remote MySQL server

If you try to connect to a remote MySQL database from your client system, you will get “ERROR 1130: Host is not allowed to connect to this MySQL server” message as shown below.

# mysql -h 10.10.28.8 -u root -p
Enter password:
ERROR 1130: Host '10.10.28.8' is not allowed to connect to this MySQL server


1.Try to telnet server from client machie

# telnet 192.168.1.8 3306
host 10.10.28.8 is not allowed to connect to this mysql server



 2.To allow a specific client ip-address (10.10.28.8) to access the mysql database running on a server,

# mysql -u root -p
Enter password:

mysql> use mysql

mysql> GRANT ALL ON *.* to root@'10.10.28.8' IDENTIFIED BY '$dfg!23'; 

mysql> FLUSH PRIVILEGES;
 

That's it.....It should work!!!!


  

To resolve!! Starting jboss-as: chown: missing operand after `/var/run/jboss-as' Try `chown --help' for more information.in Jboss 7

While starting Jboss service i am getting following error meesage in jboss7.

 "Starting jboss-as: chown: missing operand after `/var/run/jboss-as'Try `chown --help' for more information."


To over come this ,

#vim /usr/local/jboss-as/standalone/configuration/standalone.xml

 and add the below line into standalone.xml file

# Set defaults.
JBOSS_USER=jboss
export JBOSS_USER









Now we can start the jboss server as usual without any error message.
#/etc/init.d/jboss start

Enjoy!!!!...