aboutsummaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-11-14 16:29:22 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-11-16 16:42:35 +0200
commit03905bcf1bcfd9e7932fcac4283c5817058a25ce (patch)
treeb643d3bedf436bfcd8956b25133d5674b6b18e36 /etc
parent96281a6c4f818311a6df90c0d8b8f537a61e1090 (diff)
Invent root path web interface configuration option
Diffstat (limited to 'etc')
-rwxr-xr-xetc/apachectl5
-rw-r--r--etc/config1
-rw-r--r--etc/httpd.conf19
3 files changed, 16 insertions, 9 deletions
diff --git a/etc/apachectl b/etc/apachectl
index e282d9f..895d580 100755
--- a/etc/apachectl
+++ b/etc/apachectl
@@ -26,10 +26,11 @@
ARGV="$@"
-export AP_LOG_LEVEL
-export AP_ADMIN_EMAIL
export AP_PORT
export AP_SERVER_NAME
+export AP_ROOT
+export AP_ADMIN_EMAIL
+export AP_LOG_LEVEL
export AP_DB_HOST
export AP_DB_PORT
export AP_MODULE_DIR
diff --git a/etc/config b/etc/config
index 70fe961..dd89ee1 100644
--- a/etc/config
+++ b/etc/config
@@ -18,6 +18,7 @@ PG_WORKSPACE_DIR="$WORKSPACE_DIR/run/pgsql"
#
AP_PORT=8080
AP_SERVER_NAME="cppget.org:$AP_PORT"
+AP_ROOT="" # Value examples: "", "/foo", "/foo/bar".
AP_ADMIN_EMAIL=admin@cppget.org
AP_LOG_LEVEL=trace1
AP_DB_HOST="$PG_WORKSPACE_DIR"
diff --git a/etc/httpd.conf b/etc/httpd.conf
index 1000b04..c8405ed 100644
--- a/etc/httpd.conf
+++ b/etc/httpd.conf
@@ -5,7 +5,6 @@ ServerAdmin "${AP_ADMIN_EMAIL}"
User apache
Group apache
-DocumentRoot "${AP_WWW_DIR}"
CoreDumpDirectory "${AP_WORKSPACE_DIR}"
PidFile "${AP_WORKSPACE_DIR}/httpd.pid"
@@ -39,43 +38,49 @@ LoadModule deflate_module /usr/lib64/httpd/modules/mod_deflate.so
LoadModule authz_host_module /usr/lib64/httpd/modules/mod_authz_host.so
LoadModule expires_module /usr/lib64/httpd/modules/mod_expires.so
LoadModule dir_module /usr/lib64/httpd/modules/mod_dir.so
+LoadModule alias_module /usr/lib64/httpd/modules/mod_alias.so
LoadModule package_search_srv ${AP_MODULE_DIR}/libbrep-apache.so
<IfModule package_search_srv>
+ package-search-root ${AP_ROOT}/
package-search-db-host ${AP_DB_HOST}
package-search-db-port ${AP_DB_PORT}
- package-search-conf "${AP_CONFIG_DIR}/package-search.conf"
+ package-search-conf ${AP_CONFIG_DIR}/package-search.conf
</IfModule>
LoadModule package_details_srv ${AP_MODULE_DIR}/libbrep-apache.so
<IfModule package_details_srv>
+ package-details-root ${AP_ROOT}/
package-details-db-host ${AP_DB_HOST}
package-details-db-port ${AP_DB_PORT}
- package-details-conf "${AP_CONFIG_DIR}/package-details.conf"
+ package-details-conf ${AP_CONFIG_DIR}/package-details.conf
</IfModule>
LoadModule package_version_details_srv ${AP_MODULE_DIR}/libbrep-apache.so
<IfModule package_version_details_srv>
+ package-version-details-root ${AP_ROOT}/
package-version-details-db-host ${AP_DB_HOST}
package-version-details-db-port ${AP_DB_PORT}
- package-version-details-conf "${AP_CONFIG_DIR}/package-version-details.conf"
+ package-version-details-conf ${AP_CONFIG_DIR}/package-version-details.conf
</IfModule>
-<LocationMatch ^/$>
+<LocationMatch ^${AP_ROOT}/?$>
SetHandler package-search
</LocationMatch>
-<LocationMatch ^/go/[^/]+$>
+<LocationMatch ^${AP_ROOT}/go/[^/]+$>
SetHandler package-details
</LocationMatch>
-<LocationMatch ^/go/[^/]+/[^/]+$>
+<LocationMatch ^${AP_ROOT}/go/[^/]+/[^/]+$>
SetHandler package-version-details
</LocationMatch>
+AliasMatch ^${AP_ROOT}/(.+) ${AP_WWW_DIR}/$1
+
ExtendedStatus On
<Location /server-status>