From 07780b06aa7b0fe049cc412309cf87e7fb10a0ef Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 30 Apr 2015 14:25:29 +0200 Subject: Implement module configuration with an option list --- etc/apachectl | 39 +++++++++++++++------------------------ etc/httpd.conf | 34 ++++++++++++++++++++++++++++------ etc/search.conf | 9 +++++++++ etc/view.conf | 5 +++++ 4 files changed, 57 insertions(+), 30 deletions(-) create mode 100644 etc/search.conf create mode 100644 etc/view.conf (limited to 'etc') 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 + + + search-db-host ${DB_HOST} + search-db-port ${DB_PORT} + search-conf "${CONFIG_DIR}/search.conf" + + +LoadModule view_srv ${MODULE_DIR}/libbrep.so + + + view-db-host ${DB_HOST} + view-db-port ${DB_PORT} + view-conf "${CONFIG_DIR}/view.conf" + SetHandler search @@ -43,8 +64,6 @@ TypesConfig /etc/mime.types SetHandler view -DirectoryIndex index.html - ExtendedStatus On @@ -59,3 +78,6 @@ ExtendedStatus On Options FollowSymLinks AllowOverride None + +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 -- cgit v1.1