FreeRadius + MySQL + Ubuntu

Posted: August 1st, 2011 | Author: | Filed under: config, mysql, ubuntu | No Comments »

START

Install MySQL Server:
#sudo apt-get install mysql-server

Install Freeradius Server:

#sudo apt-get install freeradius freeradius-mysql

Install Apache Server:

#sudo apt-get install apache2

Install needed support for Apache Server:

#sudo apt-get install php5-mysql debhelper  libltdl3-dev libpam0g-dev libmysqlclient15-dev build-essential libgdbm-dev libldap2-dev libsasl2-dev libiodbc2-dev libkrb5-dev snmp autotools-dev dpatch  libperl-dev libtool dpkg-dev libpq-dev libsnmp-dev libssl-dev php-pear php5-gd php-db php5-mcrypt

Read the rest of this entry »


Ubuntu 11.04 – Natty Narwhal

Posted: April 29th, 2011 | Author: | Filed under: ubuntu | No Comments »

What’s new?

The release of Ubuntu 11.04 has seen the arrival of a new look and feel for Ubuntu. A whizzy, new launcher and dash, and a clever workspace manager are some of the biggest changes. Take a look at what’s new and then feel free to choose between the classic and new desktop experiences at login.

http://www.ubuntu.com/ubuntu/whats-new

http://www.howtoforge.com/how-to-upgrade-ubuntu-10.10-maverick-meerkat-to-11.04-natty-narwhal-desktop-and-server


Installing uPortal 3.2.4 on Ubuntu 10.10

Posted: December 15th, 2010 | Author: | Filed under: ubuntu | No Comments »

REQUIREMENTS

uPortal requirements are:

* Java 1.6
* Tomcat 6.0.24 (Servlet spec 2.5+) & Maven 2.2+ & Ant 1.7.1
* Database

Mental note: to install sun java 6 you need to enable the canonical repository and run apt-get update first (vim /etc/apt/sources.list):

## Uncomment the following two lines to add software from Canonical’s ‘partner’ repository.
deb http://archive.canonical.com/ubuntu lucid partner
deb-src http://archive.canonical.com/ubuntu lucid partner

On with the installation:

* Java 1.6

java -version

apt-get install sun-java6-jdk

you ‘ve got to accept their DLJ licence and that’s it.

* Tomcat 6.0.24 (Servlet spec 2.5+) & Maven 2.2+ & Ant 1.7.1

apt-get install tomcat6 maven2 ant

After the install you should be able to get the version numbers from the following.

mvn -version
ant -version

There are some other configurations that need to be made:
Environment Variables

#Maven
export M2_HOME=/usr/share/maven2
export M2=$M2_HOME/bin
export PATH=$M2:$PATH

#ant
export ANT_HOME=/usr/share/ant
export PATH=$PATH:$ANT_HOME/bin

#tomcat
export TOMCAT_HOME=/var/lib/tomcat6

#java
export JAVA_HOME=/usr/lib/jvm/java-6-sun
export PATH=$JAVA_HOME/bin:$PATH

#other environment variables
export CATALINA_BASE=/var/lib/tomcat6
export CATALINA_HOME=/usr/share/tomcat6
export CATALINA_TMPDIR=/tmp/tomcat6-tmp
export JRE_HOME=/usr/lib/jvm/java-6-sun
export CLASSPATH=/usr/share/tomcat6/bin/bootstrap.jar

catalina / tomcat

Some things need to be changed, we must customize it to our specific environment as seen in the manual : https://wiki.jasig.org/display/UPM32/The+Servlet+Container
Shared Libraries
Enabling shared libraries in CATALINA_BASE/conf/catalina.properties

vim $CATALINA_BASE/conf/catalina.properties
# jkara

shared.loader=${catalina.base}/shared/classes,${catalina.base}/shared/lib/*.jar

Shared Sessions
Example Tomcat Connector Configuration

vim $CATALINA_BASE/conf/server.xml

URIEncoding=”UTF-8″ redirectPort=”8443″
emptySessionPath=”true” compression=”on”
compressableMimeType=”text/html,text/xml,text/plain” />

After meeting the above requirements you can test the default page http://mydomain.info:8080/ hopefully that will work!
Download and Configure uPortal

Now Download the uPortal tzr.gz source file from http://www.jasig.org/uportal/download . ( In my case http://downloads.jasig.org/uportal/uPortal-3.2.2/uPortal-3.2.2.tar.gz )
unzip it in the directory

/var/lib/tomcat6/webapps

with the command

tar xzvf uPortal-3.2.2.tar.gz

as you can see in the manual ( https://wiki.jasig.org/pages/viewpage.action?pageId=29133275 ) , you have to build uPortal Manually. To do so, you have to edit some files:

1. build.properties
2. rdbm.properties
3. pom.xml
4. personDirectoryContext.xml

1. build.properties

cp build.properties.sample build.properties; vim build.properties

find the variable server.home and replace it with the correct path to tomcat binaries

server.home=/var/lib/tomcat6

2. rdbm.properties

In my case, I use mySQL database in a different host, so I commented out the default enabled db connection settings (Hypersonic SQL – Server mode) and uncommented the section for mySQL db settings. So edit the file
vim ./uportal-impl/src/main/resources/properties/rdbm.properties matching your configuration.

hibernate.connection.driver_class=com.mysql.jdbc.Driver
hibernate.connection.url=jdbc:mysql://database.host/uportal_dbname
hibernate.connection.username=uportal_db_username
hibernate.connection.password=uportal_db_pass
hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect

3. pom.xml

In the other Manual here ( https://wiki.jasig.org/display/UPM32/MySQL ) it states that you have to change the /uPortal/pom.xml file to reflect the choice to use mysql. So added the following lines:
mysql
mysql-connector-java
5.1.10

and


mysql
mysql-connector-java
5.1.10

three more files need to be altered to change SQL grammar! Otherwise build WILL FAIL! (been there too).

uportal-impl/src/main/resources/properties/contexts/personDirectoryContext.xml
uportal-impl/target/classes/properties/contexts/personDirectoryContext.xml
uportal-war/target/uPortal/WEB-INF/classes/properties/contexts/personDirectoryContext.xml

change all syntax from
SELECT FIRST_NAME||’ ‘||LAST_NAME AS FIRST_LAST, FIRST_NAME, LAST_NAME, EMAIL, USER_NAME
FROM UP_PERSON_DIR
WHERE USER_NAME=?

to
SELECT CONCAT(FIRST_NAME,’ ‘,LAST_NAME) AS FIRST_LAST, FIRST_NAME, LAST_NAME, EMAIL, USER_NAME
FROM UP_PERSON_DIR
WHERE USER_NAME=?

let’s check that db connection is ok!

ant dbtest

If it fails with the error message:
[java] WARN Could not obtain connection metadata
[java] org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class ‘com.mysql.jdbc.Driver’

You have to install the mysql Connector for Java, or you forgot to change the pom.xml file! (did that once). The best method to add the mySQL database connector on ubuntu is:

apt-get install libmysql-java

Installing uPortal

Ok, if your database connection was successful go ahead and build the whole app.

ant initportal

Warning:
If you have a database that contains any useful data, beware!
All Tables will be deleted!

credit to

Blog Widget by LinkWithin