summaryrefslogtreecommitdiffstats
path: root/extras
diff options
context:
space:
mode:
Diffstat (limited to 'extras')
-rw-r--r--extras/apache-deploy/conf/account-server.wsgi3
-rw-r--r--extras/apache-deploy/conf/container-server.wsgi3
-rw-r--r--extras/apache-deploy/conf/object-server.wsgi3
-rw-r--r--extras/apache-deploy/conf/proxy-server.wsgi3
-rw-r--r--extras/apache-deploy/conf/swift_wsgi.conf54
-rwxr-xr-xextras/apache-deploy/install.sh44
-rwxr-xr-xextras/apache-deploy/uninstall.sh19
7 files changed, 129 insertions, 0 deletions
diff --git a/extras/apache-deploy/conf/account-server.wsgi b/extras/apache-deploy/conf/account-server.wsgi
new file mode 100644
index 0000000..10a22b9
--- /dev/null
+++ b/extras/apache-deploy/conf/account-server.wsgi
@@ -0,0 +1,3 @@
+from swift.common.wsgi import init_request_processor
+application, conf, logger, log_name = \
+ init_request_processor('/etc/swift/account-server.conf','account-server')
diff --git a/extras/apache-deploy/conf/container-server.wsgi b/extras/apache-deploy/conf/container-server.wsgi
new file mode 100644
index 0000000..9f3a1b5
--- /dev/null
+++ b/extras/apache-deploy/conf/container-server.wsgi
@@ -0,0 +1,3 @@
+from swift.common.wsgi import init_request_processor
+application, conf, logger, log_name = \
+ init_request_processor('/etc/swift/container-server.conf','container-server')
diff --git a/extras/apache-deploy/conf/object-server.wsgi b/extras/apache-deploy/conf/object-server.wsgi
new file mode 100644
index 0000000..7ea74a5
--- /dev/null
+++ b/extras/apache-deploy/conf/object-server.wsgi
@@ -0,0 +1,3 @@
+from swift.common.wsgi import init_request_processor
+application, conf, logger, log_name = \
+ init_request_processor('/etc/swift/object-server.conf','object-server')
diff --git a/extras/apache-deploy/conf/proxy-server.wsgi b/extras/apache-deploy/conf/proxy-server.wsgi
new file mode 100644
index 0000000..598aaaa
--- /dev/null
+++ b/extras/apache-deploy/conf/proxy-server.wsgi
@@ -0,0 +1,3 @@
+from swift.common.wsgi import init_request_processor
+application, conf, logger, log_name = \
+ init_request_processor('/etc/swift/proxy-server.conf','proxy-server')
diff --git a/extras/apache-deploy/conf/swift_wsgi.conf b/extras/apache-deploy/conf/swift_wsgi.conf
new file mode 100644
index 0000000..16e8169
--- /dev/null
+++ b/extras/apache-deploy/conf/swift_wsgi.conf
@@ -0,0 +1,54 @@
+WSGISocketPrefix /var/run/wsgi
+
+#Proxy Service
+Listen 8080
+<VirtualHost *:8080>
+ ServerName proxy-server
+ LimitRequestBody 5368709122
+ WSGIDaemonProcess proxy-server processes=5 threads=1 user=swift
+ WSGIProcessGroup proxy-server
+ WSGIScriptAlias / /var/www/swift/proxy-server.wsgi
+ LimitRequestFields 200
+ ErrorLog /var/log/httpd/proxy-server.log
+ LogLevel debug
+ CustomLog /var/log/httpd/proxy.log combined
+</VirtualHost>
+
+#Object Service
+Listen 6010
+<VirtualHost *:6010>
+ ServerName object-server
+ WSGIDaemonProcess object-server processes=5 threads=1 user=swift
+ WSGIProcessGroup object-server
+ WSGIScriptAlias / /var/www/swift/object-server.wsgi
+ LimitRequestFields 200
+ ErrorLog /var/log/httpd/object-server.log
+ LogLevel debug
+ CustomLog /var/log/httpd/access.log combined
+</VirtualHost>
+
+#Container Service
+Listen 6011
+<VirtualHost *:6011>
+ ServerName container-server
+ WSGIDaemonProcess container-server processes=5 threads=1 user=swift
+ WSGIProcessGroup container-server
+ WSGIScriptAlias / /var/www/swift/container-server.wsgi
+ LimitRequestFields 200
+ ErrorLog /var/log/httpd/container-server.log
+ LogLevel debug
+ CustomLog /var/log/httpd/access.log combined
+</VirtualHost>
+
+#Account Service
+Listen 6012
+<VirtualHost *:6012>
+ ServerName account-server
+ WSGIDaemonProcess account-server processes=5 threads=1 user=swift
+ WSGIProcessGroup account-server
+ WSGIScriptAlias / /var/www/swift/account-server.wsgi
+ LimitRequestFields 200
+ ErrorLog /var/log/httpd/account-server.log
+ LogLevel debug
+ CustomLog /var/log/httpd/access.log combined
+</VirtualHost>
diff --git a/extras/apache-deploy/install.sh b/extras/apache-deploy/install.sh
new file mode 100755
index 0000000..aa24250
--- /dev/null
+++ b/extras/apache-deploy/install.sh
@@ -0,0 +1,44 @@
+#!/bin/sh -x
+
+# For Fedora/RHEL ONLY
+
+if [ $EUID -ne 0 ]; then
+ echo "This script must be run as root"
+ exit 1
+fi
+
+# Stop Apache and Swift services if running
+swift-init main stop
+service httpd stop
+
+# Install Apache and mod_wsgi
+yum install httpd mod_wsgi
+
+# Create a directory for Apache wsgi files
+mkdir -p /var/www/swift
+
+# Create a directory for swift which it'll use as home
+mkdir -p /var/lib/swift
+
+# Copy wsgi files for each of the four swift services
+cp ./conf/*wsgi /var/www/swift/
+
+# Copy swift httpd config file
+cp ./conf/swift_wsgi.conf /etc/httpd/conf.d/
+
+# Change owner of conf files to swift
+chown swift:swift /etc/swift/*
+
+# Check if SElinux is set to permissive/disabled
+selinux_mode=$(getenforce)
+if [ $selinux_mode == "Enforcing" ]; then
+ echo "SElinux is set to Enforcing. Change it to Permissive or Disabled \
+by editing /etc/sysconfig/selinux"
+ echo "You will need to reboot your system for the changed value to take \
+effect."
+ exit 1
+fi
+
+echo "Successfully configured Apache as frontend for Swift."
+echo "Make sure GlusterFS volume is mounted at /mnt/gluster-object/<vol-name> \
+before starting httpd"
diff --git a/extras/apache-deploy/uninstall.sh b/extras/apache-deploy/uninstall.sh
new file mode 100755
index 0000000..e5841bc
--- /dev/null
+++ b/extras/apache-deploy/uninstall.sh
@@ -0,0 +1,19 @@
+#!/bin/sh -x
+
+# For Fedora/RHEL ONLY
+
+if [ $EUID -ne 0 ]; then
+ echo "This script must be run as root"
+ exit 1
+fi
+
+# Stop Apache service
+service httpd stop
+
+# Remove swift wsgi files
+rm -rf /var/www/swift
+
+# Remove swift httpd config file
+rm -f /etc/httpd/conf.d/swift_wsgi.conf
+
+echo -e "DONE.\nYou can now restart Swift."