Deploying IntraWeb standalone application in a Wine/Linux
system
Note: The information on this page has to be
considered as EXPERIMENTAL and ALPHA. That is we do not
guarantee in any way that the steps described below will work for you. Also do
not use the described technique in a production system.
We are currently evaluating the possibilities of
deploying IntraWeb applications to Linux via Wine. This is a basic list of
steps, to get that going:
- Getting the software
- First of all, I use Debian testing (Sarge) but there should be no
problems with your favourite distribution. For the remaining of this post
I'll indicate each Debian specific command with (*Debian*).
If you want
to give Debian a try (why not) you can get a Sarge netinst cd image
here: http://cdimage.debian.org/pub/cdimage-testing/sarge_d-i/i386/rc3/sarge-i386-netinst.iso It's
'only' one 100MBytes iso. As the name suggest, most of the system (depending
also on your package selection) will be installed from the Internet.
- Wine, Winetools and all other related utilities can be found
here:
www.winehq.com/site/download
- Installation
- Wine, Winetools and related packages installation.
On Debian you
simply have to add the following line to your /etc/apt/sources.list
file: deb http://wine.sourceforge.net/apt/ binary/ (*Debian*) Then
with
# apt-get update # apt-get install wine winetools wine-utils
(*Debian*)
All the Wine and related software is
installed.
- Configuration
- Wine user
If you need to deploy an IntraWeb application
that listen on a port < 1024 you must perform all the Wine configuration
logged as root user. However it is still possible to configure and run Wine
as non privileged user using a reverse-proxy like Pound:
www.apsis.ch/pound/index_html
Pound has a subset of OctaGate's features. This reverse-proxy can be used
to dispatch incoming requests to one or more IntraWeb application(s)
listening on several port/ip. This feature makes possible to have one or
more IntraWeb application(s) listening on unprivileged port and thus to run
the IntraWeb application(s) under Wine with non privileged user.
-
Wine environment All the Wine files are placed under ~.wine/ where '~'
is the user home directory. The 'C:\' drive will be placed in
~.wine/drive_c/ (symlinked to ~.wine/c/)
- Wine configuration
I assume that X is properly installed and
configured. If not:
# apt-get install x-window-system fluxbox (*Debian*)
From an xterm session (logged as root)
type # winetools Then follow these steps:
- Base setup -> Create a fake windows drive
- Base setup -> DCOM98
- Base setup -> Internet Explorer 6.0 SP1
- Install Windows system software -> Windows Installer
- Install Windows system software -> Microsoft Foudation Classes 4.0
- Install Windows system software -> Visual C++ run-time
- Install Windows system software -> MDAC 2.8
- Install Windows system software -> Common Controls
5.0
That's all. Almost for sure not all the packages from 1) to 8)
are strictly required to our purposes. Feel free to experiment if you're
worried about disk space or unnecessary dll boot loading.
- Running Windows executables
At this point your Wine configuration is
quite finished. You can run your .exe file with the command
# wine <exe-file> The <exe-file> could reside anywhere in the Linux
filesystem but It's advisable that you put it under the 'C:\' drive (
~.wine/drive_c ) before starting it up.
- Database drivers
If your IW application system needs an odbc driver,
you can install it (with # wine <exe-installation-file>) and configure
in the control center. The control center is accessible from the main
winetools menu.
- Starting the IntrawebApplication
This is rather simple. In an xterm
session type:
# wine <your-application-filename>
- X-Window configuration for dedicated IW deployment server
All the steps
permormed so far to start our IntraWeb .exe require that a user logs in and
issues some commands. In order to fully automate the IntraWeb application(s)
launch you can configure X to start automatically the IntraWeb application(s)
at the end of the startup process. First you have to know the final runlevel
at which your distribution sets at the end of the boot sequence. In Debian
this runlevel is 2. You can find the current runlevel simply with the
command: # runlevel
Then follow these steps:
- create a file named '/etc/init.d/ziwstart'. This file should contain the
following
lines:
#!/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11 HOME=/root export PATH HOME /usr/X11R6/bin/xinit
-
make the file executable with the command
# chmod +x /etc/init.d/ziwstart
- symlink the above file in the startup directory /etc/rc2.d
# ln -s /etc/init.d/ziwstart /etc/rc2.d/S99ziwstart Please note that /etc/rc2.d
was chosen because the final runlevel of Debian is 2. If your distribution
ends with runlevel 7 you have to use /etc/rc7.d in the lines above
- create a file named root.xinitrc with the following
content:
/usr/bin/wine root.wine/c/<exe-file1> & /usr/bin/wine root.wine/c/<exe-file2> & /usr/bin/wine root.wine/c/<exe-file3> where
<exe-file*> are the exe application(s) you want to load at the system
startup. If you want to start only one .exe, the ampersands
('&') are not needed.
- Disable any display manager like xdm, gdm, kdm. Simply edit the startup
batch file found int /etc/init.d/ or elsewhere. For example on Debian xdm is
installed with x-window. To disable it, you can edit the file
/etc/init.d/xdm and put 'exit' (without quotes) on the first line.
- if you fear that your IntraWeb application can quit due to an unhandled exception :-) , you can substitute the last line of the file '/etc/init.d/ziwstart' created at point a) with the following:
while (true) do
/usr/X11R6/bin/xinit;
done
- reboot and enjoy.
|