Ubuntu:Programming

From Alexandre Navarro's Wiki

Revision as of 23:36, 21 May 2010 by Anavarro (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

Contents

Compiler

Sun JDK (1.6)

Installation under Ubuntu

apt-get install sun-java6-bin sun-java6-demo sun-java6-fonts sun-java6-jdk sun-java6-jre sun-java6-javadb sun-java6-source

Open JDK (1.6)

Installation under Ubuntu

apt-get install openjdk-6-jre icedtea6-plugin openjdk-6-jdk openjdk-6-doc openjdk-6-source openjdk-6-demo openjdk-6-jre-headless


Web Server

Apache

Installation under Ubuntu

sudo apt-get install apache2

Manual Installation :

Each user can create a site under ~/public_html/

http://localhost/~anavarro/index.html


Servlet Server

Tomcat

Installation

wget http://apache.crihan.fr/dist/tomcat/tomcat-6/v6.0.18/bin/apache-tomcat-6.0.18.tar.gz
sudo cp apache-tomcat-6.0.18.tar.gz /usr/local
rm -rf apache-tomcat-6.0.18.tar.gz
cd /usr/local/
sudo tar -xvzf apache-tomcat-6.0.18.tar.gz
sudo ln -s apache-tomcat-6.0.18 tomcat
sudo rm apache-tomcat-6.0.18.tar.gz
sudo chown -R anavarro *tomcat*

Mod Jk for Tomcat

Do

jakarta-tomcat-connectors-jk-1.2.6-src.tar.gz
cd jk/native
./configure --with-apxs=/usr/local/apache2/bin/apxs --enable-EAPI
make
cp ./apache-2.0/mod_jk.so $APACHE_HOME/modules

Create workers.properties in $APACHE_HOME/conf

workers.tomcat_home=/usr/local/tomcat5
workers.java_home=$JAVA_HOME
ps=/
worker.list=default

worker.default.port=8009
worker.default.host=localhost
worker.default.type=ajp13
worker.default.lbfactor=1

Add in http.conf

LoadModule jk_module modules/mod_jk.so
AddModule mod_jk.c

#
# Mod_jk settings
#

   JkWorkersFile "conf/workers.properties"
   JkLogFile "logs/mod_jk.log"

   JkLogLevel error

  JkMount /jsp-examples default
  JkMount /jsp-examples/* default

# End of mod_jk settings
  

(look http://www.galatea.com/flashguides/apache20-tomcat5-modjk-linux)

DM Server

//TODO


Databases

HSQL

sudo apt-get install hsqldb-server
sudo gedit /etc/hsqldb/server.properties
# HSQLDB server configuration file
# See the Advanced Topics chapter of the Hsqldb User Guide.
# See also the file /etc/hsqldb/sqltool.rc.

server.database.0       file:///var/lib/hsqldb/db0/db0
sudo gedit /etc/hsqldb/webserver.properties
# HSQLDB server configuration file
# See the Advanced Topics chapter of the Hsqldb User Guide.
# See also the file /etc/hsqldb/sqltool.rc.

server.port 8080
server.database.0       file:///var/lib/hsqldb/db0/db0

Launch

sudo /etc/init.d/hsqldb-server start

Configuration jdbc

url		: jdbc:hsqldb:db0://localhost
driver		: org.hsqldb.jdbcDriver
login		: sa
password 	: 
libsql		: hsqldb.jar

Postgresql

Install Postgresql 8.1

sudo apt-get install postgresql-8.0
sudo mkdir -p /var/lib/postgresql/8.1/data
sudo chown -Rf postgres.postgres /var/lib/postgresql/
sudo chmod 700 /var/lib/postgresql/8.1/data/

Init database

sudo su - postgres -c "/usr/lib/postgresql/8.1/bin/initdb --pgdata /var/lib/postgresql/81/data"
sudo su - postgres

Create user stockfi

createuser stockfi -P -D -A

Create database stockfi with le user stockfi

createdb -O stockfi -E LATIN1 stockfi
cd /etc/init.d
sudo gedit postgresql
#!/bin/sh
# postgresql v1.0 Fev 12 01:08:21 PDT 2003 written by : Kernel <kernel@trustonme.net>
# Start/stop/restart postgresql :

postgres_start()	{
	echo "Starting postgresql 8.0"
	su - postgres -c "/usr/lib/postgresql/8.0/bin/pg_ctl start -D '/var/lib/postgresql/8.0/data' -s -l '/var/lib/postgresql/8.0/data/postgresql.log' -o '-N 1024 -B 2048'"
}

postgres_stop ()	{
	echo "Stopping postgres 8.0"
	su - postgres -c "/usr/lib/postgresql/8.0/bin/pg_ctl stop -D '/var/lib/postgresql/8.0/data' -s -m fast"
}

postgres_restart () {
	echo "Restarting postgres 8.0"
	su - postgres -c "/usr/lib/postgresql/8.0/bin/pg_ctl restart -D '/var/lib/postgresql/8.0/data' -s -m fast -l '/var/lib/postgresql/8.0/data/postgresql.log' -o '-N 1024 -B 2048'"
}

case "$1" in
	'start')
 		postgres_start
 	;;
	'stop')
 		postgres_stop
 	;;
	'restart')
 		postgres_restart
 	;;
	*)
   		echo "Usage: postgresql {start|stop|restart}"
esac

Look http://www.trustonme.net/didactels/183.html http://www.supinfo-projects.com/fr/2005/install_serv_postgres_jonas/2/ http://www.gcolpart.com/howto/postgresql.php4


MySQL

sudo apt-get install mysql-server
cd && sudo mysql_secure_installation

Look http://doc.ubuntu-fr.org/serveur/lamp_bis


Oracle

Add in /etc/apt/sources.list

# Oracle
deb http://oss.oracle.com/debian unstable main non-free
sudo apt-get install oracle-xe

Sybase

Install

tar xvzf ase1500_xe_linux.tar.gz

Create a account sybase with sudo rights

Launch installation (do not have a hostname beginning with a digit)

su sybase
sudo ./setup

Export Variables

export SYBASE=/opt/sybase
export ASE=ASE-15_0
export LANG=fr

Put the shared memory at 64 Mb

sudo /sbin/sysctl -w kernel.shmmax=67108864

Launch

sudo /opt/sybase/ASE-15_0/install/RUN_ALEXCOMPUTER

H2

wget http://www.h2database.com/h2-2006-06-16.zip
sudo cp h2-2006-06-16.zip /usr/local
rm -rf h2-2006-06-16.zip
cd /usr/local/
sudo unzip h2-2006-06-16.zip
sudo mv h2 h2-2006-06-16
sudo ln -s h2-2006-06-16 h2
sudo rm h2-2006-06-16.zip
sudo chown -R navarroa h2*


SQL Client

Aqua Data Studio

wget http://download.aquafold.com/download/v4.7.2/linux/ads-linux-x86-4.7.2.tar.gz
sudo cp ads-linux-x86-4.7.2.tar.gz /usr/local
rm -rf ads-linux-x86-4.7.2.tar.gz
cd /usr/local/
sudo tar -xvzf ads-linux-x86-4.7.2.tar.gz 
sudo mv datastudio datastudio-4.7.2
sudo ln -s datastudio-4.7.2 datastudio
sudo rm ads-linux-x86-4.7.2.tar.gz
sudo chown -R navarroa datastudio*

IDE

Eclipse

Manual Installation

wget http://eclipse.linuxant.fr/eclipse/downloads/drops/R-3.4.1-200809111700/eclipse-SDK-3.4.1-linux-gtk-x86_64.tar.gz
sudo cp  eclipse-SDK-3.4.1-linux-gtk-x86_64.tar.gz /usr/local
rm -rf eclipse-SDK-3.4.1-linux-gtk-x86_64.tar.gz
cd /usr/local/ 
sudo tar -xvzf eclipse-SDK-3.4.1-linux-gtk-x86_64.tar.gz
sudo mv eclipse eclipse-3.4
sudo rm eclipse-SDK-3.4.1-linux-gtk-x86_64.tar.gz
sudo chown -R anavarro eclipse*

gedit /usr/local/eclipse-3.4/eclipse.ini

-startup
plugins/org.eclipse.equinox.launcher_1.0.101.R34x_v20080819.jar 
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.0.101.R34x_v20080731
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
-vmargs
-Xms128m
-Xmx512m

Eclipse Plugins

Eclipse:Eclipse_Plugins


Versionning Control Source

CVS

sudo apt-get install cvs

SVN

sudo apt-get install subversion

Mercurial

sudo apt-get install mercurial


Git

sudo apt-get install git-core

Build Tool

Maven 2

sudo apt-get install maven2

Or

wget http://mir2.ovh.net/ftp.apache.org/dist/maven/binaries/apache-maven-2.0.9-bin.tar.gz
sudo cp apache-maven-2.0.9-bin.tar.gz /usr/local
rm -rf apache-maven-2.0.9-bin.tar.gz 
cd /usr/local/
sudo tar -xvzf apache-maven-2.0.9-bin.tar.gz
sudo ln -s apache-maven-2.0.9 maven
sudo chown -R anavarro maven*
sudo rm -rf apache-maven-2.0.9-bin.tar.gz
Personal tools