ï
 
in file raddb/radiusd.conf:
 
$INCLUDE  ${confdir}/postgresql.conf
 

authorize {

      preprocess

#     auth_log

#     chap

#     attr_filter

#     eap

#     suffix

      sql

      files

      noresetcounter

}

session {

        radutmp

        sql

}

accounting {

      acct_unique

      detail

      sql

#     main_pool

}

 
 

in file Postgresql.conf:

 

      sql{

driver = "rlm_sql_postgresql"

 

      # Connect info

      server = "localhost" # hoác khai bÃo Äáa chá IP

      # The following credentials will most likely work on a default install of Postgresql

      # If they do work however, it means that you have a HUGE GAPING SECURITY RISK on your

      # server! Please change the "postgres" users password and setup a separate radius user.

      login = "postgres"

      password = "postgres"

     

      # Database table configuration

      radius_db = "radiusdb"

Create the Postgres user

Still as root, create a user and group (if you haven't done so before) for PostgreSQL. This is the account that PostgreSQL will run as since it will not run as root. Also give the postgres user a password:

root:~# groupadd web
root:~# useradd -g web -d /usr/local/pgsql postgres 
root:~# passwd postgres

root:~# mkdir -p /usr/local/pgsql
root:~# chown -R postgres.web /usr/local/pgsql /usr/local/src/postgresql-7.4.1
root:~# chmod 750 /usr/local/pgsql
root:~# exit
logout
joeuser:~$ su - postgres
Password: ***********

Set up postgres's environment variables

Edit /usr/local/pgsql/.bash_profile so it looks like this:

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/pgsql/lib
PATH=$PATH:/usr/local/pgsql/bin

export PATH LD_LIBRARY_PATH

Logout and login again as postgres. Use the echo command to make sure that /usr/local/pgsql/bin is now in your PATH

postgres:~$ exit
logout
joeuser:~$ su - postgres
Password: ************
postgres:~$ echo $PATH
/usr/local/bin:/usr/bin:/bin: ... :/usr/local/pgsql/bin

Compile and install PostgreSQL

First, we run ./configure to set the compilation options automatically. This is the point at which you can configure PostgreSQL in various ways. For example, if you want to enable Unicode support, add the flags --enable-locale and --enable-multibyte. If you want to see what the other possibilities are, run ./configure --help.

postgres:~$ cd /usr/local/src/postgresql-7.4.1
postgres:/usr/local/src/postgresql-7.4.1$ ./configure
postgres:/usr/local/src/postgresql-7.4.1$ make all

to init/create database location, use initdb command:

postgres:~$ /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data

 

in order to enable TCP/IP with postgreSQL, in file /etc/init.d/postgresql, you have to add "-i" at the start session, or "-i" in start command line

su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl -o '-i' -D $PGDATA -p /usr/bin/postmaster start > /dev/null 2>&1" < /dev/null
or start in command line:

postgres:~$ /usr/local/pgsql/bin/pg_ctl -o '-i' -D /usr/local/pgsql/data -l /usr/local/pgsql/data/server.log start

or  start postgresql script:

/etc/init.d/postgresql start

 

postgres:~$ /usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l /usr/local/pgsql/data/server.log start

to insert radius database into postgres database :

su postgres

createdb radiusdb

psql radiusdb

\i radius.sql

 

\i là lánh insert data tá mát file sql bÃn ngÃai.

 

if you want to use PL/SQL language in postgresql, you can add pgplsql language into database:
CREATE FUNCTION plpgsql_call_handler ()
                RETURNS OPAQUE
                AS '/usr/local/pgsql/lib/plpgsql.so'
                LANGUAGE 'C';

(Sau ÄÃ cán cÃi Äát hÃm handle cho pl/pgsql:) and then create a handler for this language

CREATE LANGUAGE 'plpgsql' HANDLER plpgsql_call_handler
                           LANCOMPILER 'PL/pgSQL';

 

Vá chi tiát sá dáng postgreSQL cà thá tham kháo trang web:

http://www.commandprompt.com/ppbook/

 
 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
Sent: Monday, March 15, 2004 5:57 PM
To: [EMAIL PROTECTED]
Subject: How to configure Postgress if freeRADIUS


Hi ALl,
              I am are tring to configure Postgress with freeRADIUS , can any body tell me where to start with, as i am new to the same. Any link/document for the same will be highly appretiated.

Thanks in Advance.

Regards,
-Asif

Reply via email to