瀏覽代碼

Complements Apache2 documentation

Adrien Panay 6 年之前
父節點
當前提交
49675b3086
共有 2 個文件被更改,包括 26 次插入12 次删除
  1. 25 10
      doc/apache.md
  2. 1 2
      tracim/app.wsgi

+ 25 - 10
doc/apache.md 查看文件

@@ -20,26 +20,41 @@ Install `Apache` server and its [`WSGI` module](https://github.com/GrahamDumplet
20 20
 
21 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 25
     <VirtualHost *:80>
26 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 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 45
         LogLevel debug
40 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 56
 ## Documentation Links ##
43 57
 
44 58
 [TurboGears](http://turbogears.readthedocs.io/en/tg2.3.7/cookbook/deploy/mod_wsgi.html)
59
+
45 60
 [mod_wsgi](http://modwsgi.readthedocs.io/en/develop/index.html)

+ 1 - 2
tracim/app.wsgi 查看文件

@@ -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
-