Difference between revisions of "Xebra Installation"

(Installation on Windows with IIS7 (under construction))
Line 47: Line 47:
 
* Define $XEBRA_DEV and checkout xebra from https://svn.eiffel.com/eiffelstudio/trunk/Src/framework/web/xebra/ to $XEBRA_DEV
 
* Define $XEBRA_DEV and checkout xebra from https://svn.eiffel.com/eiffelstudio/trunk/Src/framework/web/xebra/ to $XEBRA_DEV
  
==Install Apache==
+
==Install HTTP Server==
=== Ubuntu 9.04===
+
=== Ubuntu 9.04 with Apache ===
 
Note:
 
Note:
 
* Mod_xebra does currently not run with the apache distribution that comes with ubuntu.  
 
* Mod_xebra does currently not run with the apache distribution that comes with ubuntu.  
* If you do not install apache into the $XEBRA_DEV/httpd folder remember to copy the webapps from $XEBRA_DEV/httpd/htdocs to your htdocs folder.
 
  
  
* Download apache unix source httpd-2.2.11 from http://httpd.apache.org/download.cgi
+
* 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/httpd
Line 68: Line 67:
 
  $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.2\conf\httpd.conf:
#Xebra Module
+
<code>
LoadModule xebra_module modules/mod_xebra.so
+
#Xebra Module
 +
LoadModule xebra_module modules/mod_xebra.so
 +
 
 
  <IfModule xebra_module>
 
  <IfModule xebra_module>
 
   AddHandler mod_xebra .xeb
 
   AddHandler mod_xebra .xeb
 
   AddHandler mod_xebra .xrpc
 
   AddHandler mod_xebra .xrpc
   XebraServer_port "55001"
+
   XebraServer_port 55001
   XebraServer_host "localhost"
+
   XebraServer_host "127.0.0.1"
 
   XebraServer_max_upload_size 10000000
 
   XebraServer_max_upload_size 10000000
   LogLevel debug
+
   XebraServer_upload_path "/tmp"
 
   DirectoryIndex index.xeb
 
   DirectoryIndex index.xeb
  <Files ~ "\.(ini|e|ecf)$">
+
<Files ~ "\.(ini|e|ecf)$">
  Order allow,deny
+
  Order allow,deny
  Deny from all
+
  Deny from all
  </Files>
+
</Files>
  <Directory ~ "EIFGENs">
+
<Directory ~ "EIFGENs">
  Order allow,deny
+
  Order allow,deny
  Deny from all
+
  Deny from all
  </Directory>
+
</Directory>
</IfModule>
+
</IfModule>
 
+
</code>
* (After rev 79926) Change DocumentRoot to '[xebra]/www'
+
* Create the directory /tmp or choose another temp upload directory.
* The install script also changes the Listen Port from 80 to 55000. Change this if you wish to run this apache parallel to another webserver that uses port 80.
+
* Restart apache
 
+
* Restart apache (if necessary, you need to stop and start instead of restart)
+
 
  $APACHE2/bin/apachectl restart
 
  $APACHE2/bin/apachectl restart
 
* Browse to http://localhost/test.xeb. You should see a message saying "Cannot connect to XebraServer. See apache error log."
 
* 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
 
* Hint: keep an eye on the apache error log tail -f $APACHE2/logs/error_log
  
===Windows===
+
===Windows with Apache===
  
 
Note
 
Note
* If you do not install apache into the $XEBRA_DEV/httpd folder remember to copy the webapps from $XEBRA_DEV/httpd/httpd to your httpd folder.
+
* 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.'''
* mod_xebra.so 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 httpd-2.2.11 windows binary from http://httpd.apache.org/download.cgi
+
* Download apache windows binary from http://httpd.apache.org/download.cgi
 
* Install (Choose Custom Installation and install Build Headers and Libraries as well)
 
* Install (Choose Custom Installation and install Build Headers and Libraries as well)
 
* Copy [https://svn.origo.ethz.ch/eiffelstudio/trunk/Src/framework/web/xebra/c_projects/apache_mod_xebra/mod_xebra.so mod_xebra.so] to your Apache2.2\modules folder.
 
* Copy [https://svn.origo.ethz.ch/eiffelstudio/trunk/Src/framework/web/xebra/c_projects/apache_mod_xebra/mod_xebra.so mod_xebra.so] to your Apache2.2\modules folder.
 
* Add the following lines to Apache2.2\conf\httpd.conf:
 
* Add the following lines to Apache2.2\conf\httpd.conf:
 
<code>
 
<code>
#Xebra Module
+
#Xebra Module
LoadModule xebra_module modules/mod_xebra.so
+
LoadModule xebra_module modules/mod_xebra.so
 +
 
 
  <IfModule xebra_module>
 
  <IfModule xebra_module>
 
   AddHandler mod_xebra .xeb
 
   AddHandler mod_xebra .xeb
Line 116: Line 115:
 
   XebraServer_host "127.0.0.1"
 
   XebraServer_host "127.0.0.1"
 
   XebraServer_max_upload_size 10000000
 
   XebraServer_max_upload_size 10000000
   LogLevel debug
+
   XebraServer_upload_path "c:\tmp"
 
   DirectoryIndex index.xeb
 
   DirectoryIndex index.xeb
 
  <Files ~ "\.(ini|e|ecf)$">
 
  <Files ~ "\.(ini|e|ecf)$">
Line 128: Line 127:
 
</IfModule>
 
</IfModule>
 
</code>
 
</code>
* (After rev 79926) Change DocumentRoot to '[xebra]/www'
+
* Create the directory c:\tmp or choose another temp upload directory.
 
* Restart Apache
 
* Restart Apache
 
* Browse to http://localhost/test.xeb. You should see the a message saying "Cannot connect to XebraServer. See apache error log."
 
* Browse to http://localhost/test.xeb. You should see the a message saying "Cannot connect to XebraServer. See apache error log."
  
=== Mac OS X ===
+
 
 +
===Windows7 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:
 
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
 
* 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
Line 139: Line 149:
 
* Get Apache V2 from Mac Ports
 
* Get Apache V2 from Mac Ports
 
   sudo port install apache2
 
   sudo port install apache2
* Copy $XEBRA_DEV/httpd/* to /opt/local/apache2/htdocs
+
* Copy $XEBRA_DEV/www/* to /opt/local/apache2/htdocs
 
* Compile the module by running
 
* Compile the module by running
 
  cd $XEBRA_DEV/c_projects/apache_mod_xebra
 
  cd $XEBRA_DEV/c_projects/apache_mod_xebra
Line 149: Line 159:
 
   Within TextEdit, which now is running under sudo, open /opt/local/apache2/conf/httpd.conf
 
   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:
 
* Add the following lines to /opt/local/apache2/conf/httpd.conf:
#Xebra Module
+
<code>
LoadModule xebra_module modules/mod_xebra.so
+
#Xebra Module
 +
LoadModule xebra_module modules/mod_xebra.so
 +
 
 
  <IfModule xebra_module>
 
  <IfModule xebra_module>
 
   AddHandler mod_xebra .xeb
 
   AddHandler mod_xebra .xeb
 
   AddHandler mod_xebra .xrpc
 
   AddHandler mod_xebra .xrpc
   XebraServer_port "55001"
+
   XebraServer_port 55001
   XebraServer_host "localhost"
+
   XebraServer_host "127.0.0.1"
 
   XebraServer_max_upload_size 10000000
 
   XebraServer_max_upload_size 10000000
   LogLevel debug
+
   XebraServer_upload_path "/tmp"
 
   DirectoryIndex index.xeb
 
   DirectoryIndex index.xeb
  <Files ~ "\.(ini|e|ecf)$">
+
<Files ~ "\.(ini|e|ecf)$">
  Order allow,deny
+
  Order allow,deny
  Deny from all
+
  Deny from all
  </Files>
+
</Files>
  <Directory ~ "EIFGENs">
+
<Directory ~ "EIFGENs">
  Order allow,deny
+
  Order allow,deny
  Deny from all
+
  Deny from all
  </Directory>
+
</Directory>
</IfModule>
+
</IfModule>
* (After rev 79926) Change DocumentRoot to '[xebra]/www'
+
</code>
 +
* Create the directory /tmp or choose another temp upload directory.
 
* The default MacPorts apache install will listen on port 80
 
* The default MacPorts apache install will listen on port 80
 
+
* Restart apache  
* Restart apache (if necessary, you need to stop and start instead of restart)
+
 
  sudo /opt/local/apache2/bin/apachectl restart
 
  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."
 
* Browse to http://localhost/test.xeb. You should see a message saying "Cannot connect to XebraServer. See apache error log."
Line 205: Line 217:
  
 
===Run the Xebra Server===
 
===Run the Xebra Server===
 
 
See [[Xebra Server Administration|Server Administration]] for how to run the server.
 
See [[Xebra Server Administration|Server Administration]] for how to run the server.
 
=Installation on Windows with IIS7 (under construction)=
 
 
== Setup IIS==
 
* Open ''{XEBRA}\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 can not be performed by the handler because it lacks permissions.)
 
* (Optional) Open ''{XEBRA}\c_projects\iis_xebra_handler\Xebra.sln'' in VS2008 and compile
 
* Create a new site in IIS and point it to ''{XEBRA}\www''
 
* Copy ''{XEBRA}\c_projects\iis_xebra_handler\website\web.config'' to ''{XEBRA}\www''
 
* Copy ''{XEBRA}\c_projects\iis_xebra_handler\website\bin'' to ''{XEBRA}\www''
 

Revision as of 09:20, 24 August 2009

About | Installation | Documentation | Tutorials | Frequently Asked Questions


Installations

There are two ways to install Xebra:

  • Automatic (Installer/Script)
  • Manual (Step-by-step guide)

Information.png Note: This tutorial was tested with Xebra revision 79737, EiffelStudio 6.5.7.9553 ($ISE_EIFFEL) and $EIFFEL_SRC revision 79737. The env vars $EIFFEL_SRC, $ISE_EIFFEL, $ISE_PLATFORM and $ISE_LIBRARY are expected to be set. ISE_LIBRARY is set to EIFFEL_SRC

Ubuntu Installation Script

There is an installation script available at https://svn.eiffel.com/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, install and configure apache 2.2.11 to $XEBRA_DEV/httpd. 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 see tutorials for how to start the server.

Windows Installer (NEW)

There is a windows installer available for revision 80396 at https://svn.origo.ethz.ch/eiffelstudio/trunk/Src/framework/web/xebra/tools/installer/win/innosetup/output/setup.exe

It was tested with Eiffel Studio Eiffel65_gpl_80294-windows.msi and Windows XP SP2.

You have to adapt two 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_terminal_source.e:
    • In the feature arguments: ARRAY [STRING] replace the line
create Result.make (1, l_count)

with

create Result.make_filled ("", 1, l_count)
  • In the class 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)

Manual Installation

Checkout Xebra

Install HTTP Server

Ubuntu 9.04 with Apache

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/httpd
  • Run the following commands in the extracted folder:
CFLAGS="-ggdb"
./configure --prefix={path were apache should be installed}
make
make install
  • Compile the module by running
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
  • Install the module to apache by running
$APACHE2/bin/apxs -i mod_xebra.la
  • 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 "/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>
  • 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

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 mod_xebra.so to your Apache2.2\modules folder.
  • 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>
  • 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."


Windows7 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>
  • 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 -experiment -config $XEBRA_DEV/eiffel_projects/library/xebra_precompile/xebra_precompile.ecf -target xebra_precompile -c_compile -clean -precompile

Windows

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


  • Then run:

Linux

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

Windows

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

Run the Xebra Server

See Server Administration for how to run the server.