Subject | Install multiple firebird servers on ubuntu HOW TO |
---|---|
Author | frank.kronbalt |
Post date | 2010-05-07T13:51:25Z |
Using this method, you are free to install multiple servers of whatever version of Firebird Server you want. We will not use any repositories where we would be bound to use a specified version, or we wouldn't be able to use Firebird 1.5, but we will be downloading the standard package from the official Firebird website.
Install
The packages you will find here. Download the version you want, and we go ahead installing it manually. In this example I will use FirebirdCS-2.1.3.18185-0.amd64.tar.gz. Mostly you will need to install libstdc++5 aswell.
* http://packages.ubuntu.com/jaunty/i386/libstdc++5/download (x86)
* http://packages.ubuntu.com/jaunty/amd64/libstdc++5/download (amd64)
#
# tar xzvf FirebirdCS-2.1.3.18185-0.amd64.tar.gz
FirebirdCS-2.1.3.18185-0.amd64/
FirebirdCS-2.1.3.18185-0.amd64/scripts/
FirebirdCS-2.1.3.18185-0.amd64/scripts/tarMainInstall.sh
FirebirdCS-2.1.3.18185-0.amd64/scripts/postuninstall.sh
FirebirdCS-2.1.3.18185-0.amd64/scripts/preinstall.sh
FirebirdCS-2.1.3.18185-0.amd64/scripts/preuninstall.sh
FirebirdCS-2.1.3.18185-0.amd64/scripts/taruninstall.sh
FirebirdCS-2.1.3.18185-0.amd64/scripts/postinstall.sh
FirebirdCS-2.1.3.18185-0.amd64/scripts/tarinstall.sh
FirebirdCS-2.1.3.18185-0.amd64/scripts/rpmfiles.txt
FirebirdCS-2.1.3.18185-0.amd64/scripts/tarMainUninstall.sh
FirebirdCS-2.1.3.18185-0.amd64/scripts/rpmheader.txt
FirebirdCS-2.1.3.18185-0.amd64/install.sh
FirebirdCS-2.1.3.18185-0.amd64/buildroot.tar.gz
FirebirdCS-2.1.3.18185-0.amd64/manifest.txt
# cd FirebirdCS-2.1.3.18185-0.amd64/
# ./install.sh
Firebird classic 2.1.3.18185-0.amd64 Installation
Press Enter to start installation or ^C to abort
Extracting install data
Done.
Please enter new password for SYSDBA user: ''masterkey''
Install completed
Now you have your first Firebird server set up. Now let's install the second.
# cd FirebirdCS-2.1.3.18185-0.amd64/
# tar xzvf buildroot.tar.gz
./
./opt/
./opt/firebird/
./opt/firebird/misc/
./opt/firebird/misc/upgrade/
./opt/firebird/misc/upgrade/ib_udf/
./opt/firebird/misc/upgrade/ib_udf/ib_udf_upgrade.sql
./opt/firebird/misc/upgrade/ib_udf/ib_udf2_params.txt
./opt/firebird/misc/upgrade/ib_udf/ib_udf_params.txt
./opt/firebird/misc/upgrade/metadata/
./opt/firebird/misc/upgrade/metadata/metadata_charset.txt
./opt/firebird/misc/upgrade/metadata/metadata_charset_drop.sql
./opt/firebird/misc/upgrade/metadata/metadata_charset_create.sql
./opt/firebird/misc/upgrade/security/
./opt/firebird/misc/upgrade/security/security_database.sql
./opt/firebird/misc/upgrade/security/security_database.txt
./opt/firebird/misc/intl.sql
./opt/firebird/misc/firebird.xinetd
./opt/firebird/UDF/
./opt/firebird/UDF/ib_udf.sql
./opt/firebird/UDF/ib_udf.so
./opt/firebird/UDF/fbudf.sql
./opt/firebird/UDF/ib_udf2.sql
./opt/firebird/UDF/fbudf.so
./opt/firebird/WhatsNew
./opt/firebird/aliases.conf
.......
.......
# cd opt/
# mv firebird/ firebird2/
# mv firebird2/ /opt/
# cd /opt/firebird2/bin/
# mv fb_inet_server fb_inet_server2
Now we have two seperate intallation of Firebird 2.1.3 Classic Server. The next step will be to setup xinetd to associate different ports to the different Firebird Servers.
Install/Configure xinetd
Xinetd is a connection manager a so called super internet server which will launch a specified server only when a user is trying to connect to a specified port. So let's say you have an ftp server set up which should be listening on port 21. When a connection is beeing made to the port 21, xinetd will be launching the service associated with the port 21. In the following example it will be clear to you what will happen.
Let's create the first firebird service entry. Therefore open up /etc/services. Remove the following two lines
gds_db 3050/tcp # InterBase server
gds_db 3050/udp
Add these two lines to the end of the file.
# Local services
firebird 3050/tcp # InterBase server
firebird 3050/udp
firebird2 3060/tcp # InterBase server
firebird2 3060/udp
Now we'll have to specify what xinetd should start when a connection attempt is beeing made to port 3050 or 3060. Therefore we'll have to create /etc/xinet.d/firebird and /etc/xinet.d/firebird2.
service firebird
{
flags = REUSE
socket_type = stream
wait = no
user = firebird
server = /opt/firebird/bin/fb_inet_server
env =FIREBIRD=/opt/firebird
env +=LD_LIBRARY_PATH=/opt/firebird/lib:LD_LIBRARY_PATH
disable = no
}
service firebird2
{
flags = REUSE
socket_type = stream
wait = no
user = firebird
server = /opt/firebird2/bin/fb_inet_server2
instances = UNLIMITED
env =FIREBIRD=/opt/firebird2
env +=LD_LIBRARY_PATH=/opt/firebird2/lib:LD_LIBRARY_PATH
disable = no
}
Now we'll have to change the Firebirds config files, these files can be found in either /opt/firebird/ or /opt/firebird2/. Change the following parameter.
RemoteServicePort = 3050
and
RemoteServicePort = 3060
Restart xinetd and try the connection with telnet.
# /etc/init.d/xinetd restart
# telnet localhost 3050
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Connection closed by foreign host
# telnet localhost 3060
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Connection closed by foreign host
All working fine. Next thing we'll have to adjust is the SYSDBA password for firebird2. When changing the password using gsec you will always have to pay attention on the environment variables. Set them to point to the correct firebird directory before changing the SYSDBA password using gsec. Here is how you do it.
# export FIREBIRD=/opt/firebird2/
# export LD_LIBRARY_PATH=/opt/firebird/lib
# /opt/firebird2/bin/gsec
GSEC> modify SYSDBA -pw masterkey
Warning - maximum 8 significant bytes of password used
GSEC> quit
#
Set up your aliases.conf in the different directories and you have your two different Firebird servers.
Install
The packages you will find here. Download the version you want, and we go ahead installing it manually. In this example I will use FirebirdCS-2.1.3.18185-0.amd64.tar.gz. Mostly you will need to install libstdc++5 aswell.
* http://packages.ubuntu.com/jaunty/i386/libstdc++5/download (x86)
* http://packages.ubuntu.com/jaunty/amd64/libstdc++5/download (amd64)
#
# tar xzvf FirebirdCS-2.1.3.18185-0.amd64.tar.gz
FirebirdCS-2.1.3.18185-0.amd64/
FirebirdCS-2.1.3.18185-0.amd64/scripts/
FirebirdCS-2.1.3.18185-0.amd64/scripts/tarMainInstall.sh
FirebirdCS-2.1.3.18185-0.amd64/scripts/postuninstall.sh
FirebirdCS-2.1.3.18185-0.amd64/scripts/preinstall.sh
FirebirdCS-2.1.3.18185-0.amd64/scripts/preuninstall.sh
FirebirdCS-2.1.3.18185-0.amd64/scripts/taruninstall.sh
FirebirdCS-2.1.3.18185-0.amd64/scripts/postinstall.sh
FirebirdCS-2.1.3.18185-0.amd64/scripts/tarinstall.sh
FirebirdCS-2.1.3.18185-0.amd64/scripts/rpmfiles.txt
FirebirdCS-2.1.3.18185-0.amd64/scripts/tarMainUninstall.sh
FirebirdCS-2.1.3.18185-0.amd64/scripts/rpmheader.txt
FirebirdCS-2.1.3.18185-0.amd64/install.sh
FirebirdCS-2.1.3.18185-0.amd64/buildroot.tar.gz
FirebirdCS-2.1.3.18185-0.amd64/manifest.txt
# cd FirebirdCS-2.1.3.18185-0.amd64/
# ./install.sh
Firebird classic 2.1.3.18185-0.amd64 Installation
Press Enter to start installation or ^C to abort
Extracting install data
Done.
Please enter new password for SYSDBA user: ''masterkey''
Install completed
Now you have your first Firebird server set up. Now let's install the second.
# cd FirebirdCS-2.1.3.18185-0.amd64/
# tar xzvf buildroot.tar.gz
./
./opt/
./opt/firebird/
./opt/firebird/misc/
./opt/firebird/misc/upgrade/
./opt/firebird/misc/upgrade/ib_udf/
./opt/firebird/misc/upgrade/ib_udf/ib_udf_upgrade.sql
./opt/firebird/misc/upgrade/ib_udf/ib_udf2_params.txt
./opt/firebird/misc/upgrade/ib_udf/ib_udf_params.txt
./opt/firebird/misc/upgrade/metadata/
./opt/firebird/misc/upgrade/metadata/metadata_charset.txt
./opt/firebird/misc/upgrade/metadata/metadata_charset_drop.sql
./opt/firebird/misc/upgrade/metadata/metadata_charset_create.sql
./opt/firebird/misc/upgrade/security/
./opt/firebird/misc/upgrade/security/security_database.sql
./opt/firebird/misc/upgrade/security/security_database.txt
./opt/firebird/misc/intl.sql
./opt/firebird/misc/firebird.xinetd
./opt/firebird/UDF/
./opt/firebird/UDF/ib_udf.sql
./opt/firebird/UDF/ib_udf.so
./opt/firebird/UDF/fbudf.sql
./opt/firebird/UDF/ib_udf2.sql
./opt/firebird/UDF/fbudf.so
./opt/firebird/WhatsNew
./opt/firebird/aliases.conf
.......
.......
# cd opt/
# mv firebird/ firebird2/
# mv firebird2/ /opt/
# cd /opt/firebird2/bin/
# mv fb_inet_server fb_inet_server2
Now we have two seperate intallation of Firebird 2.1.3 Classic Server. The next step will be to setup xinetd to associate different ports to the different Firebird Servers.
Install/Configure xinetd
Xinetd is a connection manager a so called super internet server which will launch a specified server only when a user is trying to connect to a specified port. So let's say you have an ftp server set up which should be listening on port 21. When a connection is beeing made to the port 21, xinetd will be launching the service associated with the port 21. In the following example it will be clear to you what will happen.
Let's create the first firebird service entry. Therefore open up /etc/services. Remove the following two lines
gds_db 3050/tcp # InterBase server
gds_db 3050/udp
Add these two lines to the end of the file.
# Local services
firebird 3050/tcp # InterBase server
firebird 3050/udp
firebird2 3060/tcp # InterBase server
firebird2 3060/udp
Now we'll have to specify what xinetd should start when a connection attempt is beeing made to port 3050 or 3060. Therefore we'll have to create /etc/xinet.d/firebird and /etc/xinet.d/firebird2.
service firebird
{
flags = REUSE
socket_type = stream
wait = no
user = firebird
server = /opt/firebird/bin/fb_inet_server
env =FIREBIRD=/opt/firebird
env +=LD_LIBRARY_PATH=/opt/firebird/lib:LD_LIBRARY_PATH
disable = no
}
service firebird2
{
flags = REUSE
socket_type = stream
wait = no
user = firebird
server = /opt/firebird2/bin/fb_inet_server2
instances = UNLIMITED
env =FIREBIRD=/opt/firebird2
env +=LD_LIBRARY_PATH=/opt/firebird2/lib:LD_LIBRARY_PATH
disable = no
}
Now we'll have to change the Firebirds config files, these files can be found in either /opt/firebird/ or /opt/firebird2/. Change the following parameter.
RemoteServicePort = 3050
and
RemoteServicePort = 3060
Restart xinetd and try the connection with telnet.
# /etc/init.d/xinetd restart
# telnet localhost 3050
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Connection closed by foreign host
# telnet localhost 3060
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Connection closed by foreign host
All working fine. Next thing we'll have to adjust is the SYSDBA password for firebird2. When changing the password using gsec you will always have to pay attention on the environment variables. Set them to point to the correct firebird directory before changing the SYSDBA password using gsec. Here is how you do it.
# export FIREBIRD=/opt/firebird2/
# export LD_LIBRARY_PATH=/opt/firebird/lib
# /opt/firebird2/bin/gsec
GSEC> modify SYSDBA -pw masterkey
Warning - maximum 8 significant bytes of password used
GSEC> quit
#
Set up your aliases.conf in the different directories and you have your two different Firebird servers.