diff options
author | Prashanth Pai <ppai@redhat.com> | 2013-10-21 15:05:33 +0530 |
---|---|---|
committer | Luis Pabon <lpabon@redhat.com> | 2013-10-23 18:54:17 -0700 |
commit | ade571006d145b0ade2094a1840b67927a18d6d5 (patch) | |
tree | fe05a1bbf7a4f6d12d4ab076a1414bc3769c0d32 /extras/apache-deploy/install.sh | |
parent | 11e2be75faa5af4f5c724c61447559693cd05b7f (diff) |
Deploy Apache as web front-end for gluster-swift
Swift can alternatively be configured to work as a request processor of
Apache server. This alternative deployment scenario uses mod_wsgi of
Apache to forward requests to the swift wsgi application and middleware.
'client' <---> 'Apache2+mod_wsgi' <---> 'middleware' <---> 'core swift'
Change-Id: If396dcbdf651af0dce55b951cd2eaadc6783384f
Signed-off-by: Prashanth Pai <ppai@redhat.com>
Reviewed-on: http://review.gluster.org/6116
Reviewed-by: Luis Pabon <lpabon@redhat.com>
Tested-by: Luis Pabon <lpabon@redhat.com>
Diffstat (limited to 'extras/apache-deploy/install.sh')
-rwxr-xr-x | extras/apache-deploy/install.sh | 44 |
1 files changed, 44 insertions, 0 deletions
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" |