aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-12-17 15:54:29 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-12-17 15:54:29 +0200
commitb3722503332f0fbaa6013a6aab3f0fed24cbb243 (patch)
tree25cc367f19b8d0e40d1bf6d3cefd3d0708dda967
parent1c8ae0a5bde06f879f37fb7670ec339d6b7a2ccf (diff)
First pass over INSTALL, some file renames
-rw-r--r--INSTALL34
-rw-r--r--INSTALL-DEV4
-rw-r--r--brep/buildfile6
-rw-r--r--etc/brep-apache2.conf94
-rw-r--r--etc/brep-module.conf (renamed from etc/brep.conf)0
-rw-r--r--etc/buildfile2
6 files changed, 73 insertions, 67 deletions
diff --git a/INSTALL b/INSTALL
index 5239d5d..737fa9d 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,22 +1,25 @@
This guide shows how to install and configure brep on a "deployment" machine as
-opposed to a "development" one (see INSTALL-DEV for latter). Here we assume you
-are using a systemd-based installation. If not, then you will need to replace
-systemctl commands with the equivalend init.d ones.
+opposed to a "development" one (see INSTALL-DEV for the latter). Here we assume
+you are using a systemd-based distribution. If not, then you will need to
+replace systemctl commands with the equivalend init.d ones.
1. Create 'brep' User
This user will be used to run the brep repository loader. We will also use its
home directory to build and install the brep module, store its configuration,
etc. We create this user with a disabled password so only root will be able to
-operate as brep. Because of this restriction we can allow brep to run sudo
+operate as brep. Because of this restriction we will allow brep to run sudo
without a password:
# adduser --disabled-password brep
# echo "brep ALL=(ALL) NOPASSWD:ALL" >/etc/sudoers.d/brep
# chmod 0440 /etc/sudoers.d/brep
+@@ TODO ACL
+
In the rest of this guide commands that start with the $ shell prompt are
-assumed to be executed as the brep user and in its home directory.
+expected to be executed as the brep user and in its home directory.
+
2. Install Prerequisites
@@ -55,8 +58,8 @@ e) Install libodb-pgsql and libstudxml
3. Build and Install brep
-$ mkdir build
-$ cd build
+$ mkdir brep install
+$ cd brep
In the following command line, replace <apr> and <apache> with directories
that contain the apr.h and httpd.h headers, respectively. Below are their
@@ -92,7 +95,7 @@ CREATE USER "www-data" INHERIT IN ROLE brep;
Exit psql (^D), then make sure the logins work:
-$ psql -d brep
+$ psql
$ sudo sudo -u www-data psql -d brep
To troubleshoot, see PostgreSQL logs.
@@ -101,10 +104,10 @@ To troubleshoot, see PostgreSQL logs.
5. Create Database Schema and Load Repositories
$ mkdir config
-$ edit config/loader.conf # Capture loader configuration, see brep-loader(1).
+$ edit config/brep-loader.conf # Loader configuration, see brep-loader(1).
-$ psql --quiet -f brep/package.sql
-$ install/bin/brep-loader tests/loader/r.conf
+$ psql --quiet -f install/share/brep/package.sql
+$ install/bin/brep-loader config/brep-loader.conf
To verify:
@@ -113,11 +116,12 @@ $ psql -c 'SELECT name, summary FROM repository'
6. Setup Apache2 Module
-$ cp install/share/brep/etc/brep.conf config/module.conf
-$ edit config/module.conf # Adjust default values if required.
+$ cp install/share/brep/etc/brep-module.conf config/
+$ edit config/brep-module.conf # Adjust default values if required.
Here we assume you have setup an appropriate Apache2 virtual server. Open the
-corresponding Apache2 .conf file and add the following inside VirtualServer:
+corresponding Apache2 .conf file and add the following inside VirtualHost (you
+can also find this fragment in install/share/brep/etc/brep-apache2.conf):
# Load the brep module.
#
@@ -136,7 +140,7 @@ corresponding Apache2 .conf file and add the following inside VirtualServer:
# of this file here. However, you will need to prefix every option with
# 'brep-'.
#
- brep-conf /home/brep/config/module.conf
+ brep-conf /home/brep/config/brep-module.conf
# Static brep content (CSS files).
#
diff --git a/INSTALL-DEV b/INSTALL-DEV
index 3ad039c..92d7d43 100644
--- a/INSTALL-DEV
+++ b/INSTALL-DEV
@@ -75,7 +75,7 @@ replacing <BREP-OUT-ROOT> and <BREP-SRC-ROOT> with the actual absolute paths
# Brep module configuration.
#
- brep-conf <BREP-SRC-ROOT>/etc/brep.conf
+ brep-conf <BREP-SRC-ROOT>/etc/brep-module.conf
# Static brep content (CSS files).
#
@@ -87,7 +87,7 @@ replacing <BREP-OUT-ROOT> and <BREP-SRC-ROOT> with the actual absolute paths
Require all granted
</Directory>
-You may want to replace <BREP-SRC-ROOT>/etc/brep.conf with a custom
+You may want to replace <BREP-SRC-ROOT>/etc/brep-module.conf with a custom
configuration file if you often need to modify it.
Restart Apache2 (use the second version for systemd):
diff --git a/brep/buildfile b/brep/buildfile
index 7fd7233..dbe0bce 100644
--- a/brep/buildfile
+++ b/brep/buildfile
@@ -6,7 +6,11 @@ define mod: libso
mod{*}: bin.libprefix = mod_
mod{*}: install = libexec
-./: lib{brep} mod{brep}
+define sql: file
+sql{*}: extension = sql
+sql{*}: install = data
+
+./: lib{brep} mod{brep} sql{package}
# lib{brep}
#
diff --git a/etc/brep-apache2.conf b/etc/brep-apache2.conf
index bd8cd0c..189216c 100644
--- a/etc/brep-apache2.conf
+++ b/etc/brep-apache2.conf
@@ -1,49 +1,47 @@
-# The brep.conf file can be included once into Apache configuration file in
-# the <VirtualHost> section or in the main server context.
+# Paste the following fragment into your <VirtualHost> section (it is the same
+# as what you find in the INSTALL file).
#
-LoadModule brep_module modules/mod_brep.so
-LoadModule alias_module modules/mod_alias.so
-
-# Alternatively, if loading the modules in another place, make sure they
-# are loaded.
-#
-<IfModule !brep_module>
- Error "mod_brep is not loaded"
-</IfModule>
-
-<IfModule !alias_module>
- Error "mod_alias is not loaded"
-</IfModule>
-
-# To use a repository root other than /pkg/, replace all occurrences of
-# /pkg/ with the desired alternative root (use '/' for webserver root).
-#
-brep-root /pkg/
-brep-db-host localhost
-brep-db-port 5432
-brep-search-results 10
-brep-search-pages 5
-brep-package-description 500
-brep-package-changes 5000
-brep-verbosity 0
-
-# To override brep module options place them into the separate configuration
-# file, suppressing the "brep-" prefix.
-#
-#brep-conf /path/to/brep-site.conf
-
-SetHandler brep
-
-# Location of the brep static content (CSS files).
-#
-Alias /pkg/@/ /usr/share/brep/static/
-
-<Directory "/usr/share/brep/static">
- Require all granted
-</Directory>
-
-# Serve repository files from the repository root path. For example:
-#
-# http://example.org/pkg/1/... -> /path/to/repo/1/...
-#
-#AliasMatch ^/pkg/(\d+)/(.+) /path/to/repo/$1/$2
+
+ # Load the brep module.
+ #
+ LoadModule brep_module /home/brep/install/libexec/brep/mod_brep.so
+ SetHandler brep
+
+ # Repository root. This is the part of the URL between the host name
+ # and the start of the repository. For example, root value /pkg/ means
+ # the repository URL is http://example.org/pkg/. Specify / to use the
+ # web server root (e.g., http://example.org/). If using a different
+ # repository root, don't forget to also change Alias directives below.
+ #
+ brep-root /pkg/
+
+ # Brep module configuration. If you prefer, you can paste the contents
+ # of this file here. However, you will need to prefix every option with
+ # 'brep-'.
+ #
+ brep-conf /home/brep/config/brep-module.conf
+
+ # Static brep content (CSS files).
+ #
+ <IfModule !alias_module>
+ Error "mod_alias is not enabled"
+ </IfModule>
+
+ # Note: trailing slashes are important!
+ #
+ Alias /pkg/@/ /home/brep/install/share/brep/www/
+
+ <Directory "/home/brep/install/share/brep/www">
+ Require all granted
+ </Directory>
+
+ # You can also serve the repository files from the repository root.
+ # For example:
+ #
+ # http://example.org/pkg/1/... -> /path/to/repo/1/...
+ #
+ #AliasMatch ^/pkg/(\d+)/(.+) /path/to/repo/$1/$2
+ #
+ #<Directory "/path/to/repo">
+ # Require all granted
+ #</Directory>
diff --git a/etc/brep.conf b/etc/brep-module.conf
index 26767d6..26767d6 100644
--- a/etc/brep.conf
+++ b/etc/brep-module.conf
diff --git a/etc/buildfile b/etc/buildfile
index ea96623..fc192b6 100644
--- a/etc/buildfile
+++ b/etc/buildfile
@@ -6,4 +6,4 @@ define conf: file
conf{*}: extension = conf
conf{*}: install = data/etc
-./: conf{brep}
+./: conf{brep-module brep-apache2}