diff --git a/actions/deluge b/actions/deluge
index 9cf391291..46dc4b248 100755
--- a/actions/deluge
+++ b/actions/deluge
@@ -26,19 +26,7 @@ import os
import subprocess
-APACHE_CONF_PATH = '/etc/apache2/conf-available/deluge-web.conf'
-APACHE_CONF_ENABLED_PATH = '/etc/apache2/conf-enabled/deluge-web.conf'
-APACHE_CONF = '''
-##
-## On all sites, provide Deluge on a default path: /deluge
-##
-## This file is managed and overwritten by Plinth. If you wish to edit
-## it, disable Deluge in Plinth, remove this file and manage it manually.
-##
-
- ProxyPass http://localhost:8112
-
-'''
+APACHE_CONF_ENABLED_PATH = '/etc/apache2/conf-enabled/deluge-plinth.conf'
SYSTEMD_SERVICE_PATH = '/etc/systemd/system/deluge-web.service'
SYSTEMD_SERVICE = '''
@@ -98,13 +86,13 @@ def subcommand_enable(_):
setup()
start()
- subprocess.check_call(['a2enconf', 'deluge-web'])
+ subprocess.check_call(['a2enconf', 'deluge-plinth'])
subprocess.check_call(['service', 'apache2', 'reload'])
def subcommand_disable(_):
"""Disable deluge-web site and stop deluge-web."""
- subprocess.check_call(['a2disconf', 'deluge-web'])
+ subprocess.check_call(['a2disconf', 'deluge-plinth'])
subprocess.check_call(['service', 'apache2', 'reload'])
stop()
@@ -140,11 +128,7 @@ def stop():
def setup():
- """Perform initial setup for deluge-web site."""
- if not os.path.isfile(APACHE_CONF_PATH):
- with open(APACHE_CONF_PATH, 'w') as conffile:
- conffile.write(APACHE_CONF)
-
+ """Perform initial setup for deluge-web."""
if not os.path.isfile(SYSTEMD_SERVICE_PATH):
with open(SYSTEMD_SERVICE_PATH, 'w') as file_handle:
file_handle.write(SYSTEMD_SERVICE)
diff --git a/data/etc/apache2/conf-available/deluge-plinth.conf b/data/etc/apache2/conf-available/deluge-plinth.conf
new file mode 100644
index 000000000..76c92049e
--- /dev/null
+++ b/data/etc/apache2/conf-available/deluge-plinth.conf
@@ -0,0 +1,6 @@
+##
+## On all sites, provide Deluge on a default path: /deluge
+##
+
+ ProxyPass http://localhost:8112
+