Managing Multiple Cooks
Now, onto the Perl side of things. In order to make programming database access easier with Perl, the DBI modules were developed. DBI stands for Database Interface and consists of a collection of routines that offer standard hooks into an SQL database. DBD is an application program interface (API) for Perl 5 to interface with database systems. The idea is to provide a consistent set of modules and calls so that database access code is portable without too much fuss.
Now, since there are a number of database formats out there (PostgreSQL, MySQL, Sybase, Oracle, etc.), there will be some variance in accessing and talking to those various databases. This is where the DBD modules come into play. DBD are the Database Dependent modules. They are identified by the database they support by a simple suffix. For instance, DBD-Pg is the DBD module for PostgreSQL. Meanwhile, DBD-Informix is the DBD module for the Informix database.
Essentially, the DBI module is common to all the various databases, but the DBD module must be (and is) database-specific.
Both the DBD and DBI module can be found at the CPAN FTP site, a huge Perl resource on the Web. Because the two modules are in slightly different directories, I will give you both starting with the DBI module. See ftp://ftp.cpan.org/CPAN/modules/by-module/DBI/.
The DBD module can be found at the CPAN site at ftp://ftp.cpan.org/CPAN/modules/by-module/DBD/. At the time of this writing, the latest and greatest DBI version was DBI-1.14, whereas the DBD release number was DBD-Pg-0.95. It probably makes sense to get the latest and greatest when it comes to these modules, particularly if you are using the latest PostgreSQL. The reason for this is that the modules grow and develop with the databases they reference. The most recent PostgreSQL database is best served by the most recent DBD-Pg.
Install the DBI module first by unpacking the distributions into some temporary directory and following these steps:
cd /usr/local/temp_dir tar -xzvf DBI-1.14.tar.gz cd DBI-1.14 perl Makefile.PL make make test make install
To install the DBD module, the process is similar. Please note that more recent versions of the DBD module now require you to set a couple of environment variables before the install can occur. These are POSTGRES_LIB and POSTGRES_INCLUDE:
export POSTGRES_LIB=/usr/local/pgsql/lib export POSTGRES_INCLUDE=/usr/local/pgsql/includeNow, you can run the install:
cd /usr/local/temp_dir tar -xzvf DBD-Pg-0.95.tar.gz cd DBD-Pg-0.95 perl Makefile.PL make make test make install
Ah, la pièce de résistance. Start by downloading the latest release from the Salmar web site at http://www.salmar.com/gss/. Then, extract it into a temporary directory. Once again, it comes with a lovely little README file that you may want to indulge in. For the impatient, this is all you do:
tar -xzvf sciintra.tar.gz cd installintra
Before we begin the actual install, we must pause and modify one little configuration script. This is a small text file called sciintra_conf.pl, and you can edit it with your favorite text editor. Here is what you will find in the file.
The first thing to do is make sure that the path to your Perl executable is correct. It will either be /usr/bin/perl or /usr/local/bin/perl. Now, go down to the last three lines and fill in the path to your Apache server's document root and cgi-bin directory. What you see above is the file's default configuration. If this fits your own system configuration, then you don't have to change anything.
Now, it is time to finish our install:
Right away, the script does a couple of sanity checks, specifically to make sure that you have PostgreSQL running and Perl installed. Once satisfied, it will ask you an interesting little question:
Do you also wish to install the phonebook (Y/N) ?A call for you, perhaps? Can you hear the music, mes amis? Ah, memories. Think back to the June 2000 issue of Linux Journal. Chez Marcel's little kitchen turned up an intranet telephone book for the “Who's Who in Linux?” issue. Well, if you have our little phonebook installed, then you can reply with an “N” for no, otherwise, why not install this wonderful little phonebook? It will then be available from the Grand Salmar Station Intranet menu, and it will be wonderful, like this lovely little Syrah. Pardonner moi while I have a little sip. Ah, wonderful.
Next, you will be asked whether you wish to install the intranet. Well, mes amis. That is why we are here, non? Just respond with a “Y”. The install then calls a Perl script to do the rest of the installation. You are almost done, mes amis. One more thing.
As I mentioned in the introduction, Grand Salmar Station can automatically clean up after itself. If you decide to post a date-sensitive item, the software can automatically remove this item from the intranet after a specific date. To activate this feature, add the following command to run with cron:
You may, if you wish, copy it to some other location. We will discuss the security aspects of the administrator shortly.
Fast/Flexible Linux OS Recovery
On Demand Now
In this live one-hour webinar, learn how to enhance your existing backup strategies for complete disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible full-system recovery solution for UNIX and Linux systems.
Join Linux Journal's Shawn Powers and David Huffman, President/CEO, Storix, Inc.
Free to Linux Journal readers.Register Now!
- Ubuntu Online Summit
- Devuan Beta Release
- The Qt Company's Qt Start-Up
- Download "Linux Management with Red Hat Satellite: Measuring Business Impact and ROI"
- May 2016 Issue of Linux Journal
- The US Government and Open-Source Software
- Open-Source Project Secretly Funded by CIA
- The Death of RoboVM
- New Container Image Standard Promises More Portable Apps
- BitTorrent Inc.'s Sync
In modern computer systems, privacy and security are mandatory. However, connections from the outside over public networks automatically imply risks. One easily available solution to avoid eavesdroppers’ attempts is SSH. But, its wide adoption during the past 21 years has made it a target for attackers, so hardening your system properly is a must.
Additionally, in highly regulated markets, you must comply with specific operational requirements, proving that you conform to standards and even that you have included new mandatory authentication methods, such as two-factor authentication. In this ebook, I discuss SSH and how to configure and manage it to guarantee that your network is safe, your data is secure and that you comply with relevant regulations.Get the Guide