115N/AOpenGrok deployment, step by step
115N/A---------------------------------
115N/AOne of the design goals of OpenGrok is that it should be easy to use, so a
115N/Auser should be able to use OpenGrok with a minimum of configuration. While the
115N/Amimimum configuration is suitable for some users, it will not fit all users.
115N/AThe intent of this document is to offer a "step by step" guide for two
115N/Adifferent deployments of OpenGrok. A simple configuration suitable for small
115N/Adeployments, and a more "advanced" one for sites that want to host multiple
115N/Asource projects with a single OpenGrok server.
867N/ANote that projects cannot have a "," in their name because of web application
867N/Aproject field separator.
115N/AThe first thing you need to do is to create a directory structure to hold the
115N/Asources and the database used by OpenGrok. I would suggest something like:
115N/AYou should copy the OpenGrok binaries into the bin-directory. The following
115N/Acommand should do the trick:
299N/AEdit OpenGrok, review the configuration section and set at least the
299N/Afollowing parameters to reflect your system and requirements:
115N/AThe last thing we need to do is to configure the web application. To do so,
115N/Aplease execute the following commands:
115N/Athe war-file with the following commands:
115N/Adirectory in the Tomcat installation.
115N/AIn case you have Glassfish, you can use web admin UI to deploy the war, or
115N/Ayou can simply put it in your domains directory in the "autodeploy" folder.
115N/AIf you are using any other web application container servers, please refer to
115N/Atheir documentation on war deployments.
115N/AThis configuration is suitable for deployments where you would like to host
115N/Amultiple source projects in the same OpenGrok installation. This configuration
115N/Ais also suitable if you want to run the index generation on one server, and
115N/Athe web interface on another server.
115N/AI would recommend that you create a unique user and group named opengrok to
115N/Aown the files and run the indexing software.
115N/AAs with the simple configuration you need to set up a directory structure.
115N/AI would suggest something like:
115N/AThe reason we need two stage directories is that the web service will use one
115N/Awhile we're updating the other.
115N/AYou should then populate the directory with files from the OpenGrok
115N/A(Please note that you should use the same value for SRC_ROOT and DATA_ROOT for
115N/Aon all servers if you generate indexes on one server and run the web interface
115N/Aon another server. On Solaris you could use the automounter to mount /opengrok
115N/Aused to run the index generation as a Solaris service. You will find a script
115N/Athat may be used as a skeleton to create you own startup / shutdown script in
115N/Avariables specified there are correct. The service is imported by executing
115N/AThe next thing to do is to populate the source trees with the sources you want
115N/AOpenGrok to serve.
E.g. to create your own "mirror" of the OpenGrok sources you
115N/AIf you are going to host source from multiple projects in your OpenGrok server,
115N/ARemove the '#' to activate the line, and replace "/onnv-gate" with the
115N/Adirectory name of the project you would like to be selected as default (to
115N/Aselect the opengrok source we added above, insert "/opengrok").
115N/AThe last step we need to do before we can start generating the indices is to
115N/Acreate the configuration file used by the web interface. You create the
115N/Aconfiguration file by executing the following command:
115N/AYou can now start generating indices by executing:
115N/A# svcadm enable opengrok
115N/AThe last thing we need to do is to configure the web application. To do so,
115N/Aplease execute the following commands:
115N/A<context-param> entries):
115N/A <param-name>CONFIGURATION</param-name>
115N/A <param-name>ConfigAddress</param-name>
115N/A <param-value>localhost:2424</param-value>
115N/AThe last entry will let the web application listen on port 2424 for
115N/Aconfiguration updates. There is currently _no_ authentication implemented here,
115N/Aso you should not add an ip address reachable from an untrusted source.
115N/AIf you run the index generation on another server than the web server, you must
115N/Aadd one of the external interfaces of the web server (but it should _NOT_ be
115N/Areachable from external hosts).
115N/Athe jar-file with the following commands:
115N/Adirectory in the Tomcat installation.
115N/AIn case you have Glassfish, you can use web admin UI to deploy the war, or
115N/Ayou can simply put it in your domains directory in the "autodeploy" folder.
115N/AIf you are using any other web application container servers, please refer to
115N/Atheir documentation on war deployments.