]> git.sur5r.net Git - bacula/bacula/commitdiff
baculum: Add example Nginx config
authorMarcin Haba <marcin.haba@bacula.pl>
Sun, 13 Dec 2015 17:10:05 +0000 (18:10 +0100)
committerMarcin Haba <marcin.haba@bacula.pl>
Sun, 13 Dec 2015 17:11:23 +0000 (18:11 +0100)
gui/baculum/INSTALL
gui/baculum/examples/nginx/baculum.conf [new file with mode: 0644]
gui/baculum/examples/nginx/php-fpm/baculum-php.conf [new file with mode: 0644]
gui/baculum/examples/sudo/baculum-nginx [new file with mode: 0644]

index 46f665d4493d68a7128f6eaa71866ea54b003987..4a9a1f58a6745a980cf3d5ab853606ba513a9468 100644 (file)
@@ -237,8 +237,15 @@ In directory examples/ exists following configuration samples:
  ./examples/selinux/baculum.te                       <--- SELinux text module format
  ./examples/selinux/baculum.pp                       <--- SELinux binary module format
  ./examples/deb/                                     <=== samples for some deb-based distributions
+ ./examples/deb/baculum.startup                      <--- Baculum SysVinit startup script
  ./examples/deb/baculum.lighttpd.conf                <--- sample Lighttpd config
  ./examples/deb/baculum.users                        <--- sample HTTP Basic auth file (user: admin, pass: admin)
+ ./examples/deb/baculum-apache.conf                  <--- sample Apache config
+ ./examples/deb-template                             <=== Directory with templates used by Makefile
+ ./examples/deb-template/baculum.users               <--- sample HTTP Basic auth file (user: admin, pass: admin)
+ ./examples/deb-template/baculum-lighttpd.conf       <--- Lighttpd config template
+ ./examples/deb-template/baculum-lighttpd.service    <--- Baculum systemd unit for Lighttpd
+ ./examples/deb-template/baculum-apache.conf         <--- Apache config template
  ./examples/rpm-template/                            <=== Directory with templates used by Makefile
  ./examples/rpm-template/baculum-apache.conf         <--- Apache config template
  ./examples/rpm-template/baculum-lighttpd.service    <--- Baculum systemd unit for Lighttpd
@@ -248,7 +255,8 @@ In directory examples/ exists following configuration samples:
  ./examples/rpm-template/baculum.startup             <--- Baculum SysVinit startup script
  ./examples/sudo/                                    <=== example sudoers.d configurations
  ./examples/sudo/baculum-httpd                       <--- sample sudo for Apache user
- ./examples/sudo/baculum-lighttpd                    <--- sample sudo for Lighttpd
+ ./examples/sudo/baculum-lighttpd                    <--- sample sudo for Lighttpd user
+ ./examples/sudo/baculum-nginx                       <--- sample sudo for Nginx user
  ./examples/rpm/                                     <=== samples for some rpm-based distributions
  ./examples/rpm/baculum-apache.conf                  <--- Apache config file
  ./examples/rpm/baculum-lighttpd.service             <--- Baculum system unit
@@ -256,6 +264,9 @@ In directory examples/ exists following configuration samples:
  ./examples/rpm/baculum-lighttpd.conf                <--- Lighttpd config file
  ./examples/rpm/baculum.users                        <--- HTTP Basic auth file (user: admin, pass: admin)
  ./examples/rpm/baculum.startup                      <--- Baculum SysVinit startup script
+ ./examples/nginx/                                   <=== example Nginx configurations
+ ./examples/nginx/php-fpm/baculum-php.conf           <--- example PHP-FPM config for Nginx
+ ./examples/nginx/baculum.conf                       <--- sample Nginx config
 
 
 7 Makefile
diff --git a/gui/baculum/examples/nginx/baculum.conf b/gui/baculum/examples/nginx/baculum.conf
new file mode 100644 (file)
index 0000000..51d5cab
--- /dev/null
@@ -0,0 +1,42 @@
+upstream baculum-php {
+        server unix:/run/php-fpm/baculum-php.sock;
+}
+
+server {
+    listen 9095;
+    server_name localhost;
+    root /usr/share/baculum/htdocs;
+    index index.php;
+    charset utf-8;
+    set $baculum_index "index.php";
+
+    location / {
+        auth_basic "Baculum Auth";
+        auth_basic_user_file /usr/share/baculum/htdocs/protected/Data/baculum.users;
+        index $baculum_index;
+        try_files $uri $uri/ $baculum_index?$args;
+        rewrite ^/(.+)$ /index.php/$1 last;
+    }
+
+    location ~ ^/(protected|framework) {
+        deny  all;
+    }
+
+    location ~ \.(js|css|png|jpg|gif|ico)$ {
+        try_files $uri = 404;
+    }
+
+    location ~ \.php {
+        fastcgi_split_path_info  ^(.+\.php)(.*)$;
+        set $furi /$baculum_index;
+        if (-f $document_root$fastcgi_script_name){
+            set $furi $fastcgi_script_name;
+        }
+        fastcgi_param SCRIPT_FILENAME  $document_root$furi;
+        fastcgi_param SERVER_NAME      $host;
+        fastcgi_param PATH_INFO        $fastcgi_path_info;
+        fastcgi_param PATH_TRANSLATED  $document_root$furi;
+        fastcgi_pass baculum-php;
+        include fastcgi_params;
+    }
+}
\ No newline at end of file
diff --git a/gui/baculum/examples/nginx/php-fpm/baculum-php.conf b/gui/baculum/examples/nginx/php-fpm/baculum-php.conf
new file mode 100644 (file)
index 0000000..31b19c6
--- /dev/null
@@ -0,0 +1,18 @@
+[baculum-php]
+listen = /var/run/php-fpm/baculum-php.sock
+listen.owner = nginx
+listen.group = nginx
+listen.mode = 0666
+
+listen.backlog = -1
+listen.allowed_clients = 127.0.0.1
+
+user = nginx
+group = nginx
+
+pm = dynamic
+pm.max_children = 5
+pm.start_servers = 2
+pm.min_spare_servers = 1
+pm.max_spare_servers = 3
+pm.max_requests = 500
diff --git a/gui/baculum/examples/sudo/baculum-nginx b/gui/baculum/examples/sudo/baculum-nginx
new file mode 100644 (file)
index 0000000..c7cb882
--- /dev/null
@@ -0,0 +1,2 @@
+Defaults:nginx !requiretty
+nginx  ALL= NOPASSWD:  /usr/sbin/bconsole