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.
lighttpd web server
The
configuration step created a
custom.d/lighttpd-lxrserver.conf.
- 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.
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.