[Groonga-commit] groonga/groonga [master] httpd: set the default database path

Back to archive index

null+****@clear***** null+****@clear*****
2012年 7月 25日 (水) 16:36:38 JST


Kouhei Sutou	2012-07-25 16:36:38 +0900 (Wed, 25 Jul 2012)

  New Revision: 54a5d6c1f8246e8f5a1ecdd554cb404496a31a02
  https://github.com/groonga/groonga/commit/54a5d6c1f8246e8f5a1ecdd554cb404496a31a02

  Log:
    httpd: set the default database path

  Modified files:
    configure.ac
    data/groonga-httpd.conf.in
    doc/source/reference/executables/groonga-httpd.txt

  Modified: configure.ac (+16 -0)
===================================================================
--- configure.ac    2012-07-25 16:11:12 +0900 (a040970)
+++ configure.ac    2012-07-25 16:36:38 +0900 (f944a57)
@@ -1204,7 +1204,10 @@ AC_ARG_ENABLE(nginx,
   [enable_nginx="$enableval"],
   [enable_nginx="yes"])
 if test "x$enable_nginx" != "xno"; then
+  enable_nginx="yes"
   AC_CONFIG_SUBDIRS([vendor/nginx])
+else
+  enable_nginx="no"
 fi
 AM_CONDITIONAL(WITH_NGINX, test "$enable_nginx" = "yes")
 
@@ -1235,6 +1238,12 @@ GROONGA_HTTPD_DOCUMENT_ROOT="`
 `"
 AC_SUBST(GROONGA_HTTPD_DOCUMENT_ROOT)
 
+GROONGA_HTTPD_DEFAULT_DATABASE_PATH="`
+  test \"$prefix\" = NONE && prefix=/usr/local
+  eval eval eval echo ${localstatedir}/lib/${PACKAGE}/db/db
+`"
+AC_SUBST(GROONGA_HTTPD_DEFAULT_DATABASE_PATH)
+
 AC_OUTPUT([
   packages/rpm/centos/groonga.spec
   packages/rpm/fedora/groonga.spec
@@ -1295,6 +1304,13 @@ if test "x$message_pack_available" = "xyes"; then
 fi
 echo
 
+echo "groonga-httpd:"
+echo "  enable:                $enable_nginx"
+if test "$enable_nginx" = "yes"; then
+  echo "  default database path: $GROONGA_HTTPD_DEFAULT_DATABASE_PATH"
+fi
+echo
+
 echo "Tools:"
 # echo "  Sphinx:                ${enable_sphinx}"
 echo "  hg:                    ${HG}"

  Modified: data/groonga-httpd.conf.in (+5 -3)
===================================================================
--- data/groonga-httpd.conf.in    2012-07-25 16:11:12 +0900 (9734532)
+++ data/groonga-httpd.conf.in    2012-07-25 16:36:38 +0900 (82d9152)
@@ -14,15 +14,17 @@ http {
   sendfile on;
   keepalive_timeout 65;
 
+  # The default groonga database path.
+  groonga_database @GROONGA_HTTPD_DEFAULT_DATABASE_PATH@;
+
   server {
     listen 10041;
     server_name localhost;
 
     location /d/ {
       groonga on;
-
-      # Specify an actual database and enable this.
-      #groonga_database /path/to/database;
+      # You can custom database path.
+      # groonga_database /path/to/groonga/db;
     }
 
     location / {

  Modified: doc/source/reference/executables/groonga-httpd.txt (+44 -8)
===================================================================
--- doc/source/reference/executables/groonga-httpd.txt    2012-07-25 16:11:12 +0900 (ab242bd)
+++ doc/source/reference/executables/groonga-httpd.txt    2012-07-25 16:36:38 +0900 (6f57090)
@@ -43,7 +43,7 @@ groonga_database directive like this::
      ...
      # Don't change the location; currently only /d/ is supported.
      location /d/ {
-       groonga; # <= This means to turn on groonga-httpd.
+       groonga on; # <= This means to turn on groonga-httpd.
 
        # Specify an actual database and enable this.
        groonga_database /var/lib/groonga/db/db;
@@ -81,24 +81,60 @@ Finally, to terminate the running groonga-httpd daemon, run this::
 Configuration directives
 ------------------------
 
-There are two kinds of configuration directives. One is provided by nginx, the
-other is by groonga-httpd.
+This section decribes only important directives. They are
+groonga-httpd specific directives and performance related directives.
 
 The following directives can be used in the groonga-httpd configuration file.
 By default, it's located at /etc/groonga/httpd/groonga-httpd.conf.
 
-Groonga-specific directives
-^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Groonga-httpd specific directives
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-The following directives aren't provided by nginx. They are provided by
-groonga-httpd to configure groonga-httpd-specific configurations.
+The following directives aren't provided by nginx. They are provided
+by groonga-httpd to configure groonga-httpd specific configurations.
+
+``groonga``
+"""""""""""
+
+Syntax::
+
+  groonga on | off;
+
+Default
+  ``groonga off;``
+
+Context
+  location
+
+Specifies whether groonga is enabled in the location block. The
+default is ``off``. You need to specify ``on`` to enable groonga.
+
+Examples::
+
+  location /d/ {
+    groonga on;  # Enables groonga under /d/... path
+  }
+
+  location /d/ {
+    groonga off; # Disables groonga under /d/... path
+  }
 
 ``groonga_database``
 """"""""""""""""""""
 
+Syntax::
+
+  groonga_database /path/to/groonga/database;
+
+Default
+  ``groonga off;``
+
+Context
+  location
+
 Specifies the path to a groonga database.
 
-Performance-related directives
+Performance related directives
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 The following directives are related to the performance of groonga-httpd.
-------------- next part --------------
HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B...
下载 



Groonga-commit メーリングリストの案内
Back to archive index