blob: 4d68b49767968a108985231feac10f2446fbbc0d [file] [log] [blame]
Sean Daguee263c822014-12-05 14:25:28 -05001#!/bin/bash
2#
zhang-hared98a5d02013-06-21 18:18:02 +08003# lib/apache
4# Functions to control configuration and operation of apache web server
5
6# Dependencies:
Adam Spiers6a5aa7c2013-10-24 11:27:02 +01007#
8# - ``functions`` file
Dean Troyerd8864fe2014-02-17 11:00:42 -06009# - ``STACK_USER`` must be defined
10#
Stephan Renatuse578eff2013-11-19 13:31:04 +010011# lib/apache exports the following functions:
12#
Adam Spiers6a5aa7c2013-10-24 11:27:02 +010013# - install_apache_wsgi
Gabriel Assis Bezerraa688bc62014-05-27 20:58:22 +000014# - apache_site_config_for
Adam Spiers6a5aa7c2013-10-24 11:27:02 +010015# - enable_apache_site
16# - disable_apache_site
17# - start_apache_server
18# - stop_apache_server
19# - restart_apache_server
zhang-hared98a5d02013-06-21 18:18:02 +080020
21# Save trace setting
Ian Wienand523f4882015-10-13 11:03:03 +110022_XTRACE_LIB_APACHE=$(set +o | grep xtrace)
zhang-hared98a5d02013-06-21 18:18:02 +080023set +o xtrace
24
25# Allow overriding the default Apache user and group, default to
26# current user and his default group.
Stephan Renatuse578eff2013-11-19 13:31:04 +010027APACHE_USER=${APACHE_USER:-$STACK_USER}
zhang-hared98a5d02013-06-21 18:18:02 +080028APACHE_GROUP=${APACHE_GROUP:-$(id -gn $APACHE_USER)}
29
Brian Haley7943a922022-03-14 13:53:41 -040030APACHE_LOCAL_HOST=$SERVICE_LOCAL_HOST
31if [[ "$SERVICE_IP_VERSION" == 6 ]]; then
32 APACHE_LOCAL_HOST=[$APACHE_LOCAL_HOST]
33fi
34
zhang-hared98a5d02013-06-21 18:18:02 +080035
36# Set up apache name and configuration directory
Clark Boylancfb9f052016-11-29 10:43:05 -080037# Note that APACHE_CONF_DIR is really more accurately apache's vhost
38# configuration dir but we can't just change this because public interfaces.
zhang-hared98a5d02013-06-21 18:18:02 +080039if is_ubuntu; then
40 APACHE_NAME=apache2
Dean Troyer444a8d52014-06-06 16:36:52 -050041 APACHE_CONF_DIR=${APACHE_CONF_DIR:-/etc/$APACHE_NAME/sites-available}
Clark Boylancfb9f052016-11-29 10:43:05 -080042 APACHE_SETTINGS_DIR=${APACHE_SETTINGS_DIR:-/etc/$APACHE_NAME/conf-enabled}
zhang-hared98a5d02013-06-21 18:18:02 +080043elif is_fedora; then
44 APACHE_NAME=httpd
Dean Troyer444a8d52014-06-06 16:36:52 -050045 APACHE_CONF_DIR=${APACHE_CONF_DIR:-/etc/$APACHE_NAME/conf.d}
Clark Boylancfb9f052016-11-29 10:43:05 -080046 APACHE_SETTINGS_DIR=${APACHE_SETTINGS_DIR:-/etc/$APACHE_NAME/conf.d}
zhang-hared98a5d02013-06-21 18:18:02 +080047fi
Clark Boylan66ce5c22016-10-05 12:11:05 -070048APACHE_LOG_DIR="/var/log/${APACHE_NAME}"
zhang-hared98a5d02013-06-21 18:18:02 +080049
50# Functions
51# ---------
Gregory Haynes4b49e402016-08-31 18:19:51 -070052
53# Enable apache mod and restart apache if it isn't already enabled.
54function enable_apache_mod {
55 local mod=$1
56 # Apache installation, because we mark it NOPRIME
Clark Boylan35649ae2017-05-27 17:52:55 -070057 if is_ubuntu; then
58 # Skip mod_version as it is not a valid mod to enable
59 # on debuntu, instead it is built in.
60 if [[ "$mod" != "version" ]] && ! a2query -m $mod ; then
61 sudo a2enmod $mod
62 restart_apache_server
63 fi
Gregory Haynes4b49e402016-08-31 18:19:51 -070064 elif is_fedora; then
65 # pass
66 true
67 else
68 exit_distro_not_supported "apache enable mod"
69 fi
70}
71
Sean Dague604e5982017-04-13 13:28:12 -040072# NOTE(sdague): Install uwsgi including apache module, we need to get
73# to 2.0.6+ to get a working mod_proxy_uwsgi. We can probably build a
74# check for that and do it differently for different platforms.
75function install_apache_uwsgi {
76 local apxs="apxs2"
77 if is_fedora; then
78 apxs="apxs"
79 fi
80
Ian Wienand2d903562018-05-03 10:51:30 +100081 if is_ubuntu; then
Dr. Jens Harbott34800932020-02-13 09:38:35 +000082 local pkg_list="uwsgi uwsgi-plugin-python3 libapache2-mod-proxy-uwsgi"
Dr. Jens Harbott34800932020-02-13 09:38:35 +000083 install_package ${pkg_list}
Ian Wienand343e3512022-02-03 11:19:08 +110084 # NOTE(ianw) 2022-02-03 : Fedora 35 needs to skip this and fall
85 # into the install-from-source because the upstream packages
86 # didn't fix Python 3.10 compatibility before release. Should be
87 # fixed in uwsgi 4.9.0; can remove this when packages available
88 # or we drop this release
wangxiyuan6440c6d2022-08-05 14:18:13 +080089 elif is_fedora && ! is_openeuler && ! [[ $DISTRO =~ f36 ]]; then
Ian Wienand2d903562018-05-03 10:51:30 +100090 # Note httpd comes with mod_proxy_uwsgi and it is loaded by
91 # default; the mod_proxy_uwsgi package actually conflicts now.
92 # See:
93 # https://bugzilla.redhat.com/show_bug.cgi?id=1574335
94 #
95 # Thus there is nothing else to do after this install
96 install_package uwsgi \
97 uwsgi-plugin-python3
98 else
Federico Ressic2c2b6b2020-06-15 12:48:38 +020099 # Compile uwsgi from source.
Ian Wienand2d903562018-05-03 10:51:30 +1000100 local dir
101 dir=$(mktemp -d)
102 pushd $dir
103 pip_install uwsgi
104 pip download uwsgi -c $REQUIREMENTS_DIR/upper-constraints.txt
105 local uwsgi
106 uwsgi=$(ls uwsgi*)
107 tar xvf $uwsgi
108 cd uwsgi*/apache2
109 sudo $apxs -i -c mod_proxy_uwsgi.c
110 popd
111 # delete the temp directory
112 sudo rm -rf $dir
Ian Wienand2d903562018-05-03 10:51:30 +1000113 fi
Sean Dague604e5982017-04-13 13:28:12 -0400114
Martin Kopecec07b342023-01-24 17:38:45 +0100115 if is_ubuntu; then
Sean Dague604e5982017-04-13 13:28:12 -0400116 # we've got to enable proxy and proxy_uwsgi for this to work
117 sudo a2enmod proxy
118 sudo a2enmod proxy_uwsgi
119 elif is_fedora; then
120 # redhat is missing a nice way to turn on/off modules
121 echo "LoadModule proxy_uwsgi_module modules/mod_proxy_uwsgi.so" \
122 | sudo tee /etc/httpd/conf.modules.d/02-proxy-uwsgi.conf
123 fi
124 restart_apache_server
125}
126
zhang-hared98a5d02013-06-21 18:18:02 +0800127# install_apache_wsgi() - Install Apache server and wsgi module
Ian Wienandaee18c72014-02-21 15:35:08 +1100128function install_apache_wsgi {
zhang-hared98a5d02013-06-21 18:18:02 +0800129 # Apache installation, because we mark it NOPRIME
130 if is_ubuntu; then
131 # Install apache2, which is NOPRIME'd
Davanum Srinivasafa8a002016-12-19 09:51:01 -0500132 install_package apache2
Jens Harbottd7a82f42020-06-23 10:21:09 +0200133 if is_package_installed libapache2-mod-wsgi; then
134 uninstall_package libapache2-mod-wsgi
Davanum Srinivasafa8a002016-12-19 09:51:01 -0500135 fi
Jens Harbottd7a82f42020-06-23 10:21:09 +0200136 install_package libapache2-mod-wsgi-py3
zhang-hared98a5d02013-06-21 18:18:02 +0800137 elif is_fedora; then
138 sudo rm -f /etc/httpd/conf.d/000-*
Hirotaka Wakabayashi1e265082020-07-02 06:19:21 +0000139 install_package httpd python3-mod_wsgi
Ian Wienand41e6e122017-08-08 15:06:26 +1000140 # For consistency with Ubuntu, switch to the worker mpm, as
Attila Fazekas9fd38e72017-12-11 12:20:25 +0100141 # the default is event
Ian Wienand41e6e122017-08-08 15:06:26 +1000142 sudo sed -i '/mod_mpm_prefork.so/s/^/#/g' /etc/httpd/conf.modules.d/00-mpm.conf
Attila Fazekas9fd38e72017-12-11 12:20:25 +0100143 sudo sed -i '/mod_mpm_event.so/s/^/#/g' /etc/httpd/conf.modules.d/00-mpm.conf
Ian Wienand41e6e122017-08-08 15:06:26 +1000144 sudo sed -i '/mod_mpm_worker.so/s/^#//g' /etc/httpd/conf.modules.d/00-mpm.conf
zhang-hared98a5d02013-06-21 18:18:02 +0800145 else
Gregory Haynes4b49e402016-08-31 18:19:51 -0700146 exit_distro_not_supported "apache wsgi installation"
zhang-hared98a5d02013-06-21 18:18:02 +0800147 fi
Gregory Haynes4b49e402016-08-31 18:19:51 -0700148 # WSGI isn't enabled by default, enable it
149 enable_apache_mod wsgi
Morgan Fainbergd074dc72014-06-24 21:33:39 -0700150}
151
Gabriel Assis Bezerraa688bc62014-05-27 20:58:22 +0000152# apache_site_config_for() - The filename of the site's configuration file.
153# This function uses the global variables APACHE_NAME and APACHE_CONF_DIR.
154#
Sean Dague8f8b2742017-04-13 09:34:12 -0400155# On Ubuntu 14.04+, the site configuration file must have a .conf suffix for a2ensite and a2dissite to
Gabriel Assis Bezerraa688bc62014-05-27 20:58:22 +0000156# recognise it. a2ensite and a2dissite ignore the .conf suffix used as parameter. The default sites'
157# files are 000-default.conf and default-ssl.conf.
158#
Martin Kopecec07b342023-01-24 17:38:45 +0100159# On Fedora, any file in /etc/httpd/conf.d/ whose name ends with .conf is enabled.
Gabriel Assis Bezerraa688bc62014-05-27 20:58:22 +0000160#
161# On RHEL and CentOS, things should hopefully work as in Fedora.
162#
163# The table below summarizes what should happen on each distribution:
164# +----------------------+--------------------+--------------------------+--------------------------+
165# | Distribution | File name | Site enabling command | Site disabling command |
166# +----------------------+--------------------+--------------------------+--------------------------+
Gabriel Assis Bezerraa688bc62014-05-27 20:58:22 +0000167# | Ubuntu 14.04 | site.conf | a2ensite site | a2dissite site |
168# | Fedora, RHEL, CentOS | site.conf.disabled | mv site.conf{.disabled,} | mv site.conf{,.disabled} |
169# +----------------------+--------------------+--------------------------+--------------------------+
170function apache_site_config_for {
171 local site=$@
172 if is_ubuntu; then
Sean Dague8f8b2742017-04-13 09:34:12 -0400173 # Ubuntu 14.04 - Apache 2.4
174 echo $APACHE_CONF_DIR/${site}.conf
Martin Kopecec07b342023-01-24 17:38:45 +0100175 elif is_fedora; then
Gabriel Assis Bezerraa688bc62014-05-27 20:58:22 +0000176 # fedora conf.d is only imported if it ends with .conf so this is approx the same
Dean Troyer444a8d52014-06-06 16:36:52 -0500177 local enabled_site_file="$APACHE_CONF_DIR/${site}.conf"
Gabriel Assis Bezerraa688bc62014-05-27 20:58:22 +0000178 if [ -f $enabled_site_file ]; then
179 echo ${enabled_site_file}
180 else
181 echo ${enabled_site_file}.disabled
182 fi
183 fi
184}
185
Jamie Lennox54707012013-09-17 12:07:48 +1000186# enable_apache_site() - Enable a particular apache site
Ian Wienandaee18c72014-02-21 15:35:08 +1100187function enable_apache_site {
Jamie Lennox54707012013-09-17 12:07:48 +1000188 local site=$@
Clark Boylan35649ae2017-05-27 17:52:55 -0700189 # Many of our sites use mod version. Just enable it.
190 enable_apache_mod version
Jamie Lennox54707012013-09-17 12:07:48 +1000191 if is_ubuntu; then
192 sudo a2ensite ${site}
Martin Kopecec07b342023-01-24 17:38:45 +0100193 elif is_fedora; then
Dean Troyer444a8d52014-06-06 16:36:52 -0500194 local enabled_site_file="$APACHE_CONF_DIR/${site}.conf"
195 # Do nothing if site already enabled or no site config exists
196 if [[ -f ${enabled_site_file}.disabled ]] && [[ ! -f ${enabled_site_file} ]]; then
197 sudo mv ${enabled_site_file}.disabled ${enabled_site_file}
198 fi
Jamie Lennox54707012013-09-17 12:07:48 +1000199 fi
200}
201
202# disable_apache_site() - Disable a particular apache site
Ian Wienandaee18c72014-02-21 15:35:08 +1100203function disable_apache_site {
Jamie Lennox54707012013-09-17 12:07:48 +1000204 local site=$@
205 if is_ubuntu; then
Chris Dent2fcdaac2017-04-18 16:54:12 +0100206 sudo a2dissite ${site} || true
Martin Kopecec07b342023-01-24 17:38:45 +0100207 elif is_fedora; then
Dean Troyer444a8d52014-06-06 16:36:52 -0500208 local enabled_site_file="$APACHE_CONF_DIR/${site}.conf"
209 # Do nothing if no site config exists
210 if [[ -f ${enabled_site_file} ]]; then
211 sudo mv ${enabled_site_file} ${enabled_site_file}.disabled
212 fi
Jamie Lennox54707012013-09-17 12:07:48 +1000213 fi
214}
215
zhang-hared98a5d02013-06-21 18:18:02 +0800216# start_apache_server() - Start running apache server
Ian Wienandaee18c72014-02-21 15:35:08 +1100217function start_apache_server {
zhang-hared98a5d02013-06-21 18:18:02 +0800218 start_service $APACHE_NAME
219}
220
221# stop_apache_server() - Stop running apache server
Ian Wienandaee18c72014-02-21 15:35:08 +1100222function stop_apache_server {
zhang-hared98a5d02013-06-21 18:18:02 +0800223 if [ -n "$APACHE_NAME" ]; then
224 stop_service $APACHE_NAME
225 else
226 exit_distro_not_supported "apache configuration"
227 fi
228}
229
230# restart_apache_server
Ian Wienandaee18c72014-02-21 15:35:08 +1100231function restart_apache_server {
Morgan Fainberg2df00462014-07-15 11:06:36 -0700232 # Apache can be slow to stop, doing an explicit stop, sleep, start helps
233 # to mitigate issues where apache will claim a port it's listening on is
234 # still in use and fail to start.
Sean Dague2b85cf02017-04-13 09:02:14 -0400235 restart_service $APACHE_NAME
zhang-hared98a5d02013-06-21 18:18:02 +0800236}
237
Sean Dague2f8c88e2017-04-13 09:08:39 -0400238function write_uwsgi_config {
239 local file=$1
240 local wsgi=$2
241 local url=$3
242 local http=$4
243 local name=""
244 name=$(basename $wsgi)
rabiaa26baa2017-04-20 10:55:16 +0530245
246 # create a home for the sockets; note don't use /tmp -- apache has
247 # a private view of it on some platforms.
248 local socket_dir='/var/run/uwsgi'
Kirill Zaitsevd0db62a2017-05-26 19:02:52 +0300249
250 # /var/run will be empty on ubuntu after reboot, so we can use systemd-temptiles
251 # to automatically create $socket_dir.
252 sudo mkdir -p /etc/tmpfiles.d/
253 echo "d $socket_dir 0755 $STACK_USER root" | sudo tee /etc/tmpfiles.d/uwsgi.conf
254 sudo systemd-tmpfiles --create /etc/tmpfiles.d/uwsgi.conf
255
rabiaa26baa2017-04-20 10:55:16 +0530256 local socket="$socket_dir/${name}.socket"
Sean Dague2f8c88e2017-04-13 09:08:39 -0400257
258 # always cleanup given that we are using iniset here
259 rm -rf $file
260 iniset "$file" uwsgi wsgi-file "$wsgi"
Sean Dague2f8c88e2017-04-13 09:08:39 -0400261 iniset "$file" uwsgi processes $API_WORKERS
262 # This is running standalone
263 iniset "$file" uwsgi master true
264 # Set die-on-term & exit-on-reload so that uwsgi shuts down
265 iniset "$file" uwsgi die-on-term true
Dinesh Bhoref60f2b2017-09-05 14:40:32 +0530266 iniset "$file" uwsgi exit-on-reload false
Matthew Treinish477a9622017-08-04 11:09:26 -0400267 # Set worker-reload-mercy so that worker will not exit till the time
268 # configured after graceful shutdown
269 iniset "$file" uwsgi worker-reload-mercy $WORKER_TIMEOUT
Sean Dague2f8c88e2017-04-13 09:08:39 -0400270 iniset "$file" uwsgi enable-threads true
Kevin Zhao7880ba62021-03-31 04:58:28 +0000271 iniset "$file" uwsgi plugins http,python3
Sean Dague2f8c88e2017-04-13 09:08:39 -0400272 # uwsgi recommends this to prevent thundering herd on accept.
273 iniset "$file" uwsgi thunder-lock true
Matthew Treinish477a9622017-08-04 11:09:26 -0400274 # Set hook to trigger graceful shutdown on SIGTERM
275 iniset "$file" uwsgi hook-master-start "unix_signal:15 gracefully_kill_them_all"
Sean Dague2f8c88e2017-04-13 09:08:39 -0400276 # Override the default size for headers from the 4k default.
277 iniset "$file" uwsgi buffer-size 65535
278 # Make sure the client doesn't try to re-use the connection.
279 iniset "$file" uwsgi add-header "Connection: close"
280 # This ensures that file descriptors aren't shared between processes.
281 iniset "$file" uwsgi lazy-apps true
Sean Dague2f8c88e2017-04-13 09:08:39 -0400282
283 # If we said bind directly to http, then do that and don't start the apache proxy
284 if [[ -n "$http" ]]; then
285 iniset "$file" uwsgi http $http
286 else
287 local apache_conf=""
288 apache_conf=$(apache_site_config_for $name)
Chris Dentb90bb1a2017-04-18 16:30:14 +0000289 iniset "$file" uwsgi socket "$socket"
290 iniset "$file" uwsgi chmod-socket 666
Jens Harbott56e75e42021-09-28 20:02:34 +0200291 echo "ProxyPass \"${url}\" \"unix:${socket}|uwsgi://uwsgi-uds-${name}\" retry=0 " | sudo tee -a $apache_conf
Sean Dague2f8c88e2017-04-13 09:08:39 -0400292 enable_apache_site $name
Ian Wienandf6a2d2c2017-04-26 10:50:29 +1000293 restart_apache_server
Sean Dague2f8c88e2017-04-13 09:08:39 -0400294 fi
295}
296
Matthew Treinish1fa65362017-06-23 22:32:37 +0000297# For services using chunked encoding, the only services known to use this
298# currently are Glance and Swift, we need to use an http proxy instead of
299# mod_proxy_uwsgi because the chunked encoding gets dropped. See:
300# https://github.com/unbit/uwsgi/issues/1540 You can workaround this on python2
301# but that involves having apache buffer the request before sending it to
Jeremy Liu2f7df512017-07-12 10:09:48 +0800302# uwsgi.
Matthew Treinish1fa65362017-06-23 22:32:37 +0000303function write_local_uwsgi_http_config {
304 local file=$1
305 local wsgi=$2
306 local url=$3
307 name=$(basename $wsgi)
308
309 # create a home for the sockets; note don't use /tmp -- apache has
310 # a private view of it on some platforms.
311
312 # always cleanup given that we are using iniset here
313 rm -rf $file
314 iniset "$file" uwsgi wsgi-file "$wsgi"
315 port=$(get_random_port)
Brian Haley7943a922022-03-14 13:53:41 -0400316 iniset "$file" uwsgi http-socket "$APACHE_LOCAL_HOST:$port"
Matthew Treinish1fa65362017-06-23 22:32:37 +0000317 iniset "$file" uwsgi processes $API_WORKERS
318 # This is running standalone
319 iniset "$file" uwsgi master true
320 # Set die-on-term & exit-on-reload so that uwsgi shuts down
321 iniset "$file" uwsgi die-on-term true
Dinesh Bhoref60f2b2017-09-05 14:40:32 +0530322 iniset "$file" uwsgi exit-on-reload false
Matthew Treinish1fa65362017-06-23 22:32:37 +0000323 iniset "$file" uwsgi enable-threads true
Kevin Zhao7880ba62021-03-31 04:58:28 +0000324 iniset "$file" uwsgi plugins http,python3
Matthew Treinish1fa65362017-06-23 22:32:37 +0000325 # uwsgi recommends this to prevent thundering herd on accept.
326 iniset "$file" uwsgi thunder-lock true
Matthew Treinish477a9622017-08-04 11:09:26 -0400327 # Set hook to trigger graceful shutdown on SIGTERM
328 iniset "$file" uwsgi hook-master-start "unix_signal:15 gracefully_kill_them_all"
329 # Set worker-reload-mercy so that worker will not exit till the time
330 # configured after graceful shutdown
331 iniset "$file" uwsgi worker-reload-mercy $WORKER_TIMEOUT
Matthew Treinish1fa65362017-06-23 22:32:37 +0000332 # Override the default size for headers from the 4k default.
333 iniset "$file" uwsgi buffer-size 65535
334 # Make sure the client doesn't try to re-use the connection.
335 iniset "$file" uwsgi add-header "Connection: close"
336 # This ensures that file descriptors aren't shared between processes.
337 iniset "$file" uwsgi lazy-apps true
338 iniset "$file" uwsgi chmod-socket 666
339 iniset "$file" uwsgi http-raw-body true
340 iniset "$file" uwsgi http-chunked-input true
341 iniset "$file" uwsgi http-auto-chunked true
Matthew Treinish82d06102017-06-28 17:42:31 -0400342 iniset "$file" uwsgi http-keepalive false
Matthew Treinishb79531a2017-06-30 12:10:06 -0400343 # Increase socket timeout for slow chunked uploads
344 iniset "$file" uwsgi socket-timeout 30
Matthew Treinish1fa65362017-06-23 22:32:37 +0000345
346 enable_apache_mod proxy
347 enable_apache_mod proxy_http
348 local apache_conf=""
349 apache_conf=$(apache_site_config_for $name)
350 echo "KeepAlive Off" | sudo tee $apache_conf
Matthew Treinisha3488d52017-08-10 14:55:15 -0400351 echo "SetEnv proxy-sendchunked 1" | sudo tee -a $apache_conf
Brian Haley7943a922022-03-14 13:53:41 -0400352 echo "ProxyPass \"${url}\" \"http://$APACHE_LOCAL_HOST:$port\" retry=0 " | sudo tee -a $apache_conf
Matthew Treinish1fa65362017-06-23 22:32:37 +0000353 enable_apache_site $name
354 restart_apache_server
355}
356
Dan Smith09eea0b2020-07-09 08:31:51 -0700357# Write a straight-through proxy for a service that runs locally and just needs
358# to be reachable via the main http proxy at $loc
359function write_local_proxy_http_config {
360 local name=$1
361 local url=$2
362 local loc=$3
363 local apache_conf
364 apache_conf=$(apache_site_config_for $name)
365
366 enable_apache_mod proxy
367 enable_apache_mod proxy_http
368
369 echo "KeepAlive Off" | sudo tee $apache_conf
370 echo "SetEnv proxy-sendchunked 1" | sudo tee -a $apache_conf
371 echo "ProxyPass \"${loc}\" \"$url\" retry=0 " | sudo tee -a $apache_conf
372 enable_apache_site $name
373 restart_apache_server
374}
375
Sean Dague2f8c88e2017-04-13 09:08:39 -0400376function remove_uwsgi_config {
377 local file=$1
378 local wsgi=$2
379 local name=""
380 name=$(basename $wsgi)
381
382 rm -rf $file
383 disable_apache_site $name
384}
385
zhang-hared98a5d02013-06-21 18:18:02 +0800386# Restore xtrace
Ian Wienand523f4882015-10-13 11:03:03 +1100387$_XTRACE_LIB_APACHE
zhang-hared98a5d02013-06-21 18:18:02 +0800388
Adam Spiers6a5aa7c2013-10-24 11:27:02 +0100389# Tell emacs to use shell-script-mode
390## Local variables:
391## mode: shell-script
392## End: