Tuesday, February 3, 2009

Install and test Maven on CentOS 5.2

1. Make sure Java has been installed on the system by running:
java --version

2. Down load the current maven, apache-maven-2.0.9-bin.tar.gz, from http://maven.apache.org/download.html.

3. untar the file to /usr/local/apache-maven-2.0.9, then create symbolic link:
ln -s apache-maven-2.0.9 maven

4. Append following to the end of ~/.bashrc:
export M2_HOME=/usr/local/maven
export PATH=${M2_HOME}/bin:${PATH}

5. Bring in the environment changes:
. ~/.bashrc

6. Check the installation:
mvn --version

7. At a local you pick to create a project that will create my-app directory:
mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app

8. Build and test the project:
cd my-app
mvn package
java -cp target/my-app-1.0-SNAPSHOT.jar com.mycompany.app.App

If the famous "Hello World!" comes up, the package is built correctly.

9. House keeping:
mvn clean dependency:copy-dependencies package

10. Create target:
mvn site

Fix the relogin problem for phpMyadmin CentOS 5.2

If no activity for 30 minutes, phpMyadmin will log you out for security reason.

To change this, modify a line in /usr/share/phpmyadmin/config.inc.php from cookie to http from "$cfg['Servers'][$i]['auth_type'] = 'cookie';" to "$cfg['Servers'][$i]['auth_type'] = 'http';"

Monday, February 2, 2009

Inatall Eclipse on CentOS 5.2

To install Eclipse on CentOS, run the following command as root:

yum install eclipse-*

After the installation, Eclipse has been created in the Application->Programming.

Rename database and table for mySQL

1. Find out the database location on the system. It is at /var/lib/mysql on my CentOS 5.2. Change to that directory:
cd /var/lib/mysql

2. Stop mySQL server:
/etc/init.d/mysql stop

3. Rename the name of the database.
mv mydb.old mydb.new

4. Rename the table files in the new database directory:
cd mydb.new
mv oldtable.frm newtable.frm
mv oldtable.MYD newtable.MYD
mv oldtable.MYI newtable.MYI

5. Start mySQL server:
/etc/init.d/mysql start