23 Haziran 2014 Pazartesi

Sonar And LDAP Integration

After many hours finally I figure out how to integrate ldap plugin with sonarqube-4.3. Actualy I found which configuration items where mandatory for successfully ldap based login.

At least the next ldap properties must be mentioned in sonar properties file:


#ldap connection properties
  1. sonar.security.realm=LDAP
  2. ldap.url=ldap://mycompany.com
  3. ldap.authentication=simple
  4. ldap.realm=mycompany.com

#ldap login properties
  1. ldap.bindDn=cn=XXXXX
  2. ldap.bindPassword=PASSWORD
  3. ldap.loginAttribute=mail


Property "ldap.authentication" works only with "simple" value. There are another encryption options which can be used but only option simple was working.

20 Haziran 2014 Cuma

How to add a regular application to linux services list

I want to explain how je can add an application to linux services and start/stop via services. By this example I use sonarqube as example application. There are two steps to add an application linux services list.

1.create a script which calls your applications actual start and stop script. Save the script under /etc/init.d as execuatble file. You can use the example content als start point.


#!/bin/sh
#
# rc file for SonarQube
#
# chkconfig: 345 96 10
# description: SonarQube system (www.sonarsource.org)
#
### BEGIN INIT INFO
# Provides: sonar
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6
# Short-Description: SonarQube system (www.sonarsource.org)
# Description: SonarQube system (www.sonarsource.org)
### END INIT INFO
 
/usr/bin/sonar $*
 
 

2-a. Debian based linux distros such as ubuntu registers applications with "update-rc.d". We should create a symbolik link under "/user/bin" with name "sonar". /usr/bin is by default added to the PATH. So by reboot is it easy starting the application by typing only  command "sonar".

sudo ln -s $SONAR_HOME/bin/linux-x86-32/sonar.sh /usr/bin/sonar
sudo chmod 755 /etc/init.d/sonar
sudo update-rc.d sonar defaults
 

2-b Registering service on boot time for RedHat, CentOS, 64 bit based linux distro's

sudo ln -s $SONAR_HOME/bin/linux-x86-64/sonar.sh /usr/bin/sonar
sudo chmod 755 /etc/init.d/sonar
sudo chkconfig --add sonar