EPF Wiki Installation Guide

From Eclipsepedia

Jump to: navigation, search

This guide describes how to install EPF Wiki 1.6 using the Windows Web Server 2008 with IIS. EPF Wiki 1.6 is based on Rails 3.1.4. This guide can be used as starting point for creating a production environment for EPF Wiki based on IIS. Any edition of Windows Server 2008 may be installed without activation and evaluated for 240 days.

The recommended production environment for Rails (and so for EPF Wiki) is Linux/Ubuntu, see EPF Wiki Installation Guide for Ubuntu. Linux/Ubuntu will give you a much, much smoother experience when it comes to running Rails applications. You should expect to spend ten times as much time installing and maintaining.

It will take a few hours/half a day to complete the installation. Most of that time we will be waiting for MS Windows to download, install - also many bits we don't need - and do many, many reboots, for some reason.

If you have any questions about this guide or EPF Wiki please use the Eclipse Process Framework Project Developers List. More on information on EPF Wiki is in the EPF Wiki User Guide.

Contents

Requirements

For the purpose of creating this guide a trial edition of Windows Web Server 2008 was used that can be downloaded from Microsoft.com. Using the Web Platform Installer (WPI) that is part of IIS we can easily install most of the required components for running EPF Wiki by selecting the Ruby Hosting package provided by Helicon Zoo. Helicon Zoo is a repository of web frameworks and applications for Microsoft IIS.

VirtualBox (optional, recommended) Ubuntu Software Centre or download for Windows
Windows Web Server 2008 6001.18000.080118-1840_x86fre_ServerWeb_en-us-KRMWFRE_EN_DVD.iso
EPF Wiki 1.6 epfwiki_r1_6_20120916_0722.zip
Web Platform Installer (WPI) Part of Windows Web Server 2008
UnxUtils UnxUtils.zip
MySQL Server 5.5 mysql-5.5.24-win32.msi

For your convenience most of the install files can be found in one location on Dropbox

VirtualBox (optional)

Installing EPF Wiki as a virtual appliance is a convenient way to use or evaluate EPF Wiki. For the purpose of creating this guide VirtualBox 4.1.12 was used. This can be installed using Ubuntu Software Centre.

Of course you can use any other virtualizer: VMWare, Parallels on any other platform.

Windows Web Server 2008

Create a VM for MS Windows 2008 with following properties: 1024MB, 20Gb, enable PAE/NX, enable VT-x/AMD-V, enable Nested Paging. More...

Add a dynamically expanding D-drive of 15GB to hold EPF Wiki sources and the process descriptions you will deploy.

Download Windows Web Server 2008 iso. In VirtualBox mount the ISO as CD/DVD and boot and install Windows Web Server 2008. Select the Windows Web Server 2008 (Full Installation) edition.

For your convenience it is recommended to install the VirtualBox Guest Additions. Share folder TODO

IIS

After installation finishes, boot the machine and Logon as Administrator and add IIS as a server role using Server Manager. More...

Role services selected:

  • Common HTTP Features
  • Application Development
  • Health and Diagnostics
  • Security
  • Performance
  • Management Tools except IIS 6 Management Compatibility

Wwwroot on D:

This step is optional but the remainder of this guide assumes you will put wwwroot directory on the D drive. So EPF Wiki will end up in D:\wwwroot\epfwiki_r1_6_20120916_0722 (rather than C:\inetpub\wwwroot\epfwiki_r1_6_20120916_0722).

  • Logon to the VM and shutdown IIS using IIS Manager.
  • Start Server Manager and add/create the D-drive using Disk Management.
  • Copy C:\inetpub\wwwroot to D:\wwwroot
  • Rename C:\inetpub\wwwroot to wwwroot-renamed
  • Open Administrator: Command Prompt and make a symbolic link
mklink /D "C:\inetpub\wwwroot" "D:\wwwroot"

  • Copy security settings from wwwroot-renamed to wwwroot. Notably settings for IIS_ISURS shoud be the same.
  • Start IIS and check that the default site http://localhost is still working.

UnxUtils

UnxUtils is used to unzip uploaded zip files with content. To install it:

  1. Creat folder with path C:\UnxUtils and download and extract there
  2. Add the entry C:\UnxUtils\usr\local\wbin; for UnxUtils to your PATH variable

After these steps yo-u should be able to run unzip from any folder. To test it:

C:\Documents and Settings\Vmware>unzip --help
UnZip 5.42 of 14 January 2001, by Info-ZIP.  Maintained by C. Spieler.    
...
C:\Documents and Settings\Vmware>

Note: if you intend to upload via FTP rather than the web interface and there will be no uploaded zip files to extract, this step is still required. This is because UnxUtils is also used when the first administration account is created.

Install MySQL Server 5.5

mysql-5.5.24-win32.msi was used with Typical as the setup type, Standard Configuration as the configuration type. Installed as Windows Service and included bin directory in Windows PATH.

TODO C:\Program Files\MySQL\MySQL Server 5.5\my.ini

Helicon Zoo

Helicon Zoo is a repository of web frameworks and applications for Microsoft IIS. We use this the Ruby Hosting Package and the WebMatrix Templates. These components are installed using Web Platform Installer (WPI) by Microsoft.

  • Logon to the VM as Administrator
  • Start IIS Manager, select Default Web Site and select Web Platform Installer.
  • Select Options and enter the Helicon Zoo feed http://www.helicontech.com/zoo/feed/ as Custom Feed and check Enable configuration of all web application parameters
  • select Add feed and OK.
  • You should now see a tab Zoo. Select that and Add the following components
    • Ruby Hosting Package
    • WebMatrix Templates
MS Windows needs to reboot several times to complete this step. After each reboot you need to start WPI again. When you do, the installation continues. Repeat this until after this WPI does not seem to want to install anything anymore.

While MS Windows is busy downloading/installing you can complete the next step: create MySQL database user.

Epfwf-wpi-change-options.png

Install EPF Wiki

Download epfwiki_r1_6_20120916_0722.zip and install it by extracting it to the folder D:\wwwroot\epfwiki_r1_6_20120916_0722.

After extracting it, change security settings of the folder. Give IIS_ISURS full control on this folder. The EPF Wiki site will run with anonymous authentication under IIS_ISURS so this users should have privileges to execute file but also to delete files, folders.

Create the MySQL Database User

From the same command prompt window as used in the previous step you can now create the MySQL Database User Account.

  1. In the Command Prompt logon to MySQL as root
  2. Create the user epfwiki with the password ikiwpur.
  3. Grant privileges and usage to this database user.

Of course you can use a different database user and password, you should change the database configuration file config/database.yml accordingly.

Example:

C:\Users\Administrator\Documents\My Web Sites\EPFW>mysql -uroot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 5.0.27-community 

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> create user 'epfwiki'@'localhost' identified by 'ikiwpur';
Query OK, 0 rows affected (0.08 sec)

mysql> grant all privileges on *.* to 'epfwiki'@'localhost';
Query OK, 0 rows affected (0.05 sec) 

mysql> grant usage on *.* to 'epfwiki'@'localhost';
Query OK, 0 rows affected (0.00 sec)

database.yml

Edit the database configuration file config/database.yml. Make sure that the production entry matches your username and password from the previous step.

production:
  adapter: mysql2
  database: epfwiki
  host: 127.0.0.1
  username: epfwiki
  password: ikiwpur
  encoding: utf8
  

Vendor Gems

Deployment using IIS is less straightforward compared to for example Ubuntu as a result of the security model of IIS. For this reason HeliconTech recommends you put the package the required gems in vendor cache. More...

For you convience all files that are required for IIS deployment are in a separate download epfwiki_r1_6_20120916_0722_iis.zip. You can download that file and merge it with EPF Wiki sources to complete this step.

The following steps in this section are not required. There are provide in case you need to recreate the vendor gems

In case you need/want to package gems yourself, the procedure advised by HeliconTech is as follows. Install Ruby and EPF Wiki on a separate MS Windows box. Install bundler.

gem install bundler -v=1.1.4

Install gems by opening command prompt and navigating to EPF Wiki folder.

bundle install

Package the gems.

bundle package

Now the gems will be in a special folder vendor/cache. HeliconTech you put those gems in a folder vendor/gems and upload to the IIS server to the vendor/gems directory. Now these/any gems will be installed automatically when you (re)start because the deploy.rb contains a line to install them.

bundle install --local --path vendor/gems

Bundle Install

Rename folder vendor/gems to vendor/cache.

Via Start > All Programs > Ruby 1.9.3-p0 > Start Command Prompt with Ruby. Navigate to the application folder and enter

gem install bundler -v=1.1.4
bundle install --local --path vendor/cache
gem install rails -v=3.1.4

Note that this command will also run each time you restart the server as it also present in the deploy.rb file.

Edit deploy.rb and change bundle install command so that it install vendor/cache.

MySQL Connector/C

bundle install at the outputs a message similar to below, with instructions to download and put libmysql.dll in Ruby bin directory. I downloaded my version of the connector mysql-connector-c-noinstall-6.0.2-win32.zip from dev.mysql.com downloads.

 ======================================================================================================
 
   You've installed the binary version of mysql2.
   It was built using MySQL Connector/C version 6.0.2.
   It's recommended to use the exact same version to avoid potential issues.
 
   At the time of building this gem, the necessary DLL files where available
   in the following download:
 
   http://dev.mysql.com/get/Downloads/Connector-C/mysql-connector-c-noinstall-6.0.2-win32.zip/from/pick
 
   And put lib\libmysql.dll file in your Ruby bin directory, for example C:\Ruby\bin
 
======================================================================================================

Create the database schema

Start Command Prompt with Ruby as in previous step and navigate to the application folder. Issue the following commands to create the database schema.

 set RAILS_ENV=production
 rake db:create db:migrate

Note: if you need or want to recreate the database you can run the command rake rake db:drop db:create db:migrate

Example:

C:\Users\Administrator\Documents\My Web Sites\EPFW>set RAILS_ENV=production
C:\Users\Administrator\Documents\My Web Sites\EPFW>rake db:create db:migrate
(in C:/InstantRails2.0/rails_apps/EPFWiki)
== 1 Initial: migrating =======================================================
-- create_table("checkouts", {:force=>true})
   -> 0.0160s
-- add_index("checkouts", ["user_id"], {:name=>"checkouts_user_id_index"})
   -> 0.0160s
...
 (lines deleted)
...
== 8 AdminMessages: migrating =================================================
== 8 AdminMessages: migrated (0.1250s) ========================================

== 9 CreateUpdates: migrating =================================================
-- create_table(:updates)
  -> 0.0160s
== 9 CreateUpdates: migrated (0.0160s) ========================================

C:\Users\Administrator\Documents\My Web Sites\EPFW>


TinyMCE

EPF Wiki uses the rich text editor TinyMCE which is a separate download and install. To integrate TinyMCE with EPF Wiki:

  1. Download TinyMCE 3.2.0.2 from tinymce.moxiecode.com.
  2. Extract the contents and copy the folder tinymce\jscripts\tiny_mce to [application install dir]\public\javascripts. The folder javascripts\tiny_mce should now contain Javascript library tiny_mce.js

The 1.6 release of EPF Wiki was tested against TinyMCE 3.2.0.2. If you can't find that download, you can also download from my dropbox share.

Configure EPF Wiki

production.rb

In EPF Wiki folder you might want to edit the configuration file for the production environment production.rb. At this point the three three configuration settings at the are the most important.

 ENV['EPFWIKI_APP_NAME'] = 'EPF Wiki'
 ENV['EPFWIKI_REPLY_ADDRESS'] = "no-reply@epf.eclipse.org"
 ENV['EPFWIKI_HOST'] = "localhost" # used for jobs, when there is no host variable in the environment

The no-reply address is rendered in every email as the from address.

EPF Wiki uses jobs (Scheduled Tasks on Windows) to send reports and update Wiki sites. Such a job is unaware of the Web server configuration as no Web server is involved in the operation, so we have to tell EPF Wiki the host and port the Web server is using. Note: include a port number if you are not using the default port 80 e.g. ENV['EPFWIKI_HOST'] = "myepfwiki:8080"

web.config

Edit web.config in the root of the EPF Wiki directory. Remove the following element.

<security>
  <authorization>
    <remove users="*" roles="" verbs="" />

<add accessType="Allow" users="ostraaten" /> </authorization> </security>

Specify the details of your SMTP server

EPF Wiki uses email extensively (for registration of new users, change reports), so an important step for any production environment is to add the details of your SMTP server. To do this edit the file config/initializers/setup_mail.rb. Change the file to match your SMTP server settings. An example for the Gmail SMTP server is

 ActionMailer::Base.smtp_settings = {  
   :address              => "smtp.gmail.com",  
   :port                 => 587,  
   :domain               => "epf.eclipse.org",  
   :user_name            => "onno.van.der.straaten@gmail.com",  
   :password             => "****",  
   :authentication       => "plain",  
   :enable_starttls_auto => true  
 }

If you don't have a SMTP server you could also use the following line in that file. That way you can use EPF Wiki without error messages being generated. In the log file log/production.log you will find extracts of email message send. There you should be able to find for example the sign up links send to users to create an account.

 ActionMailer::Base.delivery_method = :test

Start EPF Wiki using WebRick

Before we run EPF Wiki using IIS, we run EPF Wiki using the embedded WEBrick webserver. If something is wrong the WEBRick console will give us more clues what needs to be fixed. Open command prompt and navigate to EPF Wiki folder

set RAILS_ENV=production
rails server

If the WEBrick starts without errors, navigate to http://localhost:3000/. You should see the screen to create the administrator account.

If something is wrong the log file log/production.log will have more detailed information about errors.

Add Scheduled Task(s)

There are two jobs you can run using a scheduled task. One is used to update Wiki sites with new baselines which you can run as often as you like. One is used to send reports which is meant to be run once a day. If you run it more often, users who subscribed for a daily report will get multiple daily reports.

To update Wiki site with new baselines you execute the following command from EPF Wiki application root:

rake epfw:update RAILS_ENV=production

To send reports you run

rake epfw:reports RAILS_ENV=production

Or you could run both jobs as one task, updating first and then sending reports

rake epfw:update epfw:reports RAILS_ENV=production

Create IIS site for EPF Wiki

Now you can create a IIS site for EPF Wiki using IIS Manager. Point the site to the physical folder path e.g. D:\wwwroot\epfwiki_r1_6_20120916_0722. Navigate to the site, now you should also see the page to create the first administrator account.