Selected release:

The last task is to configure your web server. Instructions below are given for Apache and lighttpd servers. Read the User's Manual for other servers.

CAVEAT!
Configuration file and directory names are given below for a Fedora distribution. Other distributions may have different defaults. In particular, see this tip for Debian and Ubuntu.

Under all circumstances, check carefully the generated configuration files for correctness. Additionally, in multiple-trees context, take care to remove port and virtual root duplicates. The latter arise frequently when the common virtual root is overridden for a few trees (the common virtual root is duplicated for the non-overridden occurrences).

Apache web server

The configuration step created a custom.d/apache-lxrserver.conf to be copied into /etc/httpd/conf.d/. It is automatically read at server initialisation and merged with httpd.conf. Whenever the server software is updated, all you have to do is store again this file in the /etc/httpd/conf.d/ directory.

Access to the /etc/httpd/conf.d/ directory requires root privileges.

Copy the file to the Apache configuration directory:

$ cp custom.d/apache-lxrserver.conf /etc/httpd/conf.d This file is valid both for Apache version 1.x and version 2.x.

The "per-directory" configuration file .htaccess has been created by the configuration step and is already stored in the LXR root directory. Edit it to enable directory listing or apply other personal preferences.

  • Apache version 1.x

    mod_perl for Apache 1.x accesses only the system Perl library. Consequently, you must copy LXR private library there:

    $ cp -r lib/LXR/* /usr/lib/perl5/site_perl/ $ cp lib/Local.pm /usr/lib/perl5/site_perl/

lighttpd web server

The configuration step created a custom.d/lighttpd-lxrserver.conf.
Releases 2.1 and higher: Release 2.0: Releases 1.1 and lower:
  • LXR release 2.1 and higher

    Check the master file /etc/lighttpd/lighttpd.conf allows virtual host operation. The last directive in the file must not be commented out:

    include_shell "cat /etc/lighttpd/vhosts.d/*.conf"

    Check also "plain old CGI" module is enabled in file /etc/lighttpd/modules.conf, i.e. the following line in CGI modules section is not commented out:

    include "conf.d/cgi.conf"

    Configuration file custom.d/lighttpd-lxrserver.conf should not need manual editing, apart from duplicate removal. Copy it to its final destination:

    $ cp custom.d/lighttpd-lxrserver.conf /etc/lighttpd/vhosts.d/ It is automatically read at server initialisation and merged with lighttpd.conf. Whenever the server software is updated, all you have to do is store again this file in the /etc/lighttpd/vhosts.d/ directory.

    Access to the /etc/lighttpd/vhosts.d/ directory requires root privileges.

    If you need to (re)start lighttpd, type the following command as root:

    $ systemctl restart lighttpd.service

Check the configuration file:

$ lighttpd -t -f custom.d/lighttpd-lxrserver.conf

Launch lighttpd web server.

  • for single user service $ lighttpd -D -f custom.d/lighttpd-lxrserver.conf

    Type ctl-C to stop lighttpd.

  • for system-wide service
    • systemd service enabled

      First, copy the configuration file to its expected location:

      $ cp custom.d/lighttpd-lxrserver.conf /etc/lighttpd/conf.d

      Start the server:

      $ systemctl start lighttpd.service

      To stop lighttpd, type:

      $ systemctl stop lighttpd.service
    • without systemd (on a single line or with continuation indicators) $ LIGHTTPD_CONF_PATH=\ "/path/to/lxr/custom.d/lighttpd-lxrserver.conf" \ ./scripts/lighttpd-init start

      To stop lighttpd, type:

      $ ./scripts/lighttpd-init stop
If you already operate a lighttpd server, merging LXR with global configuration is left to you as an exercice.

Issues with SELinux

In case you later encounter difficulties with SELinux (security alerts related to the LXR root directory):

Scripts and their directories must be specifically labeled to identify them as executing code as a "normal" context. This is routinely done when they are located in /var/www/cgi-bin/. To eliminate alerts, the most reliable method is to clone /var/www/cgi-bin/ context with the following command:

$ chcon --reference /var/www/cgi-bin -R LXR_root_directory/

Final check

Fire up your webbrowser and go to http://localhost/lxr/source. You should see the directory content of the default version for your tree.