Saturday, July 31, 2010

? Resin with MySQL as DB

Type A:
You need to edit the configuration file for Resin - resin.conf; to tell Resin how to access your new MySql databases.


It would be under 
unix        : resin.home/conf
windows  : RESIN_HOME/conf


The configuration file by default defines a database whose JNDI name is jdbc/mysql and which is known by MySql as "test" .




You need to replicate Database part for each database to be created.  


For example, we might define the JNDI name for Application A as  "jdbc/A" . Similarly for Application B, we will have a JNDI entry with name "jdbc/B"


I have used mysql jdbc connector - in that case the driver name would look like "com.mysql.jdbc.Driver" and mysql connector jar will go into resin.home/lib or RESIN_HOME/lib.


restart your resin server. 




Type B
Along with web.xml under WEB-INF folder of your application create a resin-web.xml - with the connection details. In this case your jar will go in the lib folder or your application.







Friday, July 30, 2010

How to Install ZK on Resin

Resin

1. Download Resin from http://caucho.com/download/index.xtp and install it, if you haven't installed it yet.
2. Unzip zk-3.0.0.zip or zk-3.0.0.tar.gz
3. Copy dist/lib/*.jar to $RESIN_HOME/lib ($RESIN_HOME is where you installed Resin.)
4. Copy dist/lib/ext/*.jar to $RESIN_HOME/lib
5. Deploy demo/bin/zkdemo.war to Resin by copying it to $RESIN_HOME/webapps directly.
6. Start Resin.

Saturday, July 24, 2010

? How to install Mysql5.1 Server in Ubuntu 10.04 Server edition

To install MySQL, run the following command from a terminal prompt:

sudo apt-get install mysql-server
During the installation process you will be prompted to enter a password for the MySQL root user.

Once the installation is complete, the MySQL server should be started automatically. You can run the following command from a terminal prompt to check whether the MySQL server is running:

sudo netstat -tap | grep mysql
When you run this command, you should see the following line or something similar:

tcp        0      0 localhost.localdomain:mysql           *:* LISTEN -

If the server is not running correctly, you can type the following command to start it:
sudo /etc/init.d/mysql restart


Network Configuration :
You can edit the /etc/mysql/my.cnf file to configure the basic settings -- log file, port number, etc. For example, to configure MySQL to listen for connections from network hosts, change the bind_address directive to the server's IP address:

bind-address            = 192.168.0.5
Replace 192.168.0.5 with the appropriate address.


or 


Comment the whole line, where in system will act perfectly in a DHCP env.

After making a change to /etc/mysql/my.cnf the mysql daemon will need to be restarted:
sudo /etc/init.d/mysql restart






User Configuration:
Log in to mysql server using
mysql -u root -p


GRANT ALL PRIVILEGES ON *.* TO 'myaccount'@'%' IDENTIFIED BY 'some_pass' WITH GRANT OPTION


The above should be executed for all the users of MySQL server. Also this should be executed replacing '%' with '%/localhost/ipaddress'  times.


Now try to connect to MySQL server using clients like Toad, SQL Yog and you are in.









? How to install .rpm files in Ubuntu 10.04

Install alien in Ubuntu

sudo apt-get install alien
This will install all the required packages.Now you can start converting your .rpm files to .deb packages.

Available Options for alien

Convert the package.rpm into a package.deb
sudo alien -d package-name.rpm

Convert the package.rpm into a package.deb, and install the generated package.
sudo alien -i package-name.rpm

If you want to keeps alien from changing the version number use the following command
sudo alien -k rpm-package-file.rpm

Example
Suppose we have a avg antivirus avg71lms-r30-a0782.i386.rpm file

To convert .rpm to debian
sudo alien -k avg71lms-r30-a0782.i386.rpm

Now you should be having avg71lms-r30-a0782.i386.deb file

To install .deb file
sudo dpkg -i avg71lms-r30-a0782.i386.deb


Friday, July 23, 2010

? VirtualBox 3.2.6 and Guest Additions
















Its quite some time, I struggled to get this thing up and running in my :


Host OS : Windows 7 64 bit
Guest OS:  Ubuntu Server 10.04
Virtual Box Guest Additions for 64 bit

If you are also experiencing the same, then follow the simple steps:

1. Install VBox 3.2.6 on Window 7 
2. Install Ubuntu Server 10.04 
3. Start Virtual Server & Click Devices - > Shared folders and add a Host machine folder.
4. Click on Devices - > Install Guest Additions
5. On Terminal paste  
     sudo apt-get install build-essential linux-headers-`uname -r`
    Note: replace 'uname -r' with the actual value 
    e.g. sudo apt-get install build-essential linux-headers-2.6.32-21-server
6. Create mount points for the Shared drive and then run the following 
     sudo mount /dev/cdrom /mnt
    Note: Point to the actual cdrom  in your machine. 
7. Run 
     sudo bash /mnt/VBoxLinuxAdditions-amd64.run
   Note: There might chances of you getting following errors and not all     features are installed properly



Installing the Window System drivers ...fail!
(Could not find the X.org or XFree86 Window System.)



This is fine. VirtualBox's Guest Additions installs some features that we don't need on a server. If you want these features, you'll have to install them by 

     sudo apt-get install xserver-xorg xserver-xorg-core
8. Reboot the Guest OS and as a last step, you have to now mount the Host share to Guest mount point
    mount -t vboxfs share mountpoint
     Note: If you get an error like this mount: unknown filesystem type 'vboxfs'
Run the following command
mount -t vboxsf share mountpoint
    Replace the share and mountpoint with your actuals.
9. Browse to your mount point to see the shared Folders/ Files.


10. To make this permanent loadable :
      append fstab with 
       'HostShareName /GuestMountPoint vboxsf defaults  0 0' 
      after running sudo vi /etc/fstab


    Note: If Step#10 is executed wrongly, system will not Boot



















   

Tuesday, July 20, 2010

? Blogspot BUG :)

Guys wake and see this BUG.
I have already deleted the header and entry.... still its displayed :)