Merge branch 'v1' into es17.01

This commit is contained in:
2017-02-16 14:58:12 +01:00
110 changed files with 10149 additions and 1299 deletions

View File

@@ -0,0 +1,61 @@
Nav: [Workbook](../../../workbook.md) :: [Basic concepts](../../../basics/basics.md)
## Run simple_html example on Apache with FCGI on Windows.
#### Prerequisites
* This tutorial was written for people working under Windows environment, and using Apache Server with FCGI connector
* Compile the ewf application from command line.
* Assuming you have installed Apache Server under `C:/home/server/Apache24`.
* Assuming you have placed your current project under `C:/home/server/Apache24/fcgi-bin`.
* Assuming you have setted the Listen to `8888`, the defautl value is `80` .
#### FCGI module
If you don't have the FCGI module installed, you can get it from https://www.apachelounge.com/download/, download the module based on your platform [modules-2.4-win64-VC11.zip](https://www.apachelounge.com/download/VC11/modules/modules-2.4-win64-VC11.zip) or [modules-2.4-win32-VC11.zip](https://www.apachelounge.com/download/VC11/modules/modules-2.4-win32-VC11.zip), uncompress it
and copy the _mod_fcgid.so_ to `C:/home/server/Apache24/modules`
#### Compile the project simple_html using the fcgi connector.
ec -config simple_html.ecf -target simple_html_fcgi -finalize -c_compile -project_path .
Copy the genereted exe to `C:/home/server/Apache24/fcgi-bin` folder.
Check if you have _libfcgi.dll_ in your PATH.
#### Apache configuration
Add to httpd.conf the content, you can get the configuration file [here](config.conf)
```
LoadModule fcgid_module modules/mod_fcgid.so
<IfModule mod_fcgid.c>
<Directory "C:/home/server/Apache24/fcgi-bin">
SetHandler fcgid-script
Options +ExecCGI +Includes +FollowSymLinks -Indexes
AllowOverride All
Require all granted
</Directory>
ScriptAlias /simple "C:/home/server/Apache24/fcgi-bin/simple_html.exe"
</IfModule>
```
Test if your httpd.conf is ok
```
> httpd -t
```
Launch the server
```
> httpd
```
Check the application
```
> http://localhost:8888/simple
```
Nav: [Workbook](../../../workbook.md) :: [Basic concepts](../../../basics/basics.md)

View File

@@ -0,0 +1,12 @@
LoadModule fcgid_module modules/mod_fcgid.so
<IfModule mod_fcgid.c>
<Directory "C:/home/server/Apache24/fcgi-bin">
SetHandler fcgid-script
Options +ExecCGI +Includes +FollowSymLinks -Indexes
AllowOverride All
Require all granted
</Directory>
ScriptAlias /simple "C:/home/server/Apache24/fcgi-bin/simple_html.exe"
</IfModule>

View File

@@ -0,0 +1,24 @@
note
description: "Basic Service launcher"
class
APPLICATION
inherit
WSF_DEFAULT_SERVICE [APPLICATION_EXECUTION]
redefine
initialize
end
create
make_and_launch
feature {NONE} -- Initialization
initialize
-- Initialize current service.
do
set_service_option ("port", 9090)
end
end

View File

@@ -0,0 +1,66 @@
note
description : "Basic Service that Generate HTML"
date : "$Date$"
revision : "$Revision$"
class
APPLICATION_EXECUTION
inherit
WSF_EXECUTION
create
make
feature -- Basic operations
execute
-- Execute the incomming request
do
-- To send a response we need to setup, the status code and
-- the response headers.
response.put_header ({HTTP_STATUS_CODE}.ok, <<["Content-Type", "text/html"], ["Content-Length", web_page.count.out]>>)
response.put_string (web_page)
end
web_page: STRING = "[
<!DOCTYPE html>
<html>
<head>
<title>Resume</title>
</head>
<body>
<div id="header">
<p id="name">Your Name Here</p>
<a href="mailto:you@yourdomain.com"><p id="email">you@yourdomain.com</p></a>
</div>
<div class="left"></div>
<div class="right">
<h4>Objective</h4>
<p>To take a position as a software engineer.</p>
<h4>Experience</h4>
<p>Junior Developer, Software Company (2010 - Present)</p>
<ul>
<li>Designed and implemented end-user features for Flagship Product</li>
<li>Wrote third-party JavaScript and Eiffel libraries</li>
</ul>
<h4>Skills</h4>
<p>Languages: C#, JavaScript, Python, Ruby, Eiffel</p>
<p>Frameworks: .NET, Node.js, Django, Ruby on Rails, EWF</p>
<h4>Education</h4>
<p>BS, Economics, My University</p>
<ul>
<li>Award for best senior thesis</li>
<li>GPA: 3.8</li>
</ul>
</div>
<div id="footer">
<p>123 Your Street, Anytown, State 12345-6789 | Tel: (555) 555-5555</p>
</div>
</body>
</html>
]"
end

View File

@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-16-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.eiffel.com/developers/xml/configuration-1-16-0.xsd" name="simple_html" uuid="C28C4F53-9963-46C0-A080-8F13E94E7486">
<target name="common" abstract="true">
<file_rule>
<exclude>/.svn$</exclude>
<exclude>/CVS$</exclude>
<exclude>/EIFGENs$</exclude>
</file_rule>
<option warning="true">
<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
</option>
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
<library name="http" location="$ISE_LIBRARY\contrib\library\network\protocol\http\http.ecf"/>
<library name="wsf" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\wsf.ecf"/>
</target>
<target name="simple_html_standalone" extends="common">
<root class="APPLICATION" feature="make_and_launch"/>
<option warning="true">
<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
</option>
<capability>
<void_safety support="all"/>
</capability>
<library name="default_standalone" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\default\standalone.ecf"/>
<cluster name="simple_html" location=".\" recursive="true"/>
</target>
<target name="simple_html_cgi" extends="common">
<root class="APPLICATION" feature="make_and_launch"/>
<option warning="true">
<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
</option>
<capability>
<void_safety support="all"/>
</capability>
<library name="default_cgi" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\default\cgi.ecf"/>
<cluster name="simple_html" location=".\" recursive="true"/>
</target>
<target name="simple_html_libfcgi" extends="common">
<root class="APPLICATION" feature="make_and_launch"/>
<option warning="true">
<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
</option>
<capability>
<void_safety support="all"/>
</capability>
<library name="default_libfcgi" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\default\libfcgi.ecf"/>
<cluster name="simple_html" location=".\" recursive="true"/>
</target>
<target name="simple_html" extends="simple_html_standalone">
</target>
</system>