{"id":21884052,"url":"https://github.com/leiless/opengrok-cfg","last_synced_at":"2026-04-18T10:35:18.928Z","repository":{"id":140255183,"uuid":"170958993","full_name":"leiless/opengrok-cfg","owner":"leiless","description":"{OpenGrok installation HOWTO","archived":false,"fork":false,"pushed_at":"2019-02-16T12:48:23.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-30T02:27:44.518Z","etag":null,"topics":["opengrok","source-reading"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leiless.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-16T03:38:57.000Z","updated_at":"2019-02-16T12:49:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"75bdc4ef-d00a-4e0a-9861-519db29e6965","html_url":"https://github.com/leiless/opengrok-cfg","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/leiless/opengrok-cfg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leiless%2Fopengrok-cfg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leiless%2Fopengrok-cfg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leiless%2Fopengrok-cfg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leiless%2Fopengrok-cfg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leiless","download_url":"https://codeload.github.com/leiless/opengrok-cfg/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leiless%2Fopengrok-cfg/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31966121,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["opengrok","source-reading"],"created_at":"2024-11-28T10:12:07.052Z","updated_at":"2026-04-18T10:35:18.909Z","avatar_url":"https://github.com/leiless.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"## {OpenGrok installation HOWTO\n\nRequirements:\n\n- Latest [Java](http://www.oracle.com/technetwork/java/) 1.8\n\n- A servlet container like [GlassFish](https://javaee.github.io/glassfish/) or [Tomcat](http://tomcat.apache.org/) ([8.x](https://tomcat.apache.org/download-80.cgi) or later) also running with Java at least 1.8\n\n- [Universal ctags](https://github.com/universal-ctags/ctags) ([Exuberant ctags](http://ctags.sourceforge.net/) work too)\n\n- Python 3\n\n\u003cbr\u003e\n\ntomcat root page: `/usr/local/apache-tomcat-8.0/webapps/ROOT`\n\n{OpenGrok logo: `/usr/local/apache-tomcat-8.0/webapps/source/default/img/icon.png`\n\n**NOTE**: those files owned by www:www\n\n## Patches\n\n```\nserver.xml.patch:   /usr/local/apache-tomcat-8.0/conf\n\nOpenGrok.patch:     /var/opengrok/bin\n\nweb.xml.patch:      /var/opengrok/web/source/WEB-INF\n\nindex.jsp.patch:    /usr/local/apache-tomcat-8.0/webapps/source\n```\n\n## Index\n\n```shell\n/var/opengrok/bin/OpenGrok index\n```\n\n\u003cbr\u003e\n\n## Install in CentOS 7\n\nThe script should be run by `root` user\n\n### Update system\n\n```shell\nyum -y update\n```\n\n### [Install python 3](https://www.digitalocean.com/community/tutorials/how-to-install-python-3-and-set-up-a-local-programming-environment-on-centos-7)\n\n```shell\nyum -y group install \"Development Tools\"\n\nyum -y install https://centos7.iuscommunity.org/ius-release.rpm\nyum -y install python36u\nyum -y install python36u-pip\n\npip3.6 install --upgrade pip\n```\n\n### [Install JDK 1.8](https://www.digitalocean.com/community/tutorials/how-to-install-java-on-centos-and-fedora#install-openjdk-8)\n\n```shell\nyum -y install java-1.8.0-openjdk-devel\n```\n\n### [Install tomcat 8](https://www.digitalocean.com/community/tutorials/how-to-install-apache-tomcat-8-on-centos-7)\n\n```shell\nyum -y install vim\nyum -y install wget\nwget http://mirror.csclub.uwaterloo.ca/apache/tomcat/tomcat-8/v8.5.38/bin/apache-tomcat-8.5.38.tar.gz\n\nmkdir /opt/tomcat\ntar xvf apache-tomcat-8*tar.gz -C /opt/tomcat --strip-components=1\n\ngroupadd tomcat\nuseradd -M -s /bin/nologin -g tomcat -d /opt/tomcat tomcat\n\nchgrp -R tomcat /opt/tomcat\n\ncd /opt/tomcat\nchmod -R g+r conf\nchmod g+x conf\n\nchown -R tomcat webapps/ work/ temp/ logs/\n```\n\n### Install `systemd` unit file\n\n`vim /etc/systemd/system/tomcat.service`:\n\nNote the `CATALINA_OPTS` option\n\n```xml\n# Systemd unit file for tomcat\n[Unit]\nDescription=Apache Tomcat Web Application Container\nAfter=syslog.target network.target\n\n[Service]\nType=forking\n\nEnvironment=JAVA_HOME=/usr/lib/jvm/jre\nEnvironment=CATALINA_PID=/opt/tomcat/temp/tomcat.pid\nEnvironment=CATALINA_HOME=/opt/tomcat\nEnvironment=CATALINA_BASE=/opt/tomcat\nEnvironment='CATALINA_OPTS=-Xms256M -Xmx2048M -server -XX:+UseParallelGC'\nEnvironment='JAVA_OPTS=-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom'\n\nExecStart=/opt/tomcat/bin/startup.sh\nExecStop=/bin/kill -15 $MAINPID\n\nUser=tomcat\nGroup=tomcat\nUMask=0007\nRestartSec=10\nRestart=always\n\n[Install]\nWantedBy=multi-user.target\n\n```\n\n\u003cbr\u003e\n\n### Test tomcat\n\n```shell\nsystemctl daemon-reload\nsystemctl start tomcat\nsystemctl enable tomcat\nsystemctl status tomcat\n\nsystemctl restart tomcat\n```\n\nAccess default tomcat page: `http://SERVER_IP_ADDRESS:8080`\n\n### [Install `universial-ctags`](https://askubuntu.com/questions/796408/installing-and-using-universal-ctags-instead-of-exuberant-ctags)\n\n```shell\ngit clone https://github.com/universal-ctags/ctags\ncd ctags\n./autogen.sh\n./configure\nmake\nmake install\n\nctags --version\n```\n\n\u003cbr\u003e\n\n### Install `{OpenGrok`\n\n```shell\ncd /opt\nwget https://github.com/oracle/opengrok/releases/download/1.2.1/opengrok-1.2.1.tar.gz\ntar xvf opengrok-1.2.1.tar.gz\nln -s opengrok-1.2.1 opengrok\n\ncd opengrok\nmkdir -p etc src data\n```\n\n### Install `opengrok-tools`\n\n```shell\ncd /opt/opengrok/src\ngit clone https://github.com/libuv/libuv\n\ncd /opt/opengrok\npython3.6 -m venv opengrok-tools\nopengrok-tools/bin/python -m pip install tools/opengrok-tools.tar.gz\n```\n\n### Deploy \u0026 Index\n\n```shell\ncd /opt/opengrok\n\n# -c option should use absolute path\n# it'll write into /opt/tomcat/webapps/source/WEB-INF/web.xml\nopengrok-tools/bin/opengrok-deploy -c /opt/opengrok/etc/configuration.xml \\\n\tlib/source.war /opt/tomcat/webapps\n\nopengrok-tools/bin/opengrok-indexer \\\n\t-J=-Djava.util.logging.config.file=/opt/opengrok/doc/logging.properties \\\n\t-a lib/opengrok.jar -- \\\n\t-s src -d data -H -P -S -G \\\n\t-W etc/configuration.xml -U http://localhost:8080/source\n```\n\nRefresh your web browser grok page, to see latest changes.\n\n\u003cbr\u003e\n\n### Miscellaneous\n\n#### Change timezone\n\n```shell\ntimedatectl set-timezone Asia/Shanghai\n```\n\n#### [Configure Tomcat to Listen to Port 80](https://docs.lucee.org/guides/installing-lucee/lucee-server-adminstration-linux/configure-Tomcat-listen-to-port.html)\n\n```shell\n# Forward 80 to 8080, thus you don't have to change server.xml\niptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080\n\n# List NAT-PREROUTING rules\niptables -t nat -v -L PREROUTING -n --line-number\n\n# Delete NAT-PREROUTING rule at index 1\niptables -t nat -D PREROUTING 1\n```\n\n**NOTE**: above solution is not recommended\n\nOr alternatively, Install [authbind](https://aaronsilber.me/2016/04/24/install-authbind-on-centos-7-x86_64-download-the-rpm/) on CentOS\n\n```shell\nrpm -Uvh https://s3.amazonaws.com/aaronsilber/public/authbind-2.1.1-0.1.x86_64.rpm\n\ntouch /etc/authbind/byport/80\nchmod 500 /etc/authbind/byport/80\nchown tomcat /etc/authbind/byport/80\nls -l /etc/authbind/byport/80\n```\n\n\u003cbr\u003e\n\n`vim /opt/tomcat/bin/startup.sh`:\n\nChange from `exec \"$PRGDIR\"/\"$EXECUTABLE\" start \"$@\"`\n\nto `exec authbind --deep \"$PRGDIR\"/\"$EXECUTABLE\" start \"$@\"`\n\n\u003cbr\u003e\n\n`vim /opt/tomcat/conf/server.xml`:\n\nChange `\u003cConnector port=\"8080\" ...` to `\u003cConnector port=\"80\" ...`\n\n\u003cbr\u003e\n\n```\nsystemctl restart tomcat\n```\n\n\u003cbr\u003e\n\n## References\n\n[How to setup OpenGrok](https://github.com/oracle/opengrok/wiki/How-to-setup-OpenGrok)\n\n[OpenGrok github repository](https://github.com/oracle/opengrok)\n\n[Install {OpenGrok on FreeBSD](https://wiki.bsdforen.de/wiki:marduk:opengrok)\n\n[Using {OpenGrok to boost up source code reading](http://junkman.cn/p/18/03_opengrok.html)\n\n[How To Install Python 3 and Set Up a Local Programming Environment on CentOS 7](https://www.digitalocean.com/community/tutorials/how-to-install-python-3-and-set-up-a-local-programming-environment-on-centos-7)\n\n[{OpenGrok Installations](https://github.com/oracle/opengrok/wiki/Installations)\n\n[OpenGrokによるソースコード検索環境の構築](https://qiita.com/vmmhypervisor/items/23e9ea60863c15014836)\n\n[How To Install Java on CentOS and Fedora #Install OpenJDK 8](https://www.digitalocean.com/community/tutorials/how-to-install-java-on-centos-and-fedora#install-openjdk-8)\n\n[ How To Install Apache Tomcat 8 on CentOS 7](https://www.digitalocean.com/community/tutorials/how-to-install-apache-tomcat-8-on-centos-7)\n\n[universal-ctags Building with configure (*nix including GNU/Linux)](https://github.com/universal-ctags/ctags/blob/master/docs/autotools.rst)\n\n[Install and Configure Tomcat 8 on Centos-7](https://hostpresto.com/community/tutorials/install-and-configure-tomcat-8-on-centos-7)\n\n[INSTALL TOMCAT 8](https://snapdev.net/2016/09/29/install-tomcat-8-on-centos-7/)\n\n\u003cbr\u003e\n\n*Created 180414 Rev_no: 2*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleiless%2Fopengrok-cfg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleiless%2Fopengrok-cfg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleiless%2Fopengrok-cfg/lists"}