From: Marcin Haba Date: Sat, 15 Aug 2015 23:39:08 +0000 (+0200) Subject: baculum: Add deb template files and deb configs examples X-Git-Tag: Release-7.4.0~231 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=056e199b1280505299985542be713e5068ad90bb;p=bacula%2Fbacula baculum: Add deb template files and deb configs examples --- diff --git a/gui/baculum/examples/deb-template/baculum-apache.conf b/gui/baculum/examples/deb-template/baculum-apache.conf new file mode 100644 index 0000000000..7dc51c20ec --- /dev/null +++ b/gui/baculum/examples/deb-template/baculum-apache.conf @@ -0,0 +1,46 @@ +Listen 9095 + + + DocumentRoot %DOCUMENTROOT + ServerName localhost + CustomLog %LOGDIR/baculum-access.log combined + ErrorLog %LOGDIR/baculum-error.log + + Options +FollowSymLinks + RewriteEngine On + RewriteCond %{REQUEST_FILENAME} !-d + RewriteCond %{REQUEST_FILENAME} !-f + RewriteRule ^(.*)$ index.php/$1 [L] + AuthType Basic + AuthName "Baculum Auth" + AuthUserFile %DOCUMENTROOT/protected/Data/baculum.users + Require valid-user + + + Order Deny,Allow + Deny from all + + + Order Deny,Allow + Deny from all + + + Order Deny,Allow + Deny from all + + + + mod_gzip_on Yes + mod_gzip_dechunk Yes + mod_gzip_item_include file \.js$ + mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.* + + + ExpiresActive On + ExpiresDefault "access plus 864000 seconds" + + + Header set Cache-Control "max-age=864000, private" + + + diff --git a/gui/baculum/examples/deb-template/baculum-lighttpd.conf b/gui/baculum/examples/deb-template/baculum-lighttpd.conf new file mode 100644 index 0000000000..74defe9717 --- /dev/null +++ b/gui/baculum/examples/deb-template/baculum-lighttpd.conf @@ -0,0 +1,103 @@ +# Baculum WebGUI tool for Bacula Community +# +# Web Server Configuration +# + +server.port = 9095 +server.username = "www-data" +server.groupname = "www-data" +server.document-root = "%DOCUMENTROOT" +server.errorlog = "%LOGDIR/baculum-error.log" +accesslog.filename = "%LOGDIR/baculum-access.log" +server.pid-file = "/var/run/baculum.pid" + +server.modules = ( + "mod_auth", + "mod_alias", + "mod_rewrite", + "mod_setenv", + "mod_fastcgi", + "mod_access", + "mod_accesslog" +) + +auth.backend = "htpasswd" +auth.backend.htpasswd.userfile = "%DOCUMENTROOT/protected/Data/baculum.users" +auth.require = ( "/" => ( + "method" => "basic", + "realm" => "Baculum Auth", + "require" => "valid-user" + ) +) + +index-file.names = ( "index.php" ) + +static-file.exclude-extensions = ( ".php" ) + +dir-listing.encoding = "utf-8" + +mimetype.assign = ( + ".html" => "text/html", + ".gif" => "image/gif", + ".png" => "image/png", + ".ico" => "image/x-icon", + ".css" => "text/css", + ".js" => "application/javascript" +) + +alias.url = ( + "/" => "%DOCUMENTROOT/" +) + +fastcgi.server = ( + ".php"=> ( + ( + "bin-path"=>"/usr/bin/php-cgi", + "socket"=>"/tmp/php.sock", + "max-procs" => 1, + "bin-environment" => ( + "PHP_FCGI_CHILDREN" => "4", + "PHP_FCGI_MAX_REQUESTS" => "10000" + ), + "bin-copy-environment" => ( + "PATH", + "SHELL", + "USER" + ), + "broken-scriptfilename" => "enable" + ) + ) +) + +url.rewrite-once = ( + "^/themes/(.+)$" => "/themes/$1", + "^/assets/(.+)$" => "/assets/$1", + "^/(.+)$" => "/index.php/$1" +) + +url.access-deny = ( + "^%DOCUMENTROOT/protected/", + "^%DOCUMENTROOT/framework/", + + # Wsat is not used by Baculum. Added here for not storing + # framework Apache specific .htaccess files + "^%DOCUMENTROOT/framework/Wsat/themes/" +) + +### Enable compressing dynamic content ### + +# disable mod_compress when request a php file +$HTTP["url"] !~ "\.php$" { + compress.filetype = ( + "text/plain", + "text/html", + "text/javascript", + "text/css", + "text/xml" + ) +} + +# enable mod_setenv for framework source files: +$HTTP["url"] =~ "^%DOCUMENTROOT/framework/Web/Javascripts/source/" { + setenv.add-response-header = ("Content-Encoding" => "gzip") +} diff --git a/gui/baculum/examples/deb-template/baculum-lighttpd.service b/gui/baculum/examples/deb-template/baculum-lighttpd.service new file mode 100644 index 0000000000..b54937e132 --- /dev/null +++ b/gui/baculum/examples/deb-template/baculum-lighttpd.service @@ -0,0 +1,11 @@ +[Unit] +Description=Baculum WebGUI Bacula Community tool +After=network.target + +[Service] +PIDFile=/var/run/baculum.pid +ExecStart=/usr/sbin/lighttpd -f %CONFDIR/baculum-lighttpd.conf + +[Install] +WantedBy=multi-user.target + diff --git a/gui/baculum/examples/deb-template/baculum.users b/gui/baculum/examples/deb-template/baculum.users new file mode 100644 index 0000000000..1375f69da5 --- /dev/null +++ b/gui/baculum/examples/deb-template/baculum.users @@ -0,0 +1 @@ +admin:YWG41BPzVAkN6 \ No newline at end of file diff --git a/gui/baculum/examples/deb/baculum-apache.conf b/gui/baculum/examples/deb/baculum-apache.conf new file mode 100644 index 0000000000..0d7473bc51 --- /dev/null +++ b/gui/baculum/examples/deb/baculum-apache.conf @@ -0,0 +1,46 @@ +Listen 9095 + + + DocumentRoot /usr/share/baculum/htdocs + ServerName localhost + CustomLog /var/log/apache2/baculum-access.log combined + ErrorLog /var/log/apache2/baculum-error.log + + Options +FollowSymLinks + RewriteEngine On + RewriteCond %{REQUEST_FILENAME} !-d + RewriteCond %{REQUEST_FILENAME} !-f + RewriteRule ^(.*)$ index.php/$1 [L] + AuthType Basic + AuthName "Baculum Auth" + AuthUserFile /usr/share/baculum/htdocs/protected/Data/baculum.users + Require valid-user + + + Order Deny,Allow + Deny from all + + + Order Deny,Allow + Deny from all + + + Order Deny,Allow + Deny from all + + + + mod_gzip_on Yes + mod_gzip_dechunk Yes + mod_gzip_item_include file \.js$ + mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.* + + + ExpiresActive On + ExpiresDefault "access plus 864000 seconds" + + + Header set Cache-Control "max-age=864000, private" + + + diff --git a/gui/baculum/examples/deb/baculum-lighttpd.conf b/gui/baculum/examples/deb/baculum-lighttpd.conf new file mode 100644 index 0000000000..d676efc536 --- /dev/null +++ b/gui/baculum/examples/deb/baculum-lighttpd.conf @@ -0,0 +1,103 @@ +# Baculum WebGUI tool for Bacula Community +# +# Web Server Configuration +# + +server.port = 9095 +server.username = "www-data" +server.groupname = "www-data" +server.document-root = "/usr/share/baculum/htdocs" +server.errorlog = "/var/log/lighttpd/baculum-error.log" +accesslog.filename = "/var/log/lighttpd/baculum-access.log" +server.pid-file = "/var/run/baculum.pid" + +server.modules = ( + "mod_auth", + "mod_alias", + "mod_rewrite", + "mod_setenv", + "mod_fastcgi", + "mod_access", + "mod_accesslog" +) + +auth.backend = "htpasswd" +auth.backend.htpasswd.userfile = "/usr/share/baculum/htdocs/protected/Data/baculum.users" +auth.require = ( "/" => ( + "method" => "basic", + "realm" => "Baculum Auth", + "require" => "valid-user" + ) +) + +index-file.names = ( "index.php" ) + +static-file.exclude-extensions = ( ".php" ) + +dir-listing.encoding = "utf-8" + +mimetype.assign = ( + ".html" => "text/html", + ".gif" => "image/gif", + ".png" => "image/png", + ".ico" => "image/x-icon", + ".css" => "text/css", + ".js" => "application/javascript" +) + +alias.url = ( + "/" => "/usr/share/baculum/htdocs/" +) + +fastcgi.server = ( + ".php"=> ( + ( + "bin-path"=>"/usr/bin/php-cgi", + "socket"=>"/tmp/php.sock", + "max-procs" => 1, + "bin-environment" => ( + "PHP_FCGI_CHILDREN" => "4", + "PHP_FCGI_MAX_REQUESTS" => "10000" + ), + "bin-copy-environment" => ( + "PATH", + "SHELL", + "USER" + ), + "broken-scriptfilename" => "enable" + ) + ) +) + +url.rewrite-once = ( + "^/themes/(.+)$" => "/themes/$1", + "^/assets/(.+)$" => "/assets/$1", + "^/(.+)$" => "/index.php/$1" +) + +url.access-deny = ( + "^/usr/share/baculum/htdocs/protected/", + "^/usr/share/baculum/htdocs/framework/", + + # Wsat is not used by Baculum. Added here for not storing + # framework Apache specific .htaccess files + "^/usr/share/baculum/htdocs/framework/Wsat/themes/" +) + +### Enable compressing dynamic content ### + +# disable mod_compress when request a php file +$HTTP["url"] !~ "\.php$" { + compress.filetype = ( + "text/plain", + "text/html", + "text/javascript", + "text/css", + "text/xml" + ) +} + +# enable mod_setenv for framework source files: +$HTTP["url"] =~ "^/usr/share/baculum/htdocs/framework/Web/Javascripts/source/" { + setenv.add-response-header = ("Content-Encoding" => "gzip") +} diff --git a/gui/baculum/examples/deb/baculum.lighttpd.conf b/gui/baculum/examples/deb/baculum.lighttpd.conf deleted file mode 100644 index f0e6f980d7..0000000000 --- a/gui/baculum/examples/deb/baculum.lighttpd.conf +++ /dev/null @@ -1,66 +0,0 @@ -# Baculum WebGUI tool for Bacula Community -# -# Web Server Configuration -# - -server.port = 9095 -server.username = "www-data" -server.groupname = "www-data" -server.document-root = "/usr/share/baculum/htdocs" -server.errorlog = "/var/log/baculum/baculum-error.log" -accesslog.filename = "/var/log/baculum/baculum-access.log" -server.pid-file = "/var/run/baculum.pid" - -server.modules = ( - "mod_auth", - "mod_alias", - "mod_rewrite", - "mod_fastcgi", - "mod_accesslog" -) -auth.backend = "htpasswd" -auth.backend.htpasswd.userfile = "/usr/share/baculum/htdocs/protected/Data/baculum.users" -auth.require = ( "/" => ( - "method" => "basic", - "realm" => "Baculum Auth", - "require" => "valid-user" -)) - -index-file.names = ( "index.php" ) - -static-file.exclude-extensions = ( ".php" ) - -dir-listing.encoding = "utf-8" - -mimetype.assign = ( - ".html" => "text/html", - ".gif" => "image/gif", - ".png" => "image/png", - ".ico" => "image/x-icon", - ".css" => "text/css", - ".js" => "application/javascript", -) - -alias.url = ( - "/" => "/usr/share/baculum/htdocs/" -) - -fastcgi.server = (".php"=>(( - "bin-path"=>"/usr/bin/php5-cgi", - "socket"=>"/tmp/php5.sock", - "max-procs" => 1, - "bin-environment" => ( - "PHP_FCGI_CHILDREN" => "4", - "PHP_FCGI_MAX_REQUESTS" => "10000" - ), - "bin-copy-environment" => ( - "PATH", "SHELL", "USER" - ), - "broken-scriptfilename" => "enable" -))) - -url.rewrite-once = ( - "^/themes/(.+)$" => "/themes/$1", - "^/assets/(.+)$" => "/assets/$1", - "^/(.+)$" => "/index.php/$1" -) diff --git a/gui/baculum/examples/deb/baculum.startup b/gui/baculum/examples/deb/baculum.startup new file mode 100755 index 0000000000..27f6fb30fb --- /dev/null +++ b/gui/baculum/examples/deb/baculum.startup @@ -0,0 +1,93 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: baculum +# Required-Start: $local_fs $remote_fs $network $syslog $named +# Required-Stop: $local_fs $remote_fs $network $syslog $named +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Start/stop Baculum +# Description: Start the Baculum WebGUI Bacula Community tool. +# This script uses Lighttpd web server for working Baculum WebGUI tool. +### END INIT INFO + +DESC="Baculum WebGUI Bacula Community tool" +NAME=baculum +SCRIPTNAME=/etc/init.d/$NAME +DAEMON=/usr/sbin/lighttpd +DAEMON_OPTS="-f /etc/baculum/baculum-lighttpd.conf" +PIDFILE="/var/run/$NAME.pid" + +test -x $DAEMON || exit 0 + +check_syntax() +{ + $DAEMON -t $DAEMON_OPTS > /dev/null || exit $? +} + +. /lib/lsb/init-functions + +case "$1" in + start) + check_syntax + log_daemon_msg "Starting $DESC" $NAME + if ! start-stop-daemon --start --oknodo --quiet \ + --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_OPTS + then + log_end_msg 1 + else + log_end_msg 0 + fi + ;; + stop) + log_daemon_msg "Stopping $DESC" $NAME + if start-stop-daemon --stop --retry 30 --oknodo --quiet \ + --pidfile $PIDFILE --exec $DAEMON + then + rm -f $PIDFILE + log_end_msg 0 + else + log_end_msg 1 + fi + ;; + reload|force-reload) + check_syntax + log_daemon_msg "Reloading $DESC configuration" $NAME + if start-stop-daemon --stop --signal INT --quiet \ + --pidfile $PIDFILE --exec $DAEMON + then + rm $PIDFILE + if start-stop-daemon --start --quiet \ + --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_OPTS ; then + log_end_msg 0 + else + log_end_msg 1 + fi + else + log_end_msg 1 + fi + ;; + reopen-logs) + log_daemon_msg "Reopening $DESC logs" $NAME + if start-stop-daemon --stop --signal HUP --oknodo --quiet \ + --pidfile $PIDFILE --exec $DAEMON + then + log_end_msg 0 + else + log_end_msg 1 + fi + ;; + restart) + check_syntax + $0 stop + $0 start + ;; + status) + status_of_proc -p "$PIDFILE" "$DAEMON" lighttpd && exit 0 || exit $? + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload|status}" >&2 + exit 1 + ;; +esac + +exit 0 \ No newline at end of file