Slava – Helicon Tech Blog http://www.helicontech.com/articles Web Server Enhancements Wed, 20 Mar 2013 14:48:17 +0000 en-US hourly 1 https://wordpress.org/?v=5.2.4 Deploying Java Servlet applications on Windows with IIS http://www.helicontech.com/articles/deploying-java-servlet-applications-on-windows-with-iis/ http://www.helicontech.com/articles/deploying-java-servlet-applications-on-windows-with-iis/#comments Thu, 19 Apr 2012 14:41:25 +0000 http://www.helicontech.com/articles/?p=926 Continue reading ]]> Java platform is extremely successful in building robust and high performance web applications. Platform independence is one of the strength of Java engine and Helicon Zoo now provides a convenient way to deploy and run Java web applications on Windows platform with Microsoft IIS. To deploy Java Servlet application on IIS 7 you will only need to follow this simple instruction:

Platfrom installation

  1. Download and install Web Platform Installer.
  2. Run Web Platform Installer and click “Options”.
  3. Add Helicon Zoo feed into Display additional scenarios box:  http://www.helicontech.com/zoo/feed. New “Zoo” tab will appear.
  4. Go to the Zoo, Packages and install Java Hosting Package.
  5. Accept licenses to start installation process.

Alternatively, instead of installing Java Hosting Package you can install Modules –> Helicon Zoo Module and Engines –> Jetty separately. This is minimal requirement to run Java Servlet applications under Microsoft IIS web server. If you want to run Java Servlets under IIS Express and WebMatrix in your development environment, then you will also need to install Helicon Zoo Module for IIS Express form Engines section.

This is enough configuration to run most of Java Servlet applications directly form IIS.

Installing application

Launch IIS Manager and create new web-site or an application within a web-site. Copy your Java application into the root folder of this IIS application. Java application could be either a single .war file or set of unpacked files with directory structure, including web-inf folder. Then just create the following web.config:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <heliconZoo>
      <application name="jetty.project" >
        <environmentVariables>
          <!-- Uncomment line below if you want to set contexts directory -->
          <!--  <add name="CONTEXTS_DIR" value="%APPL_VIRTUAL_PATH%" /> -->

          <!-- Optional variables: -->
          <!-- <add name="CONTEXT_PATH" value="%APPL_VIRTUAL_PATH%" /> -->
          <!-- <add name="WAR_EXTRACT_PATH" value="%APPL_PHYSICAL_PATH%" /> -->

          <!-- A WAR file or start directory to run -->
          <add name="WAR_FILE" value="my_application.war" />
        </environmentVariables>
        </application>
    </heliconZoo>

        <handlers>
          <add name="jetty.project#x86" scriptProcessor="java.jetty" 
            path="*" verb="*" modules="HeliconZoo_x86" 
            preCondition="bitness32" resourceType="Unspecified" 
            requireAccess="Script" />
          <add name="jetty.project#x64" scriptProcessor="java.jetty" 
            path="*" verb="*" modules="HeliconZoo_x64" 
            preCondition="bitness64" resourceType="Unspecified" 
            requireAccess="Script" />
        </handlers>
  </system.webServer>
</configuration>

Please take a look at <environmentVariables> section.

  • CONTEXTS_DIR — optional path to directory with .xml files which describe Jetty contexts. If this variable isn’t set, Zoo looks for “contexts” folder in the root of application. If no such folder found, Zoo presumes the application has single context and uses variables described below.
  • CONTEXT_PATH — optional virtual path of the application. Default value is taken from APPL_VIRTUAL_PATH variable.
  • WAR_FILE — optional path to a .war file or directory with extracted application.
  • WAR_EXTRACT_PATH — optional .war file extraction path. Is set to application’s root folder by default.

Here is an example of context.xml file that you may use instead of setting WAR file name explicitly. This allows to run multiple applications and contexts in a single IIS web site.

contexts/context.xml

<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">

<Configure class="org.eclipse.jetty.webapp.WebAppContext">

   <Set name="contextPath">/application</Set>
   <Set name="war">my_application.war</Set>
   <Set name="tempDirectory">application_dir</Set>

</Configure>

WARNING: Since WAR files need to be extracted before execution you will need to have a folder with write permissions.  In default IIS installation all application pools are executed with permissions of IIS_IUSRS group which does not have write permissions to the web application folders. You will need to provide write permissions to the user running Application Pool or IIS_IUSRS group to the folder containing Java application or specify other folder using WAR_EXTRACT_PATH variable with write permissions provided.

Now you can open IIS web site in the browser and see your Java web application running.

That’s it! Installation process is clear and automatic and will only take several minutes.

]]>
http://www.helicontech.com/articles/deploying-java-servlet-applications-on-windows-with-iis/feed/ 5
Installing Magnolia CMS on Windows with IIS. http://www.helicontech.com/articles/installing-magnolia-cms-on-windows-with-iis/ Thu, 19 Apr 2012 13:49:58 +0000 http://www.helicontech.com/articles/?p=872 Continue reading ]]> Magnolia CMS is probably the most popular Java-based content management system. There are free and commercial versions available. We are going to show you an easy way to deploy Magnolia on Microsoft IIS web server using Helicon Zoo with a single .war file.

This instruction is outdated as Helicon Zoo repository now include Magnolia CMS Community Edition, that you can easily install by choosing Zoo –> Applications –> Magnolia CMS.

Platform installation

First we need to configure our Windows server to run Java Servlet applications. Follow these steps to accomplish this task.

  1. Download and install Web Platform Installer.
  2. Run Web Platform Installer and click “Options”.
  3. Add Helicon Zoo feed into “Display additional scenarios” box:  http://www.helicontech.com/zoo/feed. New “Zoo” tab will appear.
  4. Go to the “Zoo” tab and find “Jetty” among the products list. Click on “Add” against “Jetty”.
  5. Also find “Helicon Zoo Module” or “Helicon Zoo Module for IIS Express” depending on the server you are using. Click “Add” respectively.
  6. Click “Install” to start installation process.

Alternatively, instead of installing Helicon Zoo Module and Jetty separately you may just go to Packages section of Zoo tab and install Java Hosting Package. This will install Helicon Zoo Module for IIS, Jetty and all other requirements to run Java Servlet applications under Microsoft IIS web server. If you want to run Java Servlets under IIS Express and WebMatrix in your development environment, then you need to install Helicon Zoo Module for IIS Express form Engines section.

This is enough configuration to run most of Java Servlet applications directly form IIS.

Magnolia installation

There are many ways to install Magnolia. Some of them you may find in the documentation. We are going to use a free Community edition which can be downloaded here sourceforge.net/projects/magnolia/files/magnolia/
Please download “magnolia-bundled-webapp…” package as it already contains required components to run Magnolia CMS. Open folder with latest version of CMS and download the .war file available. After downloading .war file, please launch IIS Manager and create new web-site or application. Copy downloaded .war file into this web-site’s root folder and create the following web.config near it:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
	<heliconZoo>
	  <application name="magnolia.project" >
	      <environmentVariables>
		  <add name="WAR_FILE" value="magnolia-bundled-webapp-4.5.1.war" />
		  <add name="WAR_EXTRACT_PATH" value="%APPL_PHYSICAL_PATH%" />
		</environmentVariables>
        </application>
	</heliconZoo>

    	<handlers>
      	<add name="magnolia.project#x86" scriptProcessor="java.jetty" path="*" verb="*" modules="HeliconZoo_x86"
             preCondition="bitness32" resourceType="Unspecified" requireAccess="Script" />
      	<add name="magnolia.project#x64" scriptProcessor="java.jetty" path="*" verb="*" modules="HeliconZoo_x64"
             preCondition="bitness64" resourceType="Unspecified" requireAccess="Script" />
    	</handlers>
  </system.webServer>
</configuration>

Please take a look at <environmentVariables> section. Only “WAR_FILE” variable is required and should contain either path to a WAR file or to a folder containing unpacked Java Servlet application.
WAR_EXTRACT_PATH variable can be used to configure location where to unpack WAR file content. By default it is IIS application root folder. CONTEXT_PATH variable needed by Java application and contains IIS application virtual path by default.

That’s it. You may now open the web-site in browser to start Magnolia. Please note, first launch is going to be long and will start with installation page:

Click “Start install” to begin installation:

When installation is complete, click “Start up Magnolia” and you’ll see login form. Enter default login “superuser” and password “superuser”.

Magnolia comes with demo data and templates:

Resume

As you can see we’ve installed Magnolia CMS easily in very few steps. Naturally you may deploy any .war file in the same way.

]]>
Installing Open Blue Dragon on Windows with IIS. http://www.helicontech.com/articles/installing-open-blue-dragon-on-iis/ Thu, 19 Apr 2012 11:27:16 +0000 http://www.helicontech.com/articles/?p=915 Continue reading ]]> OpenBD (Open Blue Dragon) is a powerful open-source CFML engine. Here we are going to show you how to deploy it on IIS with the help of Helicon Zoo.

Environment installation

First we need to configure our Windows server to run Java Servlet applications. This is easily doable using following instructions.

  1. Download and install Web Platform Installer.
  2. Run Web Platform Installer and click “Options”.
  3. Add Helicon Zoo feed into “Display additional scenarios” box:  http://www.helicontech.com/zoo/feed. New “Zoo” tab will appear.
  4. Go to the Zoo -> Packages and install Java Hosting Package.
  5. Accept licenses to start installation process.

 

     

    Alternatively, instead of installing Java Hosting Package you can install Modules –> Helicon Zoo Module and Engines –> Jetty separately. This is minimal requirement to run Java Servlet applications under Microsoft IIS web server. If you want to run Java Servlets under IIS Express and WebMatrix in your development environment, then you will also need to install Helicon Zoo Module for IIS Express form Engines section.

     

    This is enough configuration to run most of Java Servlet applications directly form IIS.

OpenBD installation

Download “J2EE Standard WAR” on http://www.openbluedragon.org/download/. Launch IIS Manager and create new web-site or an application. Copy downloaded .war file into your web-site’s or application’s root folder and create the following web.config:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <heliconZoo>
      <application name="openbd.project" >
        <environmentVariables>
          <!-- Uncomment line below if you want to set contexts directory -->
          <!--  <add name="CONTEXTS_DIR" value="%APPL_VIRTUAL_PATH%" /> -->

          <!-- Optional variables: -->
          <!-- <add name="CONTEXT_PATH" value="%APPL_VIRTUAL_PATH%" /> -->
          <!-- <add name="WAR_EXTRACT_PATH" value="%APPL_PHYSICAL_PATH%" /> -->

          <!-- A WAR file or start directory to run -->
          <add name="WAR_FILE" value="openbd.zip" />
        </environmentVariables>
        </application>
    </heliconZoo>

        <handlers>
          <add name="openbd.project#x86" scriptProcessor="java.jetty"
            path="*" verb="*" modules="HeliconZoo_x86"
            preCondition="bitness32" resourceType="Unspecified"
            requireAccess="Script" />
          <add name="openbd.project#x64" scriptProcessor="java.jetty"
            path="*" verb="*" modules="HeliconZoo_x64"
            preCondition="bitness64" resourceType="Unspecified"
            requireAccess="Script" />
        </handlers>
  </system.webServer>
</configuration>

Please take a look at <environmentVariables> section. Only “WAR_FILE” variable is required and should contain either path to a WAR file or to a folder containing unpacked Java Servlet application.
WAR_EXTRACT_PATH variable can be used to configure location where to unpack WAR file content. By default it is IIS application root folder. CONTEXT_PATH variable needed by Java application and contains IIS application virtual path by default.

WARNING: Since WAR files need to be extracted before execution you will need to have a folder with write permissions.  In default IIS installation all application pools are executed with permissions of IIS_IUSRS group which does not have write permissions to the web application folders. You will need to provide write permissions to the user running Application Pool or IIS_IUSRS group to the folder containing OpenBD application or specify other folder using WAR_EXTRACT_PATH variable with write permissions provided.

That’s it. You may now start OpenBD by opening IIS web site in the browser:

You can copy CFML applications into “webapps” folder of OpenBD web site. There are “manual” and “bluedragon” already. The latter one is actually an administration panel for your OpenBD installation:

Resume

As you can see we’ve installed OpenBD easily in very few steps. Naturally you may deploy any .war file in the same way.
Cheers 🙂

]]>