Difference between revisions of "Xebra Installation"

(New page: Category:Xebra ===Notes=== * Use Xebra revision 78995 for this tutorial. * This tutorial was tested with EiffelStudio 6.4.7.8600 ($ISE_EIFFEL) and eiffel_src ($EIFFEL_SRC) revision ...)
 
(Replaced origo.ethz.ch by eiffel.com in SVN URL)
 
(105 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 
[[Category:Xebra]]
 
[[Category:Xebra]]
 +
[[Xebra About|About]] | [[Xebra Installation|Installation]] |  [[Xebra Documentation|Documentation]] |  [[Xebra Tutorial|Tutorials]] | [[Xebra FAQ|Frequently Asked Questions]]
  
  
===Notes===
+
=Installations=
 +
===There are two ways to install Xebra:===
 +
*Automatic
 +
** A script for Ubuntu 9.04 that sets up xebra and also installs apache
 +
** A Windows Installer that contains xebra and apache and sets it up
 +
*Manual (Step-by-step guide)
 +
** Ubuntu 9.04 with Apache
 +
** Windows with Apache
 +
** Windows with IIS7
  
* Use Xebra revision 78995 for this tutorial.
+
===A few notes===
* This tutorial was tested with EiffelStudio 6.4.7.8600 ($ISE_EIFFEL) and eiffel_src ($EIFFEL_SRC) revision 78995.
+
*If you find in the documentation the notion of experimental mode, and -experiment, just ignore them, since from 6.7 this is the default mode (and not experimental anymore)
* The env vars $EIFFEL_SRC, $ISE_EIFFEL, $ISE_PLATFORM and $ISE_LIBRARY are expected to be set.
+
*Currently (rev 80407), for all types of installation you have to adapt a files in ISE_LIBRARY to make it work since there is a bug in the eiffel argument parser library: In the class ''ISE_EIFFEL/experimental/library/argument_parser/parsers/argument_base_parser.e'' in the feature ''arguments: ARRAY [STRING]'' replace the line
 +
<code>
 +
create Result.make (1, l_result.count)
 +
</code>
 +
with
 +
<code>
 +
create Result.make_filled ("", 1, l_result.count)
 +
</code>
  
==Ubuntu 9.04 with Apache 2.2.11==
+
=Ubuntu Installation Script =
===Note===
+
{{Note| This script was tested with Xebra revision 81057, EiffelStudio 6.5.8.945 and Ubuntu 9.04 (October 2009)}}
There is an installation script available for this type of configuration: https://svn.origo.ethz.ch/eiffelstudio/trunk/Src/framework/web/xebra/tools/scripts/install_xebra_ubuntu.sh
+
  
The script expects $XEBRA_DEV, $EIFFEL_SRC, $ISE_EIFFEL and $ISE_LIBRARY to be set. It will checkout xebra to $XEBRA_DEV, download and install apache to $XEBRA_DEV/httpd and compile the translator and the server. After the script was successfully run you have to edit $XEBRA_DEV/eiffel_projects/xebra_server/config.ini to match your configuration.
+
Download this script (the newest revision):
 +
https://svn.eiffel.com/eiffelstudio/trunk/Src/framework/web/xebra/tools/scripts/linux/install_xebra_ubuntu.sh
  
  
 +
The script expects $XEBRA_DEV, $ISE_EIFFEL and $ISE_LIBRARY to be set. Please make sure ''svn'', ''wget'', ''vim'' and ''tar'' are installed. Also, the path to your eiffel studio bin folder should be included in your PATH variable (usually $ISE_EIFFEL/studio/spec/$ISE_PLATFORM/bin).
  
===Checkout Xebra===
+
The script will checkout xebra to $XEBRA_DEV, compile the server and translator, download, install and configure apache to $XEBRA_DEV/apache. Apache will be configured to listen on port 55000 (instead of 80) in order to not interfere with an already installed http server. After the script was successfully run you need to set $XEBRA_LIBRARY to $XEBRA_DEV/library.
* Define $XEBRA_DEV and checkout xebra from https://svn.origo.ethz.ch/eiffelstudio/trunk/Src/framework/web/xebra/ to $XEBRA_DEV
+
  
===Setup Apache===
+
To test you installation run
 +
$XEBRA_DEV/bin/launch_apache.sh
 +
$XEBRA_DEV/bin/launch_server.sh
 +
and then browse to
 +
http://localhost:55000/helloworld
 +
The server will then start compiling the xebra precompile library and generate the helloworld webapp. It can take a while to do so the first time (If you want to see what's happening type 'debug_level 6' in the server console). While compiling you will see a page saying "Application 'helloworld' is compiling...". After a while hit F5 and you should see "Hello WORLD!" (or "Hello world!").
  
Note: Mod_xebra does currently not run with the apache distribution that comes with ubuntu.
+
=Windows Installer =
 +
{{Note| This installer was tested with Xebra revision 80545, EiffelStudio 6.5.8.294, on Windows XP SP2}}
  
* Download apache unix source httpd-2.2.11 from http://httpd.apache.org/download.cgi
+
Run the installer at:
 +
 
 +
https://svn.eiffel.com/eiffelstudio/trunk/Src/framework/web/xebra/tools/installer/win/innosetup/output/XebraSetup.exe
 +
 
 +
To test your installation click "Launch Xebra Full" in the "Eiffel Xebra" folder in your start menu. This will launch apache and the xebra server and it will open "localhost:55000/helloworld" in your browser.
 +
The server will then start compiling the xebra precompile library and generate the helloworld webapp. It can take a while to do so the first time (If you want to see what's happening type 'debug_level 6' in the server console). While compiling you will see a page saying "Application 'helloworld' is compiling...". After a while hit F5 and you should see "Hello WORLD!" (or "Hello world!").
 +
 
 +
=Manual Installation=
 +
This guide expects Eiffel Studio to be installed to $ISE_EIFFEL and the source to be checked out to $EIFFEL_SRC (only the folder 'framework' is needed).
 +
 
 +
 
 +
==Checkout Xebra==
 +
* Define $XEBRA_DEV and checkout xebra from https://svn.eiffel.com/eiffelstudio/trunk/Src/framework/web/xebra/ to $XEBRA_DEV
 +
* Define $XEBRA_LIBRARY to $XEBRA_DEV/eiffel_projects/library
 +
 
 +
==Install HTTP Server==
 +
=== Ubuntu 9.04 with Apache 2.2.11 ===
 +
Note:
 +
* Mod_xebra does currently not run with the apache distribution that comes with ubuntu.
 +
 
 +
 
 +
* Download apache unix source from http://httpd.apache.org/download.cgi
 
* Extract
 
* Extract
* Define $APACHE2 where you want to install apache, e.g. to $XEBRA_DEV/httpd
+
* Define $APACHE2 where you want to install apache, e.g. to $XEBRA_DEV/apache
* Run the following commands:
+
* Run the following commands in the extracted folder:
  CFLAGS="-ggdb"./configure --prefix={insert path here}
+
  CFLAGS="-ggdb"
 +
./configure --prefix=$APACHE2
 
  make
 
  make
 
  make install
 
  make install
 
* Compile the module by running
 
* Compile the module by running
  cd $XEBRA_DEV/c_projects/mod_xebra
+
  cd $XEBRA_DEV/c_projects/apache_mod_xebra
  $APACHE2/bin/apxs -c -Wc,-ggdb -I$ISE_EIFFEL/studio/spec/$ISE_PLATFORM/include mod_xebra.c mod_xebra.h
+
  $APACHE2/bin/apxs -c mod_xebra.c mod_xebra.h
 
* Install the module to apache by running
 
* Install the module to apache by running
  sudo $APACHE2/bin/apxs -i mod_xebra.la
+
  $APACHE2/bin/apxs -i mod_xebra.la
* Add the following lines to Apache2.2\conf\httpd.conf:
+
* Add the following lines to $APACHE2/conf/httpd.conf:
LoadModule xebra_module modules/mod_xebra.so
+
<code>
  AddHandler mod_xebra .xeb
+
#Xebra Module
XebraServer_port "55000"
+
LoadModule xebra_module modules/mod_xebra.so
XebraServer_host "localhost"
+
 
LogLevel debug
+
  <IfModule xebra_module>
DirectoryIndex index.xeb
+
  AddHandler mod_xebra .xeb
 +
  AddHandler mod_xebra .xrpc
 +
  XebraServer_port 55001
 +
  XebraServer_host "127.0.0.1"
 +
  XebraServer_max_upload_size 10000000
 +
  XebraServer_upload_path "/tmp"
 +
  DirectoryIndex index.xeb
 
  <Files ~ "\.(ini|e|ecf)$">
 
  <Files ~ "\.(ini|e|ecf)$">
 
   Order allow,deny
 
   Order allow,deny
Line 49: Line 99:
 
   Order allow,deny
 
   Order allow,deny
 
   Deny from all
 
   Deny from all
  </Directory>"
+
  </Directory>
 +
</IfModule>
 +
</code>
 +
* Also in httpd.conf, change ''DocumentRoot'' to ''{path to xebra}\www'' and don't forget the directory options below the line ''# This should be changed to whatever you set DocumentRoot to.''
 +
* Create the directory ''/tmp'' or choose another temp upload directory.
 +
* Restart apache
 +
$APACHE2/bin/apachectl restart
 +
* Browse to ''http://localhost/test.xeb''. You should see a message saying ''Cannot connect to XebraServer. See apache error log.''
 +
* Hint: keep an eye on the apache error log
 +
<code>
 +
tail -f $APACHE2/logs/error_log
 +
</code>
  
* Restart apache (if necessary, you need to stop and start instead of restart)
+
===Windows with Apache 2.2.11===
sudo $APACHE2/bin/apachectl restart
+
* Make sure no other apache is running, e.g. run
+
sudo apache2ctl stop
+
* Browse to http://localhost/test.xeb. You should see the Fail Whale and a message saying "Cannot connect to XebraServer. See apache error log."
+
* In order to be able to browse to the pre-created websites, copy the content of the folder xebra/httpd/htdocs to $APACHE2/htdocs.
+
* Hint: keep an eye on the apache error log tail -f $APACHE2/logs/error_log
+
  
===Compile the Xebra Translator===
+
Note
 +
* If mod_xebra.so was compiled with VS2008, it has a delay-load dependency on the Visual C++ 9.0 debug runtime library, msvcr90d.dll.  This dll comes with Visual Studio 2008 C++ including the free Visual Studio 2008 C++ Express edition.  This file can be copied in to the System32 directory.  If this DLL is not found you will get an Apache error '''Cannot load C:/Xebra/httpd/modules/mod_xebra.so into server: This application has failed to start because the application configuration is incorrect.'''
  
cd $XEBRA_DEV/eiffel_projects/xebra_translator/
 
ec -config xebra_translator-voidunsafe.ecf  -target xebra_translator -c_compile -clean
 
  
===Run the Xebra Server===
+
* Download apache windows binary from http://httpd.apache.org/download.cgi
 +
* Install (Choose Custom Installation and install Build Headers and Libraries as well)
 +
* Copy $XEBRA_DEV/c_projects/apache_mod_xebra/mod_xebra.so to your Apache2.2\modules folder.
 +
**Note: If you use a newer version of apache than 2.2.11 please compile mod_xebra yourself to avoid any possible errors, see [[Xebra Apache Module Windows]].
 +
* Add the following lines to Apache2.2\conf\httpd.conf:
 +
<code>
 +
#Xebra Module
 +
LoadModule xebra_module modules/mod_xebra.so
  
* Open the file $XEBRA_DEV/eiffel_projects/xebra_server/config.ini and adapt translator, compiler, and webapps_root to your configuration.
+
<IfModule xebra_module>
* Compile the server
+
  AddHandler mod_xebra .xeb
cd $XEBRA_DEV/eiffel_projects/xebra_server
+
  AddHandler mod_xebra .xrpc
ec -config xebra_server-voidunsafe.ecf -target xebra_server -c_compile -clean
+
  XebraServer_port 55001
 +
  XebraServer_host "127.0.0.1"
 +
  XebraServer_max_upload_size 10000000
 +
  XebraServer_upload_path "c:\tmp"
 +
  DirectoryIndex index.xeb
 +
<Files ~ "\.(ini|e|ecf)$">
 +
  Order allow,deny
 +
  Deny from all
 +
</Files>
 +
<Directory ~ "EIFGENs">
 +
  Order allow,deny
 +
  Deny from all
 +
</Directory>
 +
</IfModule>
 +
</code>
 +
* Also in httpd.conf, change ''DocumentRoot'' to ''{path to xebra}\www'' and don't forget the directory options below the line ''# This should be changed to whatever you set DocumentRoot to.''
 +
* Create the directory ''c:\tmp'' or choose another temp upload directory.
 +
* Restart Apache
 +
* Browse to ''http://localhost/test.xeb''. You should see the a message saying ''Cannot connect to XebraServer. See apache error log.''
  
* Open estudio in a terminal and open the project $XEBRA_DEV/eiffel_projects/xebra_server/xebra_server-voidunsafe.ecf
+
===Windows with IIS7===
* Go to the Exceptions Handling dialog and disable DEVELOPER_EXCEPTION.
+
* Open the Execution Parameters dialog and set "config.ini -d 10" as argument.
+
* Run
+
* Browse to http://localhost/helloworld/hello.xeb. The server now translates, generates, compiles and finally runns the application.
+
  
==Windows with Apache 2.2.11==
+
* Open %XEBRA_DEV%\c_projects\iis_xebra_handler\XebraEventSourceInstaller\XebraEventSourceInstaller.sln in VS2008
===Checkout Xebra===
+
* Compile and run (This will install the ''XebraHandler'' source to the Windows Event Log. This cannot be performed by the handler because it lacks permissions.)
* Define $XEBRA_DEV and checkout xebra from https://svn.origo.ethz.ch/eiffelstudio/trunk/Src/framework/web/xebra/ to $XEBRA_DEV
+
* (Optional) Open %XEBRA_DEV%\c_projects\iis_xebra_handler\Xebra.sln in VS2008 and compile
 +
* Create a new site in IIS and point it to %XEBRA_DEV%\www
 +
* Copy %XEBRA_DEV%\c_projects\iis_xebra_handler\website\web.config to %XEBRA_DEV%\www
 +
* Copy %XEBRA_DEV%\c_projects\iis_xebra_handler\website\bin to %XEBRA_DEV%\www
  
===Setup Apache===
+
=== Mac OS X with Apache ===
* Download apache httpd-2.2.11 windows binary from http://httpd.apache.org/download.cgi
+
Note:
* Install (Choose Custom Installation and install Build Headers and Libraries as well)
+
* If you're using the version of EiffelStudio from MacPorts, environment variables must be set within the startup script. /Applications/MacPorts/Eiffel64/EiffelStudio/Contents/Resources/EiffelLauncher
* Copy [https://svn.origo.ethz.ch/eiffelstudio/trunk/Src/framework/web/xebra/c_projects/apache_mod_xebra_win/Debug/mod_xebra.so mod_xebra.so] to your Apache2.2\modules folder.
+
* Save yourself a ton of hassle and just sudo chmod -R 777 * both the $ISE_EIFFEL and $EIFFEL_SRC directories.
* Add the following lines to Apache2.2\conf\httpd.conf:
+
 
LoadModule xebra_module modules/mod_xebra.so
+
* Get Apache V2 from Mac Ports
  AddHandler mod_xebra .xeb
+
  sudo port install apache2
XebraServer_port "55000"
+
* Copy $XEBRA_DEV/www/* to /opt/local/apache2/htdocs
XebraServer_host "localhost"
+
* Compile the module by running
LogLevel debug
+
cd $XEBRA_DEV/c_projects/apache_mod_xebra
DirectoryIndex index.xeb
+
sudo /opt/local/apache2/bin/apxs -c -Wc,-ggdb -I$ISE_EIFFEL/studio/spec/$ISE_PLATFORM/include mod_xebra.c mod_xebra.h
 +
* Install the module to apache by running
 +
sudo /opt/local/apache2/bin/apxs -i mod_xebra.la
 +
* Prepare to edit the protected httpd.conf file by running the command:
 +
  sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit
 +
  Within TextEdit, which now is running under sudo, open /opt/local/apache2/conf/httpd.conf
 +
* Add the following lines to /opt/local/apache2/conf/httpd.conf:
 +
<code>
 +
#Xebra Module
 +
LoadModule xebra_module modules/mod_xebra.so
 +
 
 +
  <IfModule xebra_module>
 +
  AddHandler mod_xebra .xeb
 +
  AddHandler mod_xebra .xrpc
 +
  XebraServer_port 55001
 +
  XebraServer_host "127.0.0.1"
 +
  XebraServer_max_upload_size 10000000
 +
  XebraServer_upload_path "/tmp"
 +
  DirectoryIndex index.xeb
 
  <Files ~ "\.(ini|e|ecf)$">
 
  <Files ~ "\.(ini|e|ecf)$">
 
   Order allow,deny
 
   Order allow,deny
Line 99: Line 195:
 
   Order allow,deny
 
   Order allow,deny
 
   Deny from all
 
   Deny from all
  </Directory>"
+
  </Directory>
 +
</IfModule>
 +
</code>
 +
* Also in httpd.conf, change ''DocumentRoot'' to ''{path to xebra}\www'' and don't forget the directory options below the line ''# This should be changed to whatever you set DocumentRoot to.''
 +
* Create the directory /tmp or choose another temp upload directory.
 +
* The default MacPorts apache install will listen on port 80
 +
* Restart apache
 +
sudo /opt/local/apache2/bin/apachectl restart
 +
* Browse to http://localhost/test.xeb. You should see a message saying "Cannot connect to XebraServer. See apache error log."
 +
* Hint: keep an eye on the apache error log
 +
tail -f $APACHE2/logs/error_log
  
* Restart Apache
+
==Compile the Translator and Server ==
* Browse to http://localhost/test.xeb. You should see the Fail Whale and a message saying "Cannot connect to XebraServer. See apache error log."
+
* First we need to compile the xebra precompile library:
 +
 
 +
'''Linux'''
 +
<code>
 +
ec -config $XEBRA_DEV/eiffel_projects/library/xebra_precompile/xebra_precompile.ecf -target xebra_precompile -c_compile -clean -precompile -project_path $XEBRA_DEV/eiffel_projects/library/xebra_precompile
 +
</code>
 +
'''Windows'''
 +
<code>
 +
ec -config %XEBRA_DEV%\eiffel_projects\library\xebra_precompile\xebra_precompile.ecf -target xebra_precompile -c_compile -clean -precompile -project_path %XEBRA_DEV%\eiffel_projects\library\xebra_precompile
 +
</code>
 +
 
 +
 
 +
* Then run:
 +
 
 +
'''Linux'''
 +
<code>
 +
ec -config $XEBRA_DEV/eiffel_projects/xebra_translator/xebra_translator.ecf -target xebra_translator -c_compile -clean -finalize -project_path $XEBRA_DEV/eiffel_projects/xebra_translator
 +
 
 +
ec -config $XEBRA_DEV/eiffel_projects/xebra_server/xebra_server.ecf -target xebra_server -c_compile -clean -finalize -project_path $XEBRA_DEV/eiffel_projects/xebra_server
 +
</code>
 +
'''Windows'''
 +
<code>
 +
ec -config %XEBRA_DEV%\eiffel_projects\xebra_translator\xebra_translator.ecf -target xebra_translator -c_compile -clean -finalize -project_path %XEBRA_DEV%\eiffel_projects\xebra_translator
 +
 
 +
ec -config %XEBRA_DEV%\eiffel_projects\xebra_server\xebra_server.ecf -target xebra_server -c_compile -clean -finalize -project_path %XEBRA_DEV%\eiffel_projects\xebra_server
 +
</code>
 +
 
 +
==Test the installation==
 +
 
 +
To test you installation run
 +
 
 +
'''Windows'''
 +
%XEBRA_DEV%\apache\bin\httpd.exe
 +
ec -config %XEBRA_DEV%\eiffel_projects\xebra_translator\xebra_translator.ecf -target xebra_translator -c_compile -clean -freeze -project_path %XEBRA_DEV%\eiffel_projects\xebra_translator
  
 +
%XEBRA_DEV%\eiffel_projects\xebra_server\EIFGENs\xebra_server\F_code\xebra_server.exe %XEBRA_DEV%\eiffel_projects\xebra_server\config.srv -d 6
  
===Compile Xebra Translator===
+
'''Linux'''
* Launch estudio and open the project $XEBRA_DEV/eiffel_projects/xebra_translator/xebra_translator-voidunsafe.ecf
+
$XEBRA_DEV/apache/bin/httpd
* Compile
+
$XEBRA_DEV/eiffel_projects/xebra_server/EIFGENs/xebra_server/F_code/xebra_server $XEBRA_DEV/eiffel_projects/xebra_server/config.srv -d 6
  
===Run the Xebra Server===
+
and then open
* Open the file $XEBRA_DEV/eiffel_projects/xebra_server/config.ini and adapt translator, compiler, and webapps_root to your configuration.
+
http://localhost/helloworld
* Launch estudio and open the project $XEBRA_DEV/eiffel_projects/xebra_server/xebra_server-voidunsafe.ecf
+
in your web browser.
* Go to the Exceptions Handling dialog and disable DEVELOPER_EXCEPTION.
+
* Open the Execution Parameters dialog and set "config.ini -d 10" as argument.
+
* Compile and run
+
* Browse to http://localhost/helloworld/hello.xeb. The server now translates, generates, compiles and finally runns the xebrawebpp application.
+
  
==Windows with IIS7==
+
The server will then start compiling the xebra precompile library and generate the helloworld webapp. It can take a minute to do so the first time. While compiling you will see a page saying "Application 'helloworld' is compiling...". After a while hit F5 and you should see "Hello WORLD!" (or "Hello world!").
no documentation yet
+

Latest revision as of 12:21, 4 June 2012

About | Installation | Documentation | Tutorials | Frequently Asked Questions


Installations

There are two ways to install Xebra:

  • Automatic
    • A script for Ubuntu 9.04 that sets up xebra and also installs apache
    • A Windows Installer that contains xebra and apache and sets it up
  • Manual (Step-by-step guide)
    • Ubuntu 9.04 with Apache
    • Windows with Apache
    • Windows with IIS7

A few notes

  • If you find in the documentation the notion of experimental mode, and -experiment, just ignore them, since from 6.7 this is the default mode (and not experimental anymore)
  • Currently (rev 80407), for all types of installation you have to adapt a files in ISE_LIBRARY to make it work since there is a bug in the eiffel argument parser library: In the class ISE_EIFFEL/experimental/library/argument_parser/parsers/argument_base_parser.e in the feature arguments: ARRAY [STRING] replace the line
create Result.make (1, l_result.count)

with

create Result.make_filled ("", 1, l_result.count)

Ubuntu Installation Script

Information.png Note: This script was tested with Xebra revision 81057, EiffelStudio 6.5.8.945 and Ubuntu 9.04 (October 2009)

Download this script (the newest revision): https://svn.eiffel.com/eiffelstudio/trunk/Src/framework/web/xebra/tools/scripts/linux/install_xebra_ubuntu.sh


The script expects $XEBRA_DEV, $ISE_EIFFEL and $ISE_LIBRARY to be set. Please make sure svn, wget, vim and tar are installed. Also, the path to your eiffel studio bin folder should be included in your PATH variable (usually $ISE_EIFFEL/studio/spec/$ISE_PLATFORM/bin).

The script will checkout xebra to $XEBRA_DEV, compile the server and translator, download, install and configure apache to $XEBRA_DEV/apache. Apache will be configured to listen on port 55000 (instead of 80) in order to not interfere with an already installed http server. After the script was successfully run you need to set $XEBRA_LIBRARY to $XEBRA_DEV/library.

To test you installation run

$XEBRA_DEV/bin/launch_apache.sh
$XEBRA_DEV/bin/launch_server.sh

and then browse to

http://localhost:55000/helloworld

The server will then start compiling the xebra precompile library and generate the helloworld webapp. It can take a while to do so the first time (If you want to see what's happening type 'debug_level 6' in the server console). While compiling you will see a page saying "Application 'helloworld' is compiling...". After a while hit F5 and you should see "Hello WORLD!" (or "Hello world!").

Windows Installer

Information.png Note: This installer was tested with Xebra revision 80545, EiffelStudio 6.5.8.294, on Windows XP SP2

Run the installer at:

https://svn.eiffel.com/eiffelstudio/trunk/Src/framework/web/xebra/tools/installer/win/innosetup/output/XebraSetup.exe

To test your installation click "Launch Xebra Full" in the "Eiffel Xebra" folder in your start menu. This will launch apache and the xebra server and it will open "localhost:55000/helloworld" in your browser. The server will then start compiling the xebra precompile library and generate the helloworld webapp. It can take a while to do so the first time (If you want to see what's happening type 'debug_level 6' in the server console). While compiling you will see a page saying "Application 'helloworld' is compiling...". After a while hit F5 and you should see "Hello WORLD!" (or "Hello world!").

Manual Installation

This guide expects Eiffel Studio to be installed to $ISE_EIFFEL and the source to be checked out to $EIFFEL_SRC (only the folder 'framework' is needed).


Checkout Xebra

Install HTTP Server

Ubuntu 9.04 with Apache 2.2.11

Note:

  • Mod_xebra does currently not run with the apache distribution that comes with ubuntu.


  • Download apache unix source from http://httpd.apache.org/download.cgi
  • Extract
  • Define $APACHE2 where you want to install apache, e.g. to $XEBRA_DEV/apache
  • Run the following commands in the extracted folder:
CFLAGS="-ggdb"
./configure --prefix=$APACHE2
make
make install
  • Compile the module by running
cd $XEBRA_DEV/c_projects/apache_mod_xebra
$APACHE2/bin/apxs -c mod_xebra.c mod_xebra.h
  • Install the module to apache by running
$APACHE2/bin/apxs -i mod_xebra.la
  • Add the following lines to $APACHE2/conf/httpd.conf:
#Xebra Module
LoadModule xebra_module modules/mod_xebra.so
 
 <IfModule xebra_module>
  AddHandler mod_xebra .xeb
  AddHandler mod_xebra .xrpc
  XebraServer_port 55001
  XebraServer_host "127.0.0.1"
  XebraServer_max_upload_size 10000000
  XebraServer_upload_path "/tmp"
  DirectoryIndex index.xeb
 <Files ~ "\.(ini|e|ecf)$">
  Order allow,deny
  Deny from all
 </Files>
 <Directory ~ "EIFGENs">
  Order allow,deny
  Deny from all
 </Directory>
</IfModule>
  • Also in httpd.conf, change DocumentRoot to {path to xebra}\www and don't forget the directory options below the line # This should be changed to whatever you set DocumentRoot to.
  • Create the directory /tmp or choose another temp upload directory.
  • Restart apache
$APACHE2/bin/apachectl restart
  • Browse to http://localhost/test.xeb. You should see a message saying Cannot connect to XebraServer. See apache error log.
  • Hint: keep an eye on the apache error log
tail -f $APACHE2/logs/error_log

Windows with Apache 2.2.11

Note

  • If mod_xebra.so was compiled with VS2008, it has a delay-load dependency on the Visual C++ 9.0 debug runtime library, msvcr90d.dll. This dll comes with Visual Studio 2008 C++ including the free Visual Studio 2008 C++ Express edition. This file can be copied in to the System32 directory. If this DLL is not found you will get an Apache error Cannot load C:/Xebra/httpd/modules/mod_xebra.so into server: This application has failed to start because the application configuration is incorrect.


  • Download apache windows binary from http://httpd.apache.org/download.cgi
  • Install (Choose Custom Installation and install Build Headers and Libraries as well)
  • Copy $XEBRA_DEV/c_projects/apache_mod_xebra/mod_xebra.so to your Apache2.2\modules folder.
    • Note: If you use a newer version of apache than 2.2.11 please compile mod_xebra yourself to avoid any possible errors, see Xebra Apache Module Windows.
  • Add the following lines to Apache2.2\conf\httpd.conf:
#Xebra Module
LoadModule xebra_module modules/mod_xebra.so
 
 <IfModule xebra_module>
  AddHandler mod_xebra .xeb
  AddHandler mod_xebra .xrpc
  XebraServer_port 55001
  XebraServer_host "127.0.0.1"
  XebraServer_max_upload_size 10000000
  XebraServer_upload_path "c:\tmp"
  DirectoryIndex index.xeb
 <Files ~ "\.(ini|e|ecf)$">
  Order allow,deny
  Deny from all
 </Files>
 <Directory ~ "EIFGENs">
  Order allow,deny
  Deny from all
 </Directory>
</IfModule>
  • Also in httpd.conf, change DocumentRoot to {path to xebra}\www and don't forget the directory options below the line # This should be changed to whatever you set DocumentRoot to.
  • Create the directory c:\tmp or choose another temp upload directory.
  • Restart Apache
  • Browse to http://localhost/test.xeb. You should see the a message saying Cannot connect to XebraServer. See apache error log.

Windows with IIS7

  • Open %XEBRA_DEV%\c_projects\iis_xebra_handler\XebraEventSourceInstaller\XebraEventSourceInstaller.sln in VS2008
  • Compile and run (This will install the XebraHandler source to the Windows Event Log. This cannot be performed by the handler because it lacks permissions.)
  • (Optional) Open %XEBRA_DEV%\c_projects\iis_xebra_handler\Xebra.sln in VS2008 and compile
  • Create a new site in IIS and point it to %XEBRA_DEV%\www
  • Copy %XEBRA_DEV%\c_projects\iis_xebra_handler\website\web.config to %XEBRA_DEV%\www
  • Copy %XEBRA_DEV%\c_projects\iis_xebra_handler\website\bin to %XEBRA_DEV%\www

Mac OS X with Apache

Note:

  • If you're using the version of EiffelStudio from MacPorts, environment variables must be set within the startup script. /Applications/MacPorts/Eiffel64/EiffelStudio/Contents/Resources/EiffelLauncher
  • Save yourself a ton of hassle and just sudo chmod -R 777 * both the $ISE_EIFFEL and $EIFFEL_SRC directories.
  • Get Apache V2 from Mac Ports
 sudo port install apache2
  • Copy $XEBRA_DEV/www/* to /opt/local/apache2/htdocs
  • Compile the module by running
cd $XEBRA_DEV/c_projects/apache_mod_xebra
sudo /opt/local/apache2/bin/apxs -c -Wc,-ggdb -I$ISE_EIFFEL/studio/spec/$ISE_PLATFORM/include mod_xebra.c mod_xebra.h
  • Install the module to apache by running
sudo /opt/local/apache2/bin/apxs -i mod_xebra.la
  • Prepare to edit the protected httpd.conf file by running the command:
 sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit
 Within TextEdit, which now is running under sudo, open /opt/local/apache2/conf/httpd.conf
  • Add the following lines to /opt/local/apache2/conf/httpd.conf:
#Xebra Module
LoadModule xebra_module modules/mod_xebra.so
 
 <IfModule xebra_module>
  AddHandler mod_xebra .xeb
  AddHandler mod_xebra .xrpc
  XebraServer_port 55001
  XebraServer_host "127.0.0.1"
  XebraServer_max_upload_size 10000000
  XebraServer_upload_path "/tmp"
  DirectoryIndex index.xeb
 <Files ~ "\.(ini|e|ecf)$">
  Order allow,deny
  Deny from all
 </Files>
 <Directory ~ "EIFGENs">
  Order allow,deny
  Deny from all
 </Directory>
</IfModule>
  • Also in httpd.conf, change DocumentRoot to {path to xebra}\www and don't forget the directory options below the line # This should be changed to whatever you set DocumentRoot to.
  • Create the directory /tmp or choose another temp upload directory.
  • The default MacPorts apache install will listen on port 80
  • Restart apache
sudo /opt/local/apache2/bin/apachectl restart
  • Browse to http://localhost/test.xeb. You should see a message saying "Cannot connect to XebraServer. See apache error log."
  • Hint: keep an eye on the apache error log
tail -f $APACHE2/logs/error_log

Compile the Translator and Server

  • First we need to compile the xebra precompile library:

Linux

ec -config $XEBRA_DEV/eiffel_projects/library/xebra_precompile/xebra_precompile.ecf -target xebra_precompile -c_compile -clean -precompile -project_path $XEBRA_DEV/eiffel_projects/library/xebra_precompile

Windows

ec -config %XEBRA_DEV%\eiffel_projects\library\xebra_precompile\xebra_precompile.ecf -target xebra_precompile -c_compile -clean -precompile -project_path %XEBRA_DEV%\eiffel_projects\library\xebra_precompile


  • Then run:

Linux

ec -config $XEBRA_DEV/eiffel_projects/xebra_translator/xebra_translator.ecf -target xebra_translator -c_compile -clean -finalize -project_path $XEBRA_DEV/eiffel_projects/xebra_translator
 
ec -config $XEBRA_DEV/eiffel_projects/xebra_server/xebra_server.ecf -target xebra_server -c_compile -clean -finalize -project_path $XEBRA_DEV/eiffel_projects/xebra_server

Windows

ec -config %XEBRA_DEV%\eiffel_projects\xebra_translator\xebra_translator.ecf -target xebra_translator -c_compile -clean -finalize -project_path %XEBRA_DEV%\eiffel_projects\xebra_translator
 
ec -config %XEBRA_DEV%\eiffel_projects\xebra_server\xebra_server.ecf -target xebra_server -c_compile -clean -finalize -project_path %XEBRA_DEV%\eiffel_projects\xebra_server

Test the installation

To test you installation run

Windows

%XEBRA_DEV%\apache\bin\httpd.exe
ec -config %XEBRA_DEV%\eiffel_projects\xebra_translator\xebra_translator.ecf -target xebra_translator -c_compile -clean -freeze -project_path %XEBRA_DEV%\eiffel_projects\xebra_translator
%XEBRA_DEV%\eiffel_projects\xebra_server\EIFGENs\xebra_server\F_code\xebra_server.exe %XEBRA_DEV%\eiffel_projects\xebra_server\config.srv -d 6

Linux

$XEBRA_DEV/apache/bin/httpd
$XEBRA_DEV/eiffel_projects/xebra_server/EIFGENs/xebra_server/F_code/xebra_server $XEBRA_DEV/eiffel_projects/xebra_server/config.srv -d 6

and then open

http://localhost/helloworld

in your web browser.

The server will then start compiling the xebra precompile library and generate the helloworld webapp. It can take a minute to do so the first time. While compiling you will see a page saying "Application 'helloworld' is compiling...". After a while hit F5 and you should see "Hello WORLD!" (or "Hello world!").