This section guides you through the necessary steps to run refdbc, bib2ris, and med2ris.pl 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.
To tell Apache about the refdb web pages, add the following line to /etc/apache/httpd.conf:
Alias /refdb/ /usr/local/share/refdb/www/ |
This entry will let you access the refdb web interface through the address [hostname]/refdb. While you're at modifying httpd.conf, the next step may require another change to this file.
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). If this is not already the case, 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:
#~ apachectl restart |
Place copies of refdbc, bib2ris, and med2ris.pl in your /cgi-bin directory. Unless they are readable and executable for everyone you'll have to make them read/executable for the web server daemon:
#~ cd /usr/local/bin/apache/cgi-bin/ |
#~ chown www:www refdbc bib2ris med2ris.pl |
#~ chmod u+rx refdbc bib2ris med2ris.pl |
Create the configuration files /usr/local/etc/refdb/refdbcgirc, /usr/local/etc/refdb/bib2riscgirc, and /usr/local/etc/refdb/med2riscgirc (unless you chose a different directory during configuration) and fill in appropriate values. Remember that bib2ris and med2ris 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. The static HTML files, a CSS stylesheet file, and a JavaScript file are installed by default in /usr/local/share/refdb/www, whereas the HTML templates are installed in /usr/local/share/refdb/templates on the computer that runs refdbd. Both the computer that runs Apache and the CGI programs and the computer that runs refdbd need a copy of /usr/local/share/refdb/templates.
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. The refdb installation procedure creates a symlink with the name index.html pointing to refdbquery.html, so you'll be able to access the main query page by pointing your browser to "[hostname]/refdb/".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.