summaryrefslogtreecommitdiffstats
path: root/extras/apache-deploy/install.sh
blob: aa24250b831bc8d8c7d6dd080d69488468e1f28d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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"