1# Deploying Magus Web App
2
3There are two configuration options: CGI or fast cgi
4
5        <Directory "/home/mbsd/magus">
6                Require all granted
7                Allow from all
8                AllowOverride All
9        </Directory>
10
11## CGI
12
13inside apache virtual host config:
14```
15   Alias /magus/elements/ "/home/mbsd/magus/elements/"
16   ScriptAlias /magus/auth/ "/home/mbsd/magus/auth/"
17   ScriptAlias /magus "/home/mbsd/magus/index.cgi"
18```
19
20## Fast CGI swith spawn_fcgi plus mod_proxy_fcgi
21
22inside apache virtual host config:
23
24```
25ProxyPass /magus/auth !
26ProxyPassMatch ^/magus/(.*)$ fcgi://127.0.0.1:9001/home/mbsd/magus/index.cgi/$1
27        <Location "/magus">
28         ProxyFCGISetEnvIf "true" TRUE
29        SetEnvIf Request_URI "^/magus(/.*)$" PATH_INFO=$1
30        </Location>
31```
32
33Also need this in /etc/rc.conf
34
35```
36spawn_fcgi_enable="YES"
37spawn_fcgi_app="/home/mbsd/magus/index.cgi"
38spawn_fcgi_bindport="9001"
39spawn_fcgi_children="10"
40```
41