Releases LXR 0.9 and 0.10 are deprecated, information is kept here only for historical record.

These releases contain numerous bugs, some of which can be qualified "blocking". If you are considering installing a fresh LXR service, always prefer the latest release. You will experience a dramatic performance boost and installation is a lot easier.

Bug reports will not be accepted.

The heart of LXR configuration is a file named lxr.conf which MUST be located in the LXR root directory. A template configuration file ships in the templates/ subdirectory.
  1. Copy the template lxr.conf to the LXR source directory: $ cp templates/lxr.conf .
  2. Now, edit this file with your favorite editor (vi, emacs, KWrite, gedit, …). The file is subdivided into sections to facilitate configuration.
    • Go to the Global configuration section, Auxiliary tools subsection.

      You must tell LXR which search engine you installed and where, if the default paths are incorrect:

      , 'glimpsebin' => '/usr/local/bin/glimpse' , 'glimpseindex' => '/usr/local/bin/glimpseindex'

      or: , 'swishbin' => '/path/to/your/swishe-e/executable' Important!
      Since only one search engine can be used, comment out either 'glimpsebin' or 'swishbin' by prefixing the line with a pound sign (#).
      You can tell where the executables are located with the command $ which glimpse glimpseindex $ which swish-e

      Next, adjust the location of the ectags configuration file for proper operation:

      , 'ectagsconf' => '/usr/local/share/lxr/lib/LXR/Lang/ectags.conf'

      or:

      , 'ectagsconf' => '/home/your_userid/lxr/lib/LXR/Lang/ectags.conf' Important!
      All paths in this subsection must be OS-absolute paths.
    • Go now to the HTML subsection.

      According to your choice of a search engine, have the 'htmlsearch' point to the right template; choose one of the following:

      , 'htmlsearch' => 'templates/html-search-swish.html' , 'htmlsearch' => 'templates/html-search-glimpse.html' Important!
      The "relative" form is anchored at the LXR root directory. You may also use an OS-absolute path.

      Make 'stylesheet' point to lxr.css in the templates directory or, better, copy this file to the LXR root directory (in case you want to change the styles).

      , 'stylesheet' => 'lxr.css' Important!
      This path is relative to your DocumentRoot. You cannot use an OS-absolute path.
    • In the File content subsection, set 'genericconf' to the location of the parser configuration file: , 'genericconf' => '/usr/local/share/lxr/lib/LXR/Lang/generic.conf'

      or:

      , 'genericconf' => '/home/your_userid/lxr/lib/LXR/Lang/generic.conf' Important!
      It must be an OS-absolute path.
    • Proceed to the Tree configuration section and edit the Server configuration subsection to inform LXR how it will be known from the web server.
      • Version 0.10 or higher

        The access URL is the concatenation of the host name and the virtual root to the script.

        The host name (complete with protocol and port) comes from parameter 'host_names', a list of the different names under which your host is known to your web server and the DNS servers.

        The value of this parameter must be consistent with the web server configuration. , 'host_names' => [ 'http://localhost' , 'http://localhost.localdomain' , 'http://127.0.0.1' ] As a convenience, you can omit the protocol if it is http:.

        If LXR finds no 'host_names', it reverts to compatibility mode using 'baseurl' (see next subsection).

      • Up to version 0.9.10

        The full access URL is given by parameter 'baseurl' with aliases in 'baseurl_aliases'.

        The value of these parameters must be consistent with the web server configuration. , 'baseurl' => 'http://localhost/lxr' , 'baseurl_aliases' => [ 'http://localhost.localdomain/lxr' , 'http://127.0.0.1/lxr' ] Important!
        Take care that what comes after the hostname is the same in all the above lines.

        You cannot omit the protocol (the convenience has not been backported).

      Parameter 'virtroot' is equal to what comes after the hostname to complete the access URL.

      , 'virtroot' => '/lxr'
    • Go next to the Tree location subsection to describe your tree. For this first trial, we shall consider only a tree residing in real directories.

      Set parameter 'sourceroot' to the absolute path of the directory containing the different versions (as subdirectories):

      , 'sourceroot' => '/home/malcolm/indexed-src'

      Give a name for the root of relative paths in your tree:

      , 'sourcerootname' => 'myProject'
    • Go now to the Version selection subsection.

      Insert into parameter 'range' the names of the subdirectories containing the versions:

      , 'range' => [qw(v1 v2 v3.1 v4 experimental)]

      And modify 'default' to preselect which version LXR will display at start-time.

      , 'default' => 'v4'

      If your source files use include directives, set 'incprefix' to the list of include directories.

      All paths are relative to the source-tree base directory, but do not forget to write them with an initial separator. , 'incprefix' => [ '/include', '/include/linux' ]
    • Finally, go to the Data storage subsection to fix the locations of the auxiliary data storage.

      Tell which data base to use in 'dbname' among the following three:

      # ----- MySql ----- , 'dbname' => 'dbi:mysql:dbname=lxr' # ----- Postgresql ----- , 'dbname' => 'dbi:Pg:dbname=lxr' # ----- Oracle ----- , 'dbname' => 'dbi:Oracle:host=localhost;sid=DEVMMS;port=1521' For MySQL and Postgresql, lxr is the name given when creating the database (see the previous step).

      Do not forget to set the access parameters to the values you defined in the previous step:

      , 'dbuser' => 'lxr' , 'dbpass' => 'foo'

      And last, give the search engine some room for its private usage:

      , 'glimpsedir' => '/path/to/glimpse/databases' , 'swishdir' => '/a/directory/here/' It is better not to put these directories in your tree directory, because you could get confused (not LXR). Eventhough only one search engine is used, it does no harm to define both. This way, you can freely change your mind about that search engine.

You're now ready to load the database with your data.