Skip to content

Commit bde0e29

Browse files
committed
Created Deployment (markdown)
1 parent 9db9a49 commit bde0e29

File tree

1 file changed

+125
-0
lines changed

1 file changed

+125
-0
lines changed

Deployment.md

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
EWF Deployment
2+
==============
3+
4+
##Apache on Windows
5+
###Apache Install
6+
7+
- Check the correct version (Win 32 or Win64)
8+
- Apache Version:  Apache 2.4.4
9+
- Windows: http://www.apachelounge.com/download/
10+
11+
###Deploying EWF CGI
12+
13+
####CGI overview
14+
> A new process is started for each HTTP request. So if there are N request to the same CGI
15+
> program, the code of the CGI program is loaded into memory N times.
16+
> When a CGI program finished handling a request,  the program terminates
17+
18+
1. Build EWF application.
19+
20+
ec ­config app.ecf ­target app_cgi ­finalize ­c_compile ­project_path .
21+
Note: change app.ecf and target app_cgi  based on your own configuration.
22+
2. Copy the generated exe file and the www content.
23+
24+
```
25+
Copy the app.exe and the folder www into a folder served by apache2, for example under
26+
<APACHE_PATH>/htdocs
27+
<APACHE_PATH> = path to your apache installation
28+
Edit httpd.conf under c:/<APACHE_PATH>/conf
29+
DocumentRoot "c:/<APACHE_PATH>/htdocs"
30+
<Directory "c:/<APACHE_PATH>/htdocs">
31+
AllowOverride All --
32+
Require all granted -- this is required in Apache 2.4.4
33+
</Directory>
34+
```
35+
36+
3. Check that you have the following modules enabled.
37+
38+
```
39+
LoadModule cgi_module modules/mod_cgi.so
40+
LoadModule rewrite_module modules/mod_rewrite.so
41+
```
42+
43+
*Tip:*
44+
To check the syntax of your httpd.conf file. From command line run the following.
45+
46+
$>httpd - t
47+
48+
####.htaccess CGI
49+
http://perishablepress.com/stupid­htaccess­trics/
50+
51+
Options +ExecCGI +Includes +FollowSymLinks ­Indexes
52+
AddHandler cgi­script exe
53+
<IfModule mod_rewrite.c>
54+
  RewriteEngine on
55+
  RewriteRule ^$ $service [L]
56+
RewriteCond %{REQUEST_FILENAME} !­f
57+
RewriteCond %{REQUEST_FILENAME} !­d
58+
RewriteCond %{REQUEST_URI} !$service
59+
  RewriteRule ^(.*)$ $service/$1
60+
RewriteRule .* ­ [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
61+
</IfModule
62+
63+
Replace $service with the name of your executable service, for example app_service.exe
64+
65+
66+
##Deploying EWF FCGI
67+
68+
- To deploy FCGI you will need to download the mod_fcgi module.
69+
- You can get it from here http://www.apachelounge.com/download/
70+
71+
###FCGI overview
72+
> FastCGI allows a single, long­running process to handle more than one user request while keeping close to
73+
> the CGI programming model, retaining the simplicity while eliminating the overhead of creating a new
74+
> process for each request. Unlike converting an application to a web server plug­in, FastCGI applications
75+
> remain independent of the web server.
76+
77+
1. Build EWF application
78+
79+
ec ­config app.ecf ­target app_fcgi ­finalize ­c_compile ­project_path .
80+
Note: change app.ecf and target app_fcgi  based on your own configuration.
81+
82+
2. Copy the generated exe file and the www content
83+
84+
85+
Copy the app.exe and the folder "www"  into a folder served by apache2, for example under
86+
<APACHE_PATH>/htdocs.
87+
<APACHE_PATH> = path to your apache installation
88+
Edit httpd.conf under c:/<APACHE_PATH>/conf
89+
90+
DocumentRoot "c:/<APACHE_PATH>/htdocs"
91+
<Directory "c:/<APACHE_PATH>/htdocs">
92+
AllowOverride All --
93+
Require all granted -- this is required in Apache 2.4.4
94+
</Directory>
95+
96+
Check that you have the following modules enabled.
97+
98+
LoadModule rewrite_module modules/mod_rewrite.so
99+
LoadModule fcgid_module modules/mod_fcgid.so
100+
101+
By default Apache does not comes with fcgid module, so you will need to
102+
download it, and put the module under Apache2/modules
103+
104+
####.htaccess FCGI
105+
http://perishablepress.com/stupid­htaccess­tricks/
106+
107+
Options +ExecCGI +Includes +FollowSymLinks ­Indexes
108+
<IfModule mod_fcgid.c>
109+
AddHandler fcgid­script .ews
110+
FcgidWrapper $FULL_PATH/$service .ews
111+
</IfModule>
112+
<IfModule mod_rewrite.c>
113+
  RewriteEngine on
114+
  RewriteBase /
115+
  RewriteRule ^$ service.ews [L]
116+
  RewriteCond %{REQUEST_FILENAME} !­f
117+
  RewriteCond %{REQUEST_FILENAME} !­d
118+
  RewriteCond %{REQUEST_URI} !=/favicon.ico
119+
  RewriteCond %{REQUEST_URI} !service.ews
120+
  RewriteRule ^(.*)$ service.ews/$1  RewriteRule .* ­ [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
121+
</IfModule>
122+
123+
Replace $service with the name of your executable $service, for example app_service.exe
124+
You will need to create an service.ews file, this file will be located at the same place where you
125+
copy your app service executable.

0 commit comments

Comments
 (0)