Deployment on Windows

Stand-alone XApp with Morfik Apache 1.3

Deploying an XApp a simple 2-step process:

  1. first install the relevant project files, and then
  2. install the Firebird database engine along with some Apache dll files.

The .EXE, .MXD and .MXR (and the _Resource folder and all its contents, in the case the Package Resources option is unticked) is all that is required to be deployed onto the host machine.


Install relevant Firebird and Apache files

An installation of the Firebird database engine and the presence of Apache dlls are required on your deployment PC in order to run your Morfik Applications (xApps). Please note that this is not an installation of a set of frameworks; it is just a simple installation of Firebird and Apache dlls. You have two choices for the Firebird install:


Firebird Embedded (and Apache) Installer
Firebird Embedded database engine and Appache dlls are installed with this deployment kit. This installation is more suitable for the initial XApp testing. Using the Embedded version of Firebird means that only one application can access your database at a time, which is usually your XApp. Please use the Firebird Server installation if you wish to connect to external shared Firebird databases or use other utilities such as database backup tools.
Embedded Firebird and Apache Installer Download


Firebird Server and Apache Installer
Firebird Server database engine and Apache dlls are installed with this deployment kit. This installer installs Firebird database engine Server on your deployment pc which (unlike Firebird Embedded) allows multiple connection to your project Database. You will need multiple connection to your database for backup purposes or if your project database is accessed by multiple XApps.
Firebird Server and Apache Installer Download


Deploying Stand-alone xApp Projects

  1. Install one of the above Firebird-Apache installers
  2. Copy across your XApp project files (.exe, .mxd., .mxr, and .wsdl) to the deployment computer
  3. Double-click on the .exe file
  4. a. If this does not produce an error, then go to Step 4b, otherwise go to step 4d.
    b. Right-click on the XApp icon in the system tray.
    c. Select "Install as a Service" and then select "Shutdown". All Done!
    d. Check to see if the following file exists in the same folder as ..\Project1\_Project1Cache\Xapp.log where the folder \project\ directory contains the relevant .exe file). Note that the _Project1Cache folder is hidden.
  5. If the log file exists then go to step 7
  6. a. Open up your project in the Morfik.
    b. Go to the Project -> Project Options window
    c. Select the "Startup log" option.
    d. Compile your project again.
    e. Go to step 2.
  7. If the log file indicates an error similar to the following:
    "Unable to connect to the Firebird database server; the XApp will now terminate" then continue to step 8a.
    If the log indicates a different type of error has occurred than contact
    Morfik via the forums to enquire how we can help you resolve your deployment issues.
  8. a. Go to the control panels
    b. Double click on the "Firebird Server Manager" Control Panel
    c. Click 'STOP'
    d. Select 'Run as an application' and then Click 'START'
    e. Run the Xapp by double-clicking the .exe file
  9. a. Right-click on the XApp icon in the system tray.
    b. Select "Install as a Service" and then select "Shutdown"
  10. a. In the Firebird Server Manager control panel again select "STOP"
    b. Select "Run as Service" and then "START"
    c. Exit the Firebird Server Manager Control Panel.
  11. a. Select the "Adminitrative Tools" control panel
    b. Select "Services"
    c. Select your XApp
    d. Right-click and select "Run"


Morfik Plug-in with Morfik Apache 1.3

Multiple Morfik applications can be run on the same PC provided that they run on different HTTP Ports. However there are times when you may have to run multiple applications on a single port, mainly port 80.


Creating a Host XApp

The first step for setting up the environment for running plug-in XApps is to compile a host XApp which will host the plug-ins XApps. A host XApp is a blank project with the port number under which the plug-ins XApps will run.

Create a new project and choose a name for it (in this example we use the name "host" for the host XApp project). Compile the project as “Stand-Alone XApp” under “Project” menu “Project Options” (this is the default option). Choose the port which will be used on the server for the plug-in XApp projects.

After a successful compilation there should be a host.exe file inside the project folder. Copy this file along with host.mxd and host.mxr to the server where the plug-in XApps will run.

Also there is a need to install “Morfik Firebird Server and Apache Installer1.1.0.exe” on the same server.

  • Make sure Firebird SQL server is running.
  • Double click on host.exe file and start the host XApp.
  • Right mouse click on your host icon on the Task Bar and run the project as a service (optional).
  • Create a text file in the same folder where the host XApp is located and call this file yourproject.ini (in this case host.ini).
  • Now you are ready to compile and deploy the plug-in XApps.


Deploying Plug-in XApp Projects

Compile the plug-in XApps (in this example we use myXApp1 and myXApp2 for the name of these plug-in projects) choosing “Morfik Plug-in XApp” from “Binary” drop down box under “Project Options” of “Project” menu. After a successful compilation, copy myXApp1.dll, myXApp1.mxd, myXApp1.mxr and any other files specific to this project to a folder on the server (create a folder called myXApp1 under the folder where the host XApp on the server is located. eg. c:\host\myXApp1 ).

Do the same as above for myXApp2 project.

  1. Open host.ini (should have been created in earlier steps) file and add the following entries in it and save the file.
    [XAppPlugins]
    Plugin1=myXApp1
    Plugin2=myXApp2
    [myXApp1]
    Name=myXApp1
    Path=C:\host\myXApp1\myXApp1.dll
    Host=myXApp1.mydomain.com
    [myXApp2]
    Name=myXApp2
    Path=C:\host\myXApp2\myXApp2.dll
    Host=myXApp2.mydomain.com
  2. Before the plug-in XApps can be reached the host XApp needs to be restarted. (Go to Windows services and restart host service).
  3. Once the host XApp is running, each plug-in XApp and the host XApp can be accessed using their corresponding URLs.
  4. If a port other than 80 is choosen for the project, the port needs to be specified in the URL address when accessing the plug-ins.
  5. This method of deployment relies on domain/sub-domain name resolution on the server so for every XApp created a DNS entry is needed in order to access it.

Apache Native Plug-in XApp with Apache 2.2

To prepare the server for deploying your XApps:

  • Install Apache 2.2 on the server (if it is not already installed).
  • Install Firebird 2.1 on the server.
  • Copy MFKUDF.dll to the UDF folder of the Firebird installation.

To deploy your XApp:

  1. Open your project (let's call it Project1) in the Morfik IDE.
  2. Go to Morfik Options, Compiler tab, set the Binary Kind to "Apache Plug-in XApp".
  3. Compile the project.
  4. Copy the following files and folders to the modules folder of your Apache installation:
    Project1.mxr
    Project1.mxd
    Project1.dll
    _Project1Resources
  5. Open Apache's httpd.conf file in notepad.
  6. Add the following line after the other LoadModule statements in the httpd.conf file:
    LoadModule project1_module modules/project1.dll
  7. Add the following line at the end of the httpd.conf file:
    <Location /project1>
         Options Indexes FollowSymLinks MultiViews +ExecCGI
         SetHandler project1-handler
         Order deny,allow
         Allow from all
    </location>
  8. Restart the Apache service.

To view your XApp:

  • You should now be able to access the XApp via a web browser using the following URL:
http://address-of-your-server/project1

Note: Appache is case sensetive when it comes to virtual directory. Morfik convention is to use lowercase letters everywhere including files names, the path and the url address.

IIS Plug-in XApp with IIS 6.0

Tested under Windows 2003 with IIS 6.0


To compile your project as a plug-in for IIS 6

  1. In the IDE, from the main menu choose “Morfik Options”.
  2. On the “Compiler” tab in the “Options” Dialog box, select “IIS Plug-in XApp” from “Binary” drop down box and click on “OK” button.
  3. Compile your project.

If compilation is successful you should see a file called your-project.dll (replace your-project with the name of your project) created under the directory your project files are under.

IIS 6 is a lot more secure than previous versions and it adds some powerful features and flexibilities for running and maintaining your sites and applications. There are many ways you can run your XApps under IIS, the aim of this basic instruction is only to show you one of the easiest way you can get your XApps running under IIS. There are a lot more, for example if you need multiple applications running under the same server in isolation mode or if you need to implement a higher level of security or performance, but those topics are beyond the scope of these simple instructions.


To run your project under IIS 6

  1. You need a computer or a server with Microsoft Windows 2003 or XP with IIS and Firebird SQL 2 installed. (After installing Firebird place mfkudf.dll in the Firebird UDF folder).
  2. Copy all your necessary files (including your-project.dll, your-project.mxd, your-project.mxr and any other files) to a suitable folder.
  3. sure your XApps are allowed to run as Extensions under IIS. To do this, in IIS console expand “Web Services Extensions” node and either select “All unknown ISAPI Extensions” and click on “Allow” button (this method is not secure) or use “Add a new web services extension …” link under the same node to add your XApp to the allowed list.
  4. From IIS management Console. Expand “Web Sites” node.
  5. Right mouse click on “Default Web Site”.
  6. From the “New” menu select “Virtual Directory”.
  7. A wizard dialog pops up. Click next.
  8. Enter an Alias name for your XApp and click next.
  9. Browse to the folder where your XApp project files were copied to, select and click next.
  10. Select “Read” and “Execute” options.
  11. Click next and finish the wizard.
  12. If you expand the “Default Web Site” node of the MS IIS Console, you should see the alias name you chose for your XApp under this node.
  13. To test your XApp, in the address bar of IE or Firefox (or whatever your browser is) type http://address-of-your-server/alias-name/your-project.dll and press enter.


Troubleshooting

  • To get your project working under IIS 6, you may need to add The "Network Services" user (a windows built in account) to your project folder under IIS and give "Network Services" full access to your project folder. That should get your project running under IIS 6 if you experience similar problems.

IIS Plug-in XApp with IIS 7.0

Tested under Windows Vista with IIS 7.0


To compile your project as a plug-in for IIS 7

  1. In the IDE, from the main menu choose “Morfik Options”.
  2. On the “Compiler” tab in the “Options” Dialog box, select “IIS Plug-in XApp” from “Binary” drop down box and click on “OK” button.
  3. Compile your project.

If compilation is successful you should see a file called your-project.dll (replace your-project with the name of your project) created under the directory your project files are under.

IIS 7 is a lot more secure than previous versions and it adds some powerful features and flexibilities for running and maintaining your sites and applications. There are many ways you can run your XApps under IIS, the aim of this basic instruction is only to show you one of the easiest way you can get your XApps running under IIS. There are a lot more, for example if you need multiple applications running under the same server in isolation mode or if you need to implement a higher level of security or performance, but those topics are beyond the scope of these simple instructions.


To run your project under IIS 7

  1. You need a computer or a server with Microsoft Windows Vista with IIS 7 installed. (Note: when installing IIS 7, you must remember to tick the ISAPI Extensions checkbox, as it is not ticked by default.)
  2. Install Firebird 2.0. (After installing Firebird place mfkudf.dll in the Firebird UDF folder.)
  3. Copy all necessary project files (including your-project.dll, your-project.mxd, your-project.mxr and any other files) to a suitable folder, e.g. c:\Samples.
  4. Open the Internet Information Services (IIS) Manager.
  5. In the Connections panel, navigate to the Default Web Site node, then right-click >> Add Virual Directory.
  6. In the Add Virtual Directory dialog, enter an alias for your xapp (e.g. "Project1") and the physical path to your xapp (e.g. "c:\Samples\Project1"); click OK.
  7. Double-click on the Handler Mappings icon (note: if you cannot see this icon, click the Features View button at the bottom of the screen).
  8. In the Handler Mappings list, select ISAPI-dll, then click on Edit Handler Permissions in the Actions panel.
  9. In the Edit Handler Permissions dialog, ensure the Read, Script and Execute checkboxes are all ticked; click OK.
  10. In the Connections panel, navigate to the top-level node (the one showing your computer name).
  11. Double-click on the ISAPI And CGI Restrictions icon (note: if you cannot see this icon, click the Features View button at the bottom of the screen).
  12. In the Actions panel, click on Add....
  13. In the Add ISAPI or CGI Restriction dialog, enter the absolute filename of your xapp (e.g. "c:\Samples\Project1\Project1.dll"), and tick Allow Extension Path To Execute; click OK.
  14. In the Connections panel, navigate to the Default Web Site node, then right-click >> Start (note: skip this step if it is already started).
  15. To test your XApp, in the address bar of IE or Firefox (or whatever your browser is) type http://address-of-your-server/alias-name/your-project.dll and press enter.

Related Topics


Back to top