Browse Source

Complements Apache2 documentation

Adrien Panay 7 years ago
parent
commit
49675b3086
2 changed files with 26 additions and 12 deletions
  1. 25 10
      doc/apache.md
  2. 1 2
      tracim/app.wsgi

+ 25 - 10
doc/apache.md View File

20
 
20
 
21
 ### Configuration ###
21
 ### Configuration ###
22
 
22
 
23
-Create a file named `/etc/apache2/sites-available/tracim.conf` with the following content:
23
+Create a file named `/etc/apache2/sites-available/tracim.conf` containing:
24
 
24
 
25
     <VirtualHost *:80>
25
     <VirtualHost *:80>
26
         ServerAdmin webmaster@tracim.mycompany.com
26
         ServerAdmin webmaster@tracim.mycompany.com
27
-        ServerName tracim.mycompany.com
28
-
29
-        WSGIProcessGroup tracim
30
-        WSGIDaemonProcess tracim user=www-data group=adm threads=4 python-path=/opt/traciminstall/tg2env/lib/python3.5/site-packages
31
-        WSGIScriptAlias / /opt/traciminstall/tracim/productionapp.wsgi
27
+        ServerName localhost/tracim
28
+
29
+        WSGIProcessGroup localhost/tracim
30
+        WSGIDaemonProcess localhost/tracim user=www-data group=www-data threads=4 python-path=/home/algooapy/Documents/dev/py/tracim/tg2env/lib/python3.5/site-packages
31
+        # WSGIScriptAlias / /var/www/tracim/tracim/productionapp.wsgi
32
+        WSGIScriptAlias /tracim /var/www/tracim/tracim/app.wsgi
33
+        <Directory "/var/www/tracim/tracim">
34
+            <Files "app.wsgi">
35
+                Require all granted
36
+            </Files>
37
+        </Directory>
32
 
38
 
33
         #Serve static files directly without TurboGears
39
         #Serve static files directly without TurboGears
34
-        Alias /assets     /opt/traciminstall/tracim/tracim/public/assets
35
-        Alias /favicon.ico /opt/traciminstall/tracim/tracim/public/favicon.ico
40
+        Alias /assets      /var/www/tracim/tracim/tracim/public/assets
41
+        Alias /favicon.ico /var/www/tracim/tracim/tracim/public/favicon.ico
36
 
42
 
37
-        CustomLog /var/log/apache2/demotracim-access.log combined
38
-        ErrorLog /var/log/apache2/demotracim-error.log
43
+        CustomLog ${APACHE_LOG_DIR}/tracim_access_log combined
44
+        ErrorLog ${APACHE_LOG_DIR}/tracim_error_log
39
         LogLevel debug
45
         LogLevel debug
40
     </VirtualHost>
46
     </VirtualHost>
41
 
47
 
48
+Enable this site configuration file:
49
+
50
+    sudo a2ensite tracim.conf
51
+
52
+Reload `Apache` configuration:
53
+
54
+    sudo systemctl reload apache2.service
55
+
42
 ## Documentation Links ##
56
 ## Documentation Links ##
43
 
57
 
44
 [TurboGears](http://turbogears.readthedocs.io/en/tg2.3.7/cookbook/deploy/mod_wsgi.html)
58
 [TurboGears](http://turbogears.readthedocs.io/en/tg2.3.7/cookbook/deploy/mod_wsgi.html)
59
+
45
 [mod_wsgi](http://modwsgi.readthedocs.io/en/develop/index.html)
60
 [mod_wsgi](http://modwsgi.readthedocs.io/en/develop/index.html)

+ 1 - 2
tracim/app.wsgi View File

1
 # -*- coding: utf-8 -*-
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
 #Setup logging
5
 #Setup logging
6
 # import logging
6
 # import logging
10
 from paste.deploy import loadapp
10
 from paste.deploy import loadapp
11
 application = loadapp('config:%s' % APP_CONFIG)
11
 application = loadapp('config:%s' % APP_CONFIG)
12
 application.debug = False
12
 application.debug = False
13
-