Transformatorhuis

March 15, 2008

Apache Virtual Host on Gentoo

Filed under: Configuration — cyberroadie @ 8:26 am

Create dirctories:

mkdir /var/www/dragon3d.cyberroadie.org/
mkdir /var/www/dragon3d.cyberroadie.org/htdocs

Create file /etc/apache2/vhosts.d/00_dragon3d.cyberroadie.org.conf

ServerName dragon3d.cyberroadie.org
ServerAlias dragon3d.cyberroadie.org
DocumentRoot "/var/www/dragon3d.cyberroadie.org/htdocs"
Options Indexes FollowSymLinks
AllowOverride None Order allow,deny
Allow from all
## Redirecting should be done here
# ProxyPass /jira http://dragon3d.cyberroadie.org:8080/jira
# ProxyPassReverse /jira http://dragon3d.cyberroadie.org:8080/jira
SuexecUserGroup treee users
CustomLog /var/log/apache2/dragon3d.cyberroadie.org.log combined

Restart apache, done!

Olivier

March 2, 2008

CVS on top of GIT

Filed under: Configuration — cyberroadie @ 10:23 am

Since none of the continuous integration tools support git I had to find a workaround. Fortunately git can emulate a cvs server via xinetd and git-cvs-server.

Some small configurations:

/etc/xinetd.d/git-cvs-server:

service git-cvsserver
{
disable = no
socket_type = stream
wait = no
user = nobody
type = UNLISTED
protocol = tcp
log_on_failure += USERID
server = /usr/bin/git-cvsserver
port = 2401
server_args = git-cvsserver pserver –export-all –base-path=/var/git
}

Added to the config file of the repos:

[gitcvs "ext"]
enabled=1
logfile=/var/log/gitcvs

(Log file needs proper write access, otherwise all cvs action will fail)

On the client:
# export CVSROOT=:ext:cyberroadie@www.cyberroadie.org:/var/git/example.git
# export CVS_SERVER=git-cvsserver
# cvs co -d example master

Voila, cvs emulation :-)

Olivier

March 1, 2008

Setup Spring MVC project + debug with appfuse

Filed under: Configuration — cyberroadie @ 9:29 am

Followed this page: Archetypes list on codehouse

(Tip: in the conf/settins.xml file in your MAVEN_HOME directory, you can add: C:\.m2
to change repository path, prevents of dos related long path problems)

Create the project:
# mvn archetype:create -DgroupId=net.transformatorhuis.admin -DartifactId=th-admin -DarchetypeArtifactId=appfuse-modular-spring -DarchetypeGroupId=org.appfuse.archetypes

Get all the source (good for debugging and studying):
# mvn appfuse:full-source

Compile/test/package project:
# mvn install

Install MySQL database:
#mysql> create database th_admin
#mysql> grant all privileges on th_admin.* to th_admin@’%’ identified by ‘password’;

Make sure in MySQL config file (my.cnf) bind-address is not set to localhost (127.0.0.1), this to accept external connections.

In pom.xml change the jdbc username/host/password

Create Intellij IDEA project file:
# mvn idea:idea

Create run script with debugging enabled in web/ directory (run_jetty_debug.sh):
#!/bin/bash
export MAVEN_OPTS=”-Xmx1024m -Xms512m -Xdebug \ -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005″
mvn jetty:run

Add in Intellij a Remote session in The Run /Debug configuration, the debug line must be the same as the MAVEN_OPTS above.

In the web/ director execute ./run_jetty_debug.sh

In Intellij: set your breakpoints and start debugging via browser: http://localhost:8080/

TIP: No need to restart mvn jetty:run if you compile (mvn compile) or change configuration files of th application. Jetty automaticly picks them up :-)

Olivier

Blog at WordPress.com.