diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-04-30 14:25:29 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-04-30 14:25:29 +0200 |
commit | 07780b06aa7b0fe049cc412309cf87e7fb10a0ef (patch) | |
tree | b6d0f1ee50223f5cbbc4b8c5d0dc4f69ff7f2352 /etc | |
parent | 259a92ac4e1ac50e4c029f54265b735f6214b49d (diff) |
Implement module configuration with an option list
Diffstat (limited to 'etc')
-rwxr-xr-x | etc/apachectl | 39 | ||||
-rw-r--r-- | etc/httpd.conf | 34 | ||||
-rw-r--r-- | etc/search.conf | 9 | ||||
-rw-r--r-- | etc/view.conf | 5 |
4 files changed, 57 insertions, 30 deletions
diff --git a/etc/apachectl b/etc/apachectl index a879354..1039c50 100755 --- a/etc/apachectl +++ b/etc/apachectl @@ -27,23 +27,28 @@ ARGV="$@" # |||||||||||||||||||| START CONFIGURATION SECTION |||||||||||||||||||| # -------------------- -------------------- -PORT=7180 -LOG_LEVEL=trace1 -ADMIN_EMAIL=admin@cppget.org +export PORT=7180 +export SERVER_NAME="cppget.org:$PORT" +export LOG_LEVEL=trace1 +export ADMIN_EMAIL=admin@cppget.org + +export DB_HOST=localhost +export DB_PORT=7136 # |||||||||||||||||||| END CONFIGURATION SECTION ||||||||||||||||||||||| PROJECT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/.. -site_config="$PROJECT_DIR/etc" -workspace="$PROJECT_DIR/var" -www="$PROJECT_DIR/www" +export MODULE_DIR="$PROJECT_DIR" +export WWW_DIR="$PROJECT_DIR/www" +export CONFIG_DIR="$PROJECT_DIR/etc" +export WORKSPACE_DIR="$PROJECT_DIR/var" -mkdir -p "$workspace" +mkdir -p "$WORKSPACE_DIR" # the path to your httpd binary, including options if necessary -HTTPD="/usr/sbin/httpd -d $workspace -f $site_config/httpd.conf" +HTTPD="/usr/sbin/httpd -d $WORKSPACE_DIR -f $CONFIG_DIR/httpd.conf" # a command that outputs a formatted text version of the HTML at the # url given on the command line. Designed for lynx, however other @@ -73,25 +78,11 @@ if [ "x$ARGV" = "x" ] ; then fi case $ARGV in -start) - $HTTPD -C "Listen $PORT" -C "ServerName cppget.org:$PORT" \ - -C "DocumentRoot $www/htdocs" -C "CoreDumpDirectory $workspace" \ - -C "PidFile $workspace/httpd.pid" \ - -C "LogLevel $LOG_LEVEL" \ - -C "ServerAdmin $ADMIN_EMAIL" \ - -k $ARGV \ - \ - -C "LoadModule search_srv $PROJECT_DIR/libbrep.so" \ - -C "search_conf $site_config/search.conf" \ - \ - -C "LoadModule view_srv $PROJECT_DIR/libbrep.so" \ - -C "view_conf $site_config/view.conf" - +start) $HTTPD -k $ARGV ERROR=$? ;; stop|restart|graceful) - $HTTPD -C "ServerName cppget.org:$PORT" \ - -C "PidFile $workspace/httpd.pid" -k $ARGV + $HTTPD -k $ARGV ERROR=$? ;; startssl|sslstart|start-SSL) diff --git a/etc/httpd.conf b/etc/httpd.conf index 95b887d..b52b7d0 100644 --- a/etc/httpd.conf +++ b/etc/httpd.conf @@ -1,13 +1,20 @@ +Listen ${PORT} +ServerName "${SERVER_NAME}" +ServerAdmin "${ADMIN_EMAIL}" + User apache Group apache -ErrorLog error_log -#ErrorLog "|/usr/sbin/rotatelogs /Users/karen/projects/brep/var/error_log.%Y%m%d 86400" +DocumentRoot "${WWW_DIR}/htdocs" +CoreDumpDirectory "${WORKSPACE_DIR}" +PidFile "${WORKSPACE_DIR}/httpd.pid" +#ErrorLog error_log +ErrorLog "|/usr/sbin/rotatelogs error_log.%Y%m%d 86400" ErrorLogFormat "[%t] [%l] [%m] %M" +LogLevel ${LOG_LEVEL} Timeout 60 - KeepAlive On KeepAliveTimeout 3 @@ -33,7 +40,21 @@ 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 -TypesConfig /etc/mime.types +LoadModule search_srv ${MODULE_DIR}/libbrep.so + +<IfModule search_srv> + search-db-host ${DB_HOST} + search-db-port ${DB_PORT} + search-conf "${CONFIG_DIR}/search.conf" +</IfModule> + +LoadModule view_srv ${MODULE_DIR}/libbrep.so + +<IfModule view_srv> + view-db-host ${DB_HOST} + view-db-port ${DB_PORT} + view-conf "${CONFIG_DIR}/view.conf" +</IfModule> <LocationMatch ^/search$> SetHandler search @@ -43,8 +64,6 @@ TypesConfig /etc/mime.types SetHandler view </LocationMatch> -DirectoryIndex index.html - ExtendedStatus On <Location /server-status> @@ -59,3 +78,6 @@ ExtendedStatus On Options FollowSymLinks AllowOverride None </Directory> + +DirectoryIndex index.html +TypesConfig /etc/mime.types diff --git a/etc/search.conf b/etc/search.conf new file mode 100644 index 0000000..f742cda --- /dev/null +++ b/etc/search.conf @@ -0,0 +1,9 @@ +# brep::module options + +verb 1 + +# brep::search options + +results-on-page 20 + +#ah 7 diff --git a/etc/view.conf b/etc/view.conf new file mode 100644 index 0000000..7c9b163 --- /dev/null +++ b/etc/view.conf @@ -0,0 +1,5 @@ +# brep::module options + +verb 2 + +#oh 8 |