This section guides you through the necessary steps to run refdbc, bib2ris, and nmed2ris as CGI applications. This will allow the users to enjoy a part of the functionality of refdb through a web interface.
If you want to work through this section you'll need some basic knowledge about the administration of your web server. Needless to say that you also need the proper privileges to fiddle with your web server settings. The procedure below was written with Apache 1.3 on Debian GNU/Linux in mind. Apache is by far the most popular web server and available on various platforms, including all platforms that refdb currently supports. If you use a different Linux distribution or a different operating system, the location and name of the files may slightly differ. If you use a different web server, the configuration process may be entirely different, but with the user manual at your hands you may be able to adapt the following instructions to your needs.
Note: If your web server and the refdbd application server run on different machines, please notice that all but one steps below talk about the computer running the web server. One step talks about the computer running refdbd.
Most web servers expect CGI applications in one specific, configurable directory. If your web server is not already set up for CGI applications, you`ll have to register a cgi-bin directory. To do this in the case of Apache, add the following line to /etc/apache/httpd.conf:
ScriptAlias /cgi-bin/ /usr/local/bin/apache/cgi-bin/ |
You can of course choose a different directory if you wish.
The directory must be readable and accessible for the account that the web server daemon runs in (this is often user "www" and group "www", which I will use in the example below), so to make sure issue something like the following commands:
#~ chown www:www /usr/local/bin/apache/cgi-bin |
#~ chmod u+rx /usr/local/bin/apache/cgi-bin |
Now you have to tell Apache about the updated configuration. Apache writes the process ID of the parent process into a file which is selected by the PidFile variable in httpd.conf. On a Debian system this is /var/run/apache.pid. Send a hangup signal to this process ID (don't just use a random Apache PID in the ps listing as sending this signal to a child would be useless at best):
#~ kill -HUP PID |
Tip: If the script apachectl is installed on your system, you can as well run the command apachectl restart.
Place copies of refdbc, bib2ris, and nmed2ris in your /cgi-bin directory and make them read/executable for the web server daemon:
#~ cd /usr/local/bin/apache/cgi-bin/ |
#~ chown www:www refdbc bib2ris nmed2ris |
#~ chmod u+rx refdbc bib2ris nmed2ris |
Create the configuration files /usr/local/etc/refdbcgirc, /usr/local/etc/bib2riscgirc, and /usr/local/etc/nmed2riscgirc (unless you chose a different directory during configuration) and fill in appropriate values. Remember that bib2ris and nmed2ris need access to HTML templates. You should specify the proper value for refdblib in the configuration files.
You can of course modify the HTML files and the stylesheet according to your needs. These files are not automatically installed and can be found in the cgi subdirectory of the sources. Remember that the HTML templates are already installed in /usr/local/share/refdb/templates on the computer that runs refdbd and need similar modifications. Moreover, the computer that runs Apache and the CGI programs also needs a copy of /usr/local/share/refdb/templates.
Copy the HTML query files, the javascript file access.js, and the CSS stylesheet refdbq.css into your publicly accessible web server directory. On Debian, this is /var/www by default, so you might put the files into /var/www/refdb/. These are the static HTML files that comprise the search and logout forms.
The file refdbquery.html is the main entry point to the refdb web interface. Web visitors should be guided to this page as it allows username/password authentication. Provide links on your web pages accordingly.
It may be a good idea to check the access rights of all related files again to make sure the site visitors can access them from their browser. The static HTML pages, the templates, the javascript file, and the CSS style sheet must be readable for the account the web server is started under. The templates must be readable for the account refdbd is started under.