Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Setting up Opengrok in a FreeNAS 11.2 iocage jail ====== Create storage dataset's for GROK {{:blog:grok-storage-dataset.png|}} Create a jail for GROK {{:blog:grok-jail-setup.png|}} Setup jail mount points for src and data. You need to stop the jail to add mount points and then restart afterwards. * /mnt/u03/opengrok/src -> /var/opengrok/src * /mnt/u03/opengrok/data -> /var/opengrok/data {{:blog:grok-mount-points.png|}} Find the JAIL and open a shell <code> root@ale[~]# jls JID IP Address Hostname Path 1 plex /mnt/u02/iocage/jails/plex/root 2 bind /mnt/u02/iocage/jails/bind/root 5 beer /mnt/u02/iocage/jails/beer/root 6 grok /mnt/u02/iocage/jails/grok/root root@ale[~]# jexec 6 /bin/sh </code> Install opengrok and git. To generate the history caches from GIT based repositories we need the git command line tool. <code> # pkg install -y opengrok git # pkg info opengrok opengrok-1.0 Name : opengrok Version : 1.0 Installed on : Tue May 14 09:04:03 2019 EDT Origin : devel/opengrok Architecture : FreeBSD:11:* Prefix : /usr/local Categories : devel java Licenses : APACHE20, CDDL Maintainer : ports@FreeBSD.org WWW : http://opengrok.github.io/OpenGrok/ Comment : Fast and powerful code search and cross-reference engine Options : DOCS : on RESIN3 : off TOMCAT6 : off TOMCAT7 : off TOMCAT8 : on TOMCAT85 : off Annotations : repo_type : binary repository : FreeBSD Flat size : 20.5MiB Description : OpenGrok is a fast source code search and cross reference engine. It helps you search, cross-reference and navigate your source tree. It can understand various program file formats and version control histories like Mercurial, Git, SCCS, RCS, CVS, Subversion, Teamware, ClearCase, Perforce and Bazaar. In other words it lets you grok (profoundly understand) the open source, hence the name OpenGrok. It is written in Java. WWW: http://opengrok.github.io/OpenGrok/ </code> This installs tomcat8 we need to autostart this. <code> # ls /usr/local/etc/rc.d tomcat8 </code> Enable for auto start /etc/rc.conf <code> echo tomcat8_enable="YES" >>/etc/rc.conf </code> and start it <code> service tomcat8 start </code> This should fire up with an error. That's OK as we have not indexed anything the error will disappear after indexing. * http://192.168.1.12:8080/opengrok/ Make a directory <code> mkdir /var/opengrok/etc </code> Create a helper script and run it. <code> cat <<EOF >~/opengrok-index opengrok -c /usr/local/bin/exctags -s /var/opengrok/src -d /var/opengrok/data -H -P -S -G -W /var/opengrok/etc/configuration.xml service tomcat8 restart EOF chmod a+x ~/opengrok-index ~/opengrok-index </code> The -U parameter only takes host:port and it assumes the WEBAPP is called /source which means the indexer can't tell the running opengrok to reload. So restart tomcat as part of the index run. A minor wart. ====== Making opengrok the default webapp and use port 80 ====== Moving tomcat from port 8080 to port 80 Edit /usr/local/apache-tomcat-8.0/conf/server.xml file and replace 8080 with 80 <code> <Connector port="80" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> </code> Make opengrok the default web application by adding a <Context> tag inside <Host> * https://stackoverflow.com/questions/5638787/default-web-app-in-tomcat <code> <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true"> <Context path="" docBase="/usr/local/apache-tomcat-8.0/webapps/opengrok"> <WatchedResource>WEB-INF/web.xml</WatchedResource> </Context> </code> {{tag>freenas opengrok iocage jail}} ~~LINKBACK~~ blog/setting_up_opengrok_in_a_freenas_11.2_iocage_jail.txt Last modified: 2019/06/25 00:15by brett