Browse Source

Merge pull request #364 from tracim/fix/234/apache_documentation

Damien Accorsi 6 years ago
parent
commit
70ecd6c4b8
3 changed files with 75 additions and 55 deletions
  1. 41 20
      doc/apache.md
  2. 1 2
      tracim/app.wsgi
  3. 33 33
      tracim/wsgidav.conf.sample

+ 41 - 20
doc/apache.md View File

@@ -1,31 +1,52 @@
1
-# Running Tracim through Apache WSGI #
1
+# Running Tracim through Apache #
2 2
 
3
-## Installation ##
3
+### Installation ###
4 4
 
5
-Install `Apache` `HTTP` server and its `WSGI` module:
5
+Install `Apache` server and its [`WSGI` module](https://github.com/GrahamDumpleton/mod_wsgi):
6 6
 
7 7
     sudo apt install apache2 libapache2-mod-wsgi-py3
8 8
 
9
-## Configuration ##
9
+### Configuration ###
10 10
 
11
-Example of `Apache` `WSGI` configuration. This configuration refers to
12
-`productionapp.wsgi` which is a copy of the file `app.wsgi` available in the
13
-repo. (this file has to be updated to match with your environment and
14
-installation)
11
+Create a file named `/etc/apache2/sites-available/tracim.conf` containing:
15 12
 
16
-    <VirtualHost *:80>
17
-        ServerAdmin webmaster@tracim.mycompany.com
18
-        ServerName tracim.mycompany.com
13
+    Listen 8080
19 14
 
15
+    <VirtualHost *:8080>
16
+        ServerName tracim
17
+
18
+        # Serve Tracim through WSGI
19
+        WSGIDaemonProcess tracim user=[your_user] group=[your_user] threads=4 python-home=[tracim_path]/tg2env python-path=[tracim_path]/tracim lang='C.UTF-8' locale='C.UTF-8'
20 20
         WSGIProcessGroup tracim
21
-        WSGIDaemonProcess tracim user=www-data group=adm threads=4 python-path=/opt/traciminstall/tg2env/lib/python3.2/site-packages
22
-        WSGIScriptAlias / /opt/traciminstall/tracim/productionapp.wsgi
21
+        WSGIScriptAlias / [tracim_path]/tracim/app.wsgi process-group=tracim
22
+        <Directory "[tracim_path]/tracim">
23
+            <Files "app.wsgi">
24
+                Require all granted
25
+            </Files>
26
+        </Directory>
27
+
28
+        # Serve static files directly
29
+        Alias /assets          [tracim_path]/tracim/tracim/public/assets
30
+        Alias /_caldavzap      [tracim_path]/tracim/tracim/public/_caldavzap
31
+        Alias /favicon.ico     [tracim_path]/tracim/tracim/public/favicon.ico
32
+        <Directory "[tracim_path]/tracim/tracim/public">
33
+            Require all granted
34
+        </Directory>
35
+    </VirtualHost>
23 36
 
24
-        #Serve static files directly without TurboGears
25
-        Alias /assets     /opt/traciminstall/tracim/tracim/public/assets
26
-        Alias /favicon.ico /opt/traciminstall/tracim/tracim/public/favicon.ico
37
+Replace `[tracim_path]` and `[your_user]` by your tracim installation path and your user.
27 38
 
28
-        CustomLog /var/log/apache2/demotracim-access.log combined
29
-        ErrorLog /var/log/apache2/demotracim-error.log
30
-        LogLevel debug
31
-    </VirtualHost>
39
+Load needed proxy modules and enable this site configuration file:
40
+
41
+    sudo a2enmod proxy proxy_http
42
+    sudo a2ensite tracim.conf
43
+
44
+Reload `Apache` configuration:
45
+
46
+    sudo systemctl reload apache2.service
47
+
48
+## Documentation Links ##
49
+
50
+[TurboGears](http://turbogears.readthedocs.io/en/tg2.3.7/cookbook/deploy/mod_wsgi.html)
51
+
52
+[mod_wsgi](http://modwsgi.readthedocs.io/en/develop/index.html)

+ 1 - 2
tracim/app.wsgi View File

@@ -1,6 +1,6 @@
1 1
 # -*- coding: utf-8 -*-
2 2
 
3
-APP_CONFIG = "/opt/traciminstallpath/development.ini"
3
+APP_CONFIG = "/var/www/tracim/tracim/development.ini"
4 4
 
5 5
 #Setup logging
6 6
 # import logging
@@ -10,4 +10,3 @@ APP_CONFIG = "/opt/traciminstallpath/development.ini"
10 10
 from paste.deploy import loadapp
11 11
 application = loadapp('config:%s' % APP_CONFIG)
12 12
 application.debug = False
13
-

+ 33 - 33
tracim/wsgidav.conf.sample View File

@@ -1,33 +1,33 @@
1
-################################################################################
2
-# Sample WsgiDAV configuration file
3
-#
4
-# 1. Rename this file to `wsgidav.conf`
5
-# 2. Adjust settings as appropriate
6
-# 3. Run tracim as you always do :)
7
-#
8
-################################################################################
9
-
10
-################################################################################
11
-# SERVER OPTIONS
12
-#===============================================================================
13
-
14
-# host  = "localhost"
15
-# host  = "192.168.0.1"
16
-host  = "0.0.0.0"
17
-
18
-port = 3030
19
-
20
-show_history = True
21
-show_deleted = True
22
-show_archived = True
23
-
24
-manager_locks = True
25
-
26
-root_path = ''
27
-
28
-#===============================================================================
29
-# Lock Manager
30
-#
31
-# Example: Use PERSISTENT shelve based lock manager
32
-#from wsgidav.lock_storage import LockStorageShelve
33
-#locksmanager = LockStorageShelve("wsgidav-locks.shelve")
1
+################################################################################
2
+# Sample WsgiDAV configuration file
3
+#
4
+# 1. Rename this file to `wsgidav.conf`
5
+# 2. Adjust settings as appropriate
6
+# 3. Run tracim as you always do :)
7
+#
8
+################################################################################
9
+
10
+################################################################################
11
+# SERVER OPTIONS
12
+#===============================================================================
13
+
14
+# host  = "localhost"
15
+# host  = "192.168.0.1"
16
+host  = "0.0.0.0"
17
+
18
+port = 3030
19
+
20
+show_history = True
21
+show_deleted = True
22
+show_archived = True
23
+
24
+manager_locks = True
25
+
26
+root_path = ''
27
+
28
+#===============================================================================
29
+# Lock Manager
30
+#
31
+# Example: Use PERSISTENT shelve based lock manager
32
+#from wsgidav.lock_storage import LockStorageShelve
33
+#locksmanager = LockStorageShelve("wsgidav-locks.shelve")