戻る>2006/開発環境

参考URL

目的

  • 複数のOpenGrokを同一のhostに立ち上げる。

状況

  • クロスリファレンスの異常解消。
    • 簡易動作確認OK。

調査

  • -w で指定できてもよさそうだが、、、
    • README.txt
If you need to change name of the web application from source to something
else you need to use special option -w <new_name> for indexer to create
proper xrefs, besides changing the .war file name. Examples below show just
deploying source.war, but you can use it to deploy your new_name.war too.
  • バグらしい orz
    • src/org/opensolaris/opengrok/configuration/Configuration.java
         setUrlPrefix("/source/s?");
         //setUrlPrefix("../s?"); // TODO generate relative search paths, get rid of -w <webapp> option to indexer !

結果

tree を準備する

  • $ tree /home/aaa /home/bbb
/home/aaa
|-- opengrok-0.11.1
`-- src
    `-- main.c
/home/bbb
|-- opengrok-0.11.1
`-- src
    `-- main.c
  • $ cat /home/aaa/src/main.c
#include <stdio.h>

test()
{
        printf("aaa\n"); // or "bbb\n"
}
main()
{
        test();
}

コードの修正

  • 行頭"-"がaaa側の修正
  • 行頭"+"がbbb側の修正
diff --git a/OpenGrok b/OpenGrok
index 55f3310..3fafb8f 100755
--- a/OpenGrok
+++ b/OpenGrok
@@ -121,7 +121,7 @@ DefaultInstanceConfiguration()
     # operating systems, if you have any reasonably generic
     # improvements please feel free to submit a patch.

-    OPENGROK_INSTANCE_BASE="${OPENGROK_INSTANCE_BASE:-/home/aaa}"
+    OPENGROK_INSTANCE_BASE="${OPENGROK_INSTANCE_BASE:-/home/bbb}"

     LOGGER_CONFIG_FILE="logging.properties"

@@ -251,7 +251,7 @@ DefaultInstanceConfiguration()
            WEBAPP_CONFIG_ADDRESS=""
        fi
     else
-        WEBAPP_CONFIG_ADDRESS="localhost:2425"
+        WEBAPP_CONFIG_ADDRESS="localhost:2426"
     fi

     if [ -n "${WEBAPP_CONFIG_ADDRESS}" ]; then
diff --git a/src/org/opensolaris/opengrok/configuration/Configuration.java b/src/org/opensolaris/opengrok/configuration/Configuration.java
index 27c8608..3819afb 100644
--- a/src/org/opensolaris/opengrok/configuration/Configuration.java
+++ b/src/org/opensolaris/opengrok/configuration/Configuration.java
@@ -148,7 +148,7 @@ public final class Configuration {
         setHistoryCacheInDB(false);
         setProjects(new ArrayList<Project>());
         setRepositories(new ArrayList<RepositoryInfo>());
-        setUrlPrefix("/aaa/s?");
+        setUrlPrefix("/bbb/s?");
         //setUrlPrefix("../s?"); // TODO generate relative search paths, get rid of -w <webapp> option to indexer !
         setCtags(System.getProperty("org.opensolaris.opengrok.analysis.Ctags", "ctags"));
         //below can cause an outofmemory error, since it is defaulting to NO LIMIT
diff --git a/web/WEB-INF/web.xml b/web/WEB-INF/web.xml
index 145ad07..548e8ed 100644
--- a/web/WEB-INF/web.xml
+++ b/web/WEB-INF/web.xml
@@ -5,13 +5,13 @@
   <description>A wicked fast source browser</description>
   <context-param>
     <param-name>CONFIGURATION</param-name>
-    <param-value>/home/aaa/etc/configuration.xml</param-value>
+    <param-value>/home/bbb/etc/configuration.xml</param-value>
     <description>Full path to the configuration file where OpenGrok can read it's configuration</description>
   </context-param>

   <context-param>
     <param-name>ConfigAddress</param-name>
-    <param-value>localhost:2425</param-value>
+    <param-value>localhost:2426</param-value>
     <description>An address where OpenGrok can receive new configuration</description>
   </context-param>

実行

  • 双方で以下を実行
$ ant
$ sudo ./OpenGrok deploy
$ sudo mv /var/lib/tomcat6/webapps/source.war /var/lib/tomcat6/webapps/aaa.war // or bbb.war
$ ./OpenGrok index
  • OprnGrogのコードを修正した場合は、data/, etc/, log/, logging.properties を削除してから、antからやり直す。
  • 対象のコードを更新した場合は,"./OpenGrok index"を再実行.

コメントをかく


「http://」を含む投稿は禁止されています。

利用規約をご確認のうえご記入下さい

管理人/副管理人のみ編集できます