How to Set up Jive 5 Application in Windows Environment / CentOS VM  using Virtual Box

     

    Summary

    Jive 5 is not supported in a Windows environment.  The best way to set up a developer environment for Windows users is to create a local Virtual Box VM with Cent OS.  This allows you to build and run the app from Linux while developing on your Windows machine.

     

    1. Download and Install Virtual Box.

    a. Download and Install virtual Box(Virtual Box 4.0.10 for Windows hosts x86/amd64)

    b. After installing virtual box, create the VM with 800 MB system memory and virtual hard disk for 8 GB.

     

     

    2. Install Cent OS VM set up

    You can download the latest release of CentOS 5 here.

    Install Cent OS with the default settings.  Install either the Desktop or Server configuration of CentOS.  If you are proficient in Linux, you may want to use the Server version as it will use less memory.  Installing the Server version will require you to perform step 8.

     

     

    3. Install Maven on Cent OS

    a. Download Apache Maven.

     

    b. Change permission to 700:

    # chmod 700 apache-maven-2.2.1-bin.tar.gz
    

     

        c. Extract the files from above archive. Below command will create a apache-maven-2.2.1 directory in your current directory.

    # tar xzf apache-maven-2.2.1-bin.tar.gz
    

     

    d. Move the above directory /usr/local directory by command:

    # mv ../apache-maven-2.2.1 /usr/local
    

     

    e. Create Symbolic link for maven by :

    # ln -s apache-maven-2.2.1 maven
    

     

    f. Now you need to add maven your system path, so that you call it from anywhere. Open .bashrc file :

    # vi ~./.bashrc
    

     

    g. Add following to the end of file

    export M2_HOME=/usr/local/maven
    export PATH=${M2_HOME}/bin:${PATH}
    

    Save the changes by pressing escape key and then :wq!.

     

    h. Source the .bashrc file to load your changes.

    # source ~/.bashrc
    

     

    i. Confirm your maven version by running the following command

    # mvn –version
    

     

    Apache Maven 2.2.1 (r801777; 2009-08-06 23:16:01+0400)
    Java version: 1.6.0_24
    Java home: /opt/jdk1.6.0_24/jre
    Default locale: en_US, platform encoding: UTF-8
    OS name: “linux” version: “2.6.18-194.26.1.el5.028stab070.14? arch: “amd64? Family: “unix”
    

    Now you are ready to compile and build your maven projects.

     

     

    4. Install Tomcat on CentOS

    Download this file and extract it to /opt/.

    wget http://mirror.uoregon.edu/apache/tomcat/tomcat-6/v6.0.32/bin/apache-tomcat-6.0.32.tar.gz
    tar -xzf apache-tomcat-6.0.32.tar.gz
    sudo mv apache-tomcat-6.0.32 /opt/
    

     


    5. Install Postgres on the VM

    Following are the steps to install Postgres here.

     

    Troubleshooting

        I faced auth failed problem while creating database : followed this link to fix the problem- http://www.cyberciti.biz/faq/psql-fatal-ident-authentication-failed-for-user/

         Following are the steps from the above mentioned link to fix this problem.

         It gives me an error that read as follows:

    psql: FATAL:  Ident authentication failed for user "username"

    To fix this error open PostgreSQL client authentication configuration file /var/lib/pgsql/data/pg_hba.conf :

    # vi  /var/lib/pgsql/data/pg_hba.conf
    

     

    This file controls:

    1. Which hosts are allowed to connect.
    2. How clients are authenticated.
    3. Which PostgreSQL user names they can use.
    4. Which databases they can access .

    By default Postgresql uses IDENT-based authentication. All you have to do is allow username and password based authentication for your network or webserver.

    IDENT will never allow you to login via -U and -W options. Append following to allow login via localhost only:

    local     all     all     trust
    host     all     127.0.0.1/32     trust

     

     

    6.  Install pgAdmin III (optional, Desktop CentOS only)

    This link describes installling PG Admin III on CentOS.

     

    pgAdmin III is a Desktop application which allows you to easily acces and manipulate your Postgres database.

     

    Alternatively, you can use the Postgres terminal commands: psql, createdb, dropdb, pg_dump, and pg_restore

     

     

    7. Share Windows Folder

    a. Install Guest Addition using the following these steps.

    b. In the shared folders add the Windows folder name and location that is to be shared with centos VM.

    c. Mount the shared folder in centos using the command

    mount -t vboxsf  sharename  mountpoint
    

                   •    sharename – Name of the shared folder mentioned in the Virtual Box shared folder settings.

                   •    mountpoint – directory  where you want your shared folder contents to appear.

     

    Since the files are in the windows shared folder those can be edited in Windows using any IDE of your choice.

     

     

    8. Setup Port Forwarding (optional for Desktop)

    Set up Port Forwarding for port 80 and 22.  To do this, select your VM while it is stopped, then Settings > Network > Advanced > Port Forwarding.  You will need to stop your VM to access this.  Under Port Fowarding Rules create the following rules:

    • Tomcat Forarding: Host Port: 8081, Guest Port: 8080, Protocol: TCP
    • SSH Forwarding: Host Port: 2222, Guest Port: 22, Protocol: TCP

     

    This will allow you to SSH into your VM via your Windows Machine by SSH'ing into localhost over port 2222.

    You will also be able to access your test environment in your web browser by visiting http://localhost:8081/

     

    If you choose to not set up port forwarding, you will need to access your instance via the web browser available in Cent OS.

     

     

    9. Start Developing