summaryrefslogtreecommitdiff
path: root/lib/swift
diff options
context:
space:
mode:
Diffstat (limited to 'lib/swift')
-rw-r--r--lib/swift16
1 files changed, 6 insertions, 10 deletions
diff --git a/lib/swift b/lib/swift
index 8741e55..9c80802 100644
--- a/lib/swift
+++ b/lib/swift
@@ -115,11 +115,11 @@ function cleanup_swift() {
115# _cleanup_swift_apache_wsgi() - Remove wsgi files, disable and remove apache vhost file 115# _cleanup_swift_apache_wsgi() - Remove wsgi files, disable and remove apache vhost file
116function _cleanup_swift_apache_wsgi() { 116function _cleanup_swift_apache_wsgi() {
117 sudo rm -f $SWIFT_APACHE_WSGI_DIR/*.wsgi 117 sudo rm -f $SWIFT_APACHE_WSGI_DIR/*.wsgi
118 ! is_fedora && sudo a2dissite proxy-server 118 disable_apache_site proxy-server
119 for node_number in ${SWIFT_REPLICAS_SEQ}; do 119 for node_number in ${SWIFT_REPLICAS_SEQ}; do
120 for type in object container account; do 120 for type in object container account; do
121 site_name=${type}-server-${node_number} 121 site_name=${type}-server-${node_number}
122 ! is_fedora && sudo a2dissite ${site_name} 122 disable_apache_site ${site_name}
123 sudo rm -f /etc/$APACHE_NAME/$APACHE_CONF_DIR/${site_name} 123 sudo rm -f /etc/$APACHE_NAME/$APACHE_CONF_DIR/${site_name}
124 done 124 done
125 done 125 done
@@ -140,13 +140,13 @@ function _config_swift_apache_wsgi() {
140 s/%APACHE_NAME%/${APACHE_NAME}/g; 140 s/%APACHE_NAME%/${APACHE_NAME}/g;
141 s/%USER%/${STACK_USER}/g; 141 s/%USER%/${STACK_USER}/g;
142 " -i ${apache_vhost_dir}/proxy-server 142 " -i ${apache_vhost_dir}/proxy-server
143 enable_apache_site proxy-server
143 144
144 sudo cp ${SWIFT_DIR}/examples/wsgi/proxy-server.wsgi.template ${SWIFT_APACHE_WSGI_DIR}/proxy-server.wsgi 145 sudo cp ${SWIFT_DIR}/examples/wsgi/proxy-server.wsgi.template ${SWIFT_APACHE_WSGI_DIR}/proxy-server.wsgi
145 sudo sed -e " 146 sudo sed -e "
146 /^#/d;/^$/d; 147 /^#/d;/^$/d;
147 s/%SERVICECONF%/proxy-server.conf/g; 148 s/%SERVICECONF%/proxy-server.conf/g;
148 " -i ${SWIFT_APACHE_WSGI_DIR}/proxy-server.wsgi 149 " -i ${SWIFT_APACHE_WSGI_DIR}/proxy-server.wsgi
149 ! is_fedora && sudo a2ensite proxy-server
150 150
151 # copy apache vhost file and set name and port 151 # copy apache vhost file and set name and port
152 for node_number in ${SWIFT_REPLICAS_SEQ}; do 152 for node_number in ${SWIFT_REPLICAS_SEQ}; do
@@ -161,7 +161,7 @@ function _config_swift_apache_wsgi() {
161 s/%APACHE_NAME%/${APACHE_NAME}/g; 161 s/%APACHE_NAME%/${APACHE_NAME}/g;
162 s/%USER%/${STACK_USER}/g; 162 s/%USER%/${STACK_USER}/g;
163 " -i ${apache_vhost_dir}/object-server-${node_number} 163 " -i ${apache_vhost_dir}/object-server-${node_number}
164 ! is_fedora && sudo a2ensite object-server-${node_number} 164 enable_apache_site object-server-${node_number}
165 165
166 sudo cp ${SWIFT_DIR}/examples/wsgi/object-server.wsgi.template ${SWIFT_APACHE_WSGI_DIR}/object-server-${node_number}.wsgi 166 sudo cp ${SWIFT_DIR}/examples/wsgi/object-server.wsgi.template ${SWIFT_APACHE_WSGI_DIR}/object-server-${node_number}.wsgi
167 sudo sed -e " 167 sudo sed -e "
@@ -177,7 +177,7 @@ function _config_swift_apache_wsgi() {
177 s/%APACHE_NAME%/${APACHE_NAME}/g; 177 s/%APACHE_NAME%/${APACHE_NAME}/g;
178 s/%USER%/${STACK_USER}/g; 178 s/%USER%/${STACK_USER}/g;
179 " -i ${apache_vhost_dir}/container-server-${node_number} 179 " -i ${apache_vhost_dir}/container-server-${node_number}
180 ! is_fedora && sudo a2ensite container-server-${node_number} 180 enable_apache_site container-server-${node_number}
181 181
182 sudo cp ${SWIFT_DIR}/examples/wsgi/container-server.wsgi.template ${SWIFT_APACHE_WSGI_DIR}/container-server-${node_number}.wsgi 182 sudo cp ${SWIFT_DIR}/examples/wsgi/container-server.wsgi.template ${SWIFT_APACHE_WSGI_DIR}/container-server-${node_number}.wsgi
183 sudo sed -e " 183 sudo sed -e "
@@ -193,18 +193,14 @@ function _config_swift_apache_wsgi() {
193 s/%APACHE_NAME%/${APACHE_NAME}/g; 193 s/%APACHE_NAME%/${APACHE_NAME}/g;
194 s/%USER%/${STACK_USER}/g; 194 s/%USER%/${STACK_USER}/g;
195 " -i ${apache_vhost_dir}/account-server-${node_number} 195 " -i ${apache_vhost_dir}/account-server-${node_number}
196 ! is_fedora && sudo a2ensite account-server-${node_number} 196 enable_apache_site account-server-${node_number}
197 197
198 sudo cp ${SWIFT_DIR}/examples/wsgi/account-server.wsgi.template ${SWIFT_APACHE_WSGI_DIR}/account-server-${node_number}.wsgi 198 sudo cp ${SWIFT_DIR}/examples/wsgi/account-server.wsgi.template ${SWIFT_APACHE_WSGI_DIR}/account-server-${node_number}.wsgi
199 sudo sed -e " 199 sudo sed -e "
200 /^#/d;/^$/d; 200 /^#/d;/^$/d;
201 s/%SERVICECONF%/account-server\/${node_number}.conf/g; 201 s/%SERVICECONF%/account-server\/${node_number}.conf/g;
202 " -i ${SWIFT_APACHE_WSGI_DIR}/account-server-${node_number}.wsgi 202 " -i ${SWIFT_APACHE_WSGI_DIR}/account-server-${node_number}.wsgi
203
204 done 203 done
205
206 # WSGI isn't enabled by default, enable it
207 ! is_fedora && sudo a2enmod wsgi
208} 204}
209 205
210# configure_swift() - Set config files, create data dirs and loop image 206# configure_swift() - Set config files, create data dirs and loop image