1.4. Installation from source tarballs

This section will guide you through the compilation of the FRED and the follow-up installation. This procedure is meant for Ubuntu.

See also source code architecture.

1.4.1. Add the CZ.NIC repositories and signing key

add-apt-repository "deb http://archive.nic.cz/ubuntu $(lsb_release -sc) main"
add-apt-repository "deb http://archive.nic.cz/private $(lsb_release -sc) main"

apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1C0200016A9AC5C6

apt-get update

1.4.2. Satisfy dependecies

We prepared lists of all particular packages on which FRED’s compilation, installation or operation depends (package names may slightly differ across OS versions):

Install all the packages from the appropriate list.

1.4.3. Download and unpack

We publish a list of GitHub-generated tarballs on the website.

You may use the latest version list or an archived version list (see the website for archived versions).

mkdir fred && cd fred
curl https://fred.nic.cz/files/fred/fred-sources-list-latest.txt | while read LN; do
   curl -JLO $LN # these options are necessary to have nice filenames
done
for F in *.tar.gz; do tar -zxvf $F; done

1.4.4. Install “A” packages

These packages are configured, compiled and installed using Autotools [1] (autoconf, automake and libtool).

IDL definitions are required during compilation, therefore the IDL package must be installed before other “A” packages and before the fred-pyfred “D” package.

Package list:

  • fred-idl # install first
  • fred-mod-corba
  • fred-mod-eppd
  • fred-mod-whoisd
  • fred-server
  • fred-db
  • fred-akm
  • cdnskey-scanner

For each package in the list, run this command sequence from its directory:

autoreconf -vfi # generates the configure script
./configure
make
sudo make install

The configure script prepares package files for compilation and installation by adapting them to a specific environment and checks that the required tools are available.

The make command performs the actual compilation. (Some packages have nothing to compile. In that case, the make reports “Nothing to be done…”.)

The last command just copies files required for operation to the target directories. (You usually need administrator permissions if you install somewhere else than to your home directory.)

The target directory (installation prefix), as well as other parameters (e.g. compilation params), can be passed as arguments directly to the configure script or as environment variables. (See ./configure --help for options.)

Note

Note that the default prefix is used in examples throughout this manual.

[1]For more information about Autotools see the GNU Automake Manual.

1.4.4.1. Finish mod-corba installation

Run the libtool script (after make install) to finish the mod-corba installation:

sudo ./libtool --finish /usr/lib/apache2/modules

1.4.5. Install “D” packages

These packages use Distutils for installation which is a collection of Python scripts based on Setuptools, therefore the Distutils package must be installed before other “D” packages. Naturally, Setuptools must be installed (python-setuptools or pip install setuptools) before all other Python packages.

Package list:

  • fred-utils-distutils # install first (in the Python path)
  • fred-utils-pyfco [2]
  • fred-utils-pylogger [2]
  • fred-client
  • fred-doc2pdf
  • fred-pyfred
  • fred-rdap [2]
  • fred-transproc
  • fred-webadmin
  • fred-webwhois [2]

For each package in the list, run this command from its directory:

sudo python ./setup.py install

The install command calls compilation (build) first if needed and then just copies files required for operation to the target directories. (You usually need administrator permissions if you install elsewhere than your home directory.)

The target directory (installation prefix) or other parameters can be passed as arguments. Refer to python ./setup.py --help install for installation parameters.

The installer writes a list of installed files (with their full path) to the install.log file when it finishes.

[2](1, 2, 3, 4) These packages have been ported from Distutils to Setuptools but they have the same installation command, except it does not install a configuration file and the package must be configured as described in a README file included in the package.

1.4.6. Finalization

You need to finish the setup of the following parts to make the system operational:

  • enable Apache modules,
  • setup the database schema,
  • launch servers.

Important

Remember to set the timezone in PostgreSQL to UTC.

Then test the installation and initialize the system.

1.4.6.1. Enable Apache modules

Enable mod_ssl (not enabled by default):

sudo a2enmod ssl

Configure Apache to load mod_eppd and mod_whoisd, create virtual hosts to provide EPP server and Web Whois server and configure directories to provide Unix Whois and RDAP server:

  • Correct RDAP Apache module configuration (comment or delete the WSGISocketPrefix directive):

    sudo sed -i~ -e "s/^WSGISocketPrefix/#WSGISocketPrefix/" \
       /usr/local/share/fred-rdap/apache.conf
    
  • Link configuration snippets (provided with the FRED) to Apache’s virtual host directory:

    cd /etc/apache2/sites-available/
    sudo ln -s /usr/local/share/fred-mod-corba/01-fred-mod-corba-apache.conf .
    sudo ln -s /usr/local/share/fred-mod-whoisd/02-fred-mod-whoisd-apache.conf .
    sudo ln -s /usr/local/share/fred-mod-eppd/02-fred-mod-eppd-apache.conf .
    sudo ln -s /usr/local/share/doc/fred-whois/apache.conf 03-fred-whois.conf
    sudo ln -s /usr/local/share/fred-rdap/apache.conf 04-fred-rdap.conf
    
  • Enable FRED sites:

    sudo a2ensite 01-fred-mod-corba-apache.conf
    sudo a2ensite 02-fred-mod-whoisd-apache.conf
    sudo a2ensite 02-fred-mod-eppd-apache.conf
    sudo a2ensite 03-fred-whois.conf
    sudo a2ensite 04-fred-rdap.conf
    
  • Set the Apache user (www-data) as the owner of the log directory to make logging possible:

    sudo chown www-data:www-data /usr/local/var/log/
    
  • Finally, restart the Apache to load the new settings:

    sudo service apache2 restart
    

1.4.6.2. Setup the database schema

The FRED database schema is installed automatically with the default settings
(user name and database name) on the first run of the CORBA servers.

However, if you want to setup the database manually, you need to:

  • disable the auto-install by setting the flag DB_INIT=0 in /usr/local/etc/init.d/fred-server

  • setup the database settings (as the postgres user):

    su - postgres
    
    • create a user and set his privileges:

      createuser -SDR -l {dbusername}
      
    • create a database, set the owner and encoding:

      createdb {dbname} -O {dbusername} -E UTF8
      
    • install ‘plpgsql’ language for the database:

      createlang plpgsql {dbname}
      
    • set a password for the user (from the psql console):

      psql
      postgres=# alter user {dbusername} password 'passwd';
      
  • adapt the PostgreSQL client authentication configuration in /etc/postgresql/9.1/main/pg_hba.conf to use the plain-password authentication method [3]

    • for all databases and users:

      #TYPE   DATABASE    USER        ADDRESS      *METHOD*
      local   all         all                      password
      host    all         all         127.0.0.1/32 password
      host    all         all         ::1/128      password
      
    • for your user and your database specifically:

      # Unix-socket connections
      local  {dbname}    {dbusername}              password
      # localhost TCP/IP-socket connections, IPv4
      host   {dbname}    {dbusername} 127.0.0.1/32 password
      # localhost TCP/IP-socket connections, IPv6
      host   {dbname}    {dbusername} ::1/128      password
      
    • and restart the PostgreSQL server:

      sudo service postgresql restart
      
[3]We use the plain-password method only as an illustration of simple settings, however we do not suggest that this method is secure. We recommend you to consult the PostgreSQL documentation and your local security policy.
  • run the provided SQL script to create the FRED database structure:

    psql {dbname} -U {dbusername} -f /usr/local/share/fred-db/structure.sql
    
  • adapt the FRED configuration files accordingly (set the correct database name, user and password)

    • /usr/local/etc/fred/server.conf:

      [database]
      host = localhost    # hostname of the database server (default)
      port = 5432         # port of the db service (default)
      name = {dbname}     # database name
      user = {dbusername} # database user name
      password = passwd   # user password
      ...
      
    • /usr/etc/fred/pyfred.conf:

      [General]
      ...
      dbuser={dbusername}
      dbname={dbname}
      dbhost=localhost
      dbport=5432
      dbpassword=passwd
      ...
      

1.4.6.3. Launch servers

To start the FRED CORBA servers, you can use the service script or run this command:

sudo /usr/local/etc/init.d/fred-server start

To start the FRED webadmin server (Daphne), you can use the service script or run this command:

sudo /usr/etc/init.d/fred-webadmin-server start

Now, you can perform the smoke test to make sure that all interfaces are available and working together.