Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "EPF Wiki Installation Guide"

(TinyMCE)
(Adding the EPF category)
 
(49 intermediate revisions by 4 users not shown)
Line 1: Line 1:
This guide describes how to install EPF Wiki on Windows using [http://instantrails.rubyforge.org InstantRails]. Use of InstantRails is recommended if you want to install EPF Wiki on Windows for production, test and demo purposes. Note however that the recommended production environment for Rails (and so for EPF Wiki) is Linux. Detailed installation instructions for Linux are in the [http://wiki.eclipse.org/EPF_Wiki_Virtual_Appliance_Guide EPF Wiki Virtual Appliance Guide], which describes how to create EPF Wiki as a VMWare Virtual Appliance using Linux Debian.
+
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 [http://rubyonrails.org/| 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.  
  
If  you have any questions about this guide or EPF Wiki please use the [mailto:epf-dev@eclipse.org Eclipse Process Framework Project Developers List]
+
<blockquote>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.</blockquote>
 +
 
 +
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  
 +
[mailto:epf-dev@eclipse.org Eclipse Process Framework Project Developers List]
 +
More on information on EPF Wiki is in the [[EPF Wiki User Guide]].
  
 
== Requirements ==
 
== Requirements ==
  
* InstantRails 2.0
+
For the purpose of creating this guide a trial edition of Windows Web Server 2008
* Internet Browser (FireFox 3.0 recommended)
+
was used that can be downloaded from
* Windows XP Professional
+
[http://www.microsoft.com/en-us/download/details.aspx?id=20407 Microsoft.com].  
* Latest EPF Wiki zip file from http://www.eclipse.org/epf
+
Using the Web Platform Installer (WPI) that is part of IIS we can easily install most of the required
* UnxUtils
+
components for running EPF Wiki by selecting the Ruby Hosting package provided by
* HTML Tidy
+
[http://www.helicontech.com/zoo/ Helicon Zoo]. [http://www.helicontech.com/zoo/ Helicon Zoo] is a repository
* 7-zip
+
of web frameworks and applications for Microsoft IIS.
  
Note: this guide has only been tested to work for Windows XP Professional but in principle it should work equally well for other Windows versions e.g. Windows Server.
+
{| cellspacing="1" cellpadding="1" border="1" width="100%"
 +
|-
 +
| VirtualBox (optional, recommended)
 +
| Ubuntu Software Centre or download for Windows
 +
|-
 +
| Windows Web Server 2008
 +
| [http://www.microsoft.com/en-us/download/details.aspx?id=20407 6001.18000.080118-1840_x86fre_ServerWeb_en-us-KRMWFRE_EN_DVD.iso]
 +
|-
 +
| EPF Wiki 1.6
 +
| [http://www.eclipse.org/epf/downloads/epfwiki/downloads.php epfwiki_r1_6_20120916_0722.zip]
 +
|-
 +
| Web Platform Installer (WPI)
 +
| Part of Windows Web Server 2008
 +
|-
 +
| UnxUtils
 +
| [http://sourceforge.net/projects/unxutils/ UnxUtils.zip]
 +
|-
 +
| MySQL Server 5.5
 +
| mysql-5.5.24-win32.msi
 +
|}
  
== UnxUtils ==
+
For your convenience most of the install files can be found in one location on
 +
[https://www.dropbox.com/sh/e11016pthwjxxpe/GRAX3rnx80 Dropbox]
  
UnxUtils is used to unzip uploaded zip files with content. To install it:
+
== VirtualBox (optional) ==
  
# Creat folder with path '''C:\UnxUtils''' and download and extract [http://unxutils.sourceforge.net/ UnxUtils] there
+
Installing EPF Wiki as a [http://en.wikipedia.org/wiki/Virtual_appliance virtual appliance] is a
# Add the entry '''C:\UnxUtils\usr\local\wbin;''' for UnxUtils to your PATH variable
+
convenient way to use or evaluate EPF Wiki. For the purpose of creating this guide
 +
[https://www.virtualbox.org/wiki/Downloads VirtualBox 4.1.12] was used.
 +
This can be installed using '''Ubuntu Software Centre'''.
  
After these steps you should be able to run unzip from any folder. To test it:
+
Of course you can use any other virtualizer: [http://www.vmware.com VMWare], [http://www.parallels.com Parallels]
 +
on any other platform.
  
C:\Documents and Settings\Vmware>unzip --help
+
== Windows Web Server 2008 ==
UnZip 5.42 of 14 January 2001, by Info-ZIP.  Maintained by C. Spieler.   
+
...
+
C:\Documents and Settings\Vmware>
+
  
== HTML Tidy ==
+
Create a VM for '''MS Windows 2008''' with following properties: 1024MB, 20Gb, enable PAE/NX,
 +
enable VT-x/AMD-V, enable Nested Paging. [http://www.sysprobs.com/install-run-windows-2008-r2-x86-sun-virtualbox More...]
  
HTML tidy is used to cleanup HTML. This is done to improve differences analysis using XHTMLDiff.  
+
Add a dynamically expanding D-drive of 15GB to hold EPF Wiki sources and the process descriptions you will deploy.
  
An easy way to install it is to drop the executable '''tidy.exe''' from http://tidy.sourceforge.net/ in the folder '''c:\WINDOWS\SYSTEM32'''. Any other location is fine too of course but EPF Wiki assumes Tidy can be run from any location (without path).
+
Download [http://www.microsoft.com/en-us/download/details.aspx?id=20407 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.
  
To test it:
+
For your convenience it is recommended to install the VirtualBox Guest Additions. Share folder TODO
  
C:\Documents and Settings\Vmware>'''tidy -v'''
+
=== IIS ===
HTML Tidy for Windows released on 25 January 2008
+
  
== InstantRails ==
+
After installation finishes, boot the machine and Logon as Administrator and add IIS as a server role using Server Manager.
 +
[http://learn.iis.net/page.aspx/29/installing-iis-7-and-above-on-windows-server-2008-or-windows-server-2008-r2/ More...]
  
# Create a folder with path '''C:\InstantRails2.0''' and extract the [http://rubyforge.org/frs/download.php/29867/InstantRails-2.0-win.zip InstantRails-2.0-win.zip] there. Note: there are some issues reported extracting the InstantRails zip, see [http://instantrails.rubyforge.org/wiki/wiki.pl?Unzip_Problems Unzip Problems]
+
Role services selected:
 +
* Common HTTP Features
 +
* Application Development
 +
* Health and Diagnostics
 +
* Security
 +
* Performance
 +
* Management Tools except IIS 6 Management Compatibility
  
You can now start the '''InstantRails Manager''' (InstantRails.exe) from the root of the extracted file.
+
=== Wwwroot on D: ===
  
=== '''Apply Mongrel Workaround Patch for EPFC using index.htm''' ===
+
This step is optional but the remainder of this guide assumes you will put <tt>wwwroot</tt> directory on the D drive. So
 +
EPF Wiki will end up in <tt>D:\wwwroot\epfwiki_r1_6_20120916_0722</tt> (rather than <tt>C:\inetpub\wwwroot\epfwiki_r1_6_20120916_0722</tt>).  
  
EPFC generates sites with '''index.htm''' in the root folder to start the site. Most Web servers assume such files will be named '''index.html''' but allow you to configure alternatives. Mongrel is not so advanced so we change this hard coded assumption.
+
* Logon to the VM and shutdown IIS using IIS Manager.
 +
* Start Server Manager and add/create the D-drive using Disk Management.
 +
* Copy <tt>C:\inetpub\wwwroot</tt> to <tt>D:\wwwroot</tt>
 +
* Rename <tt>C:\inetpub\wwwroot</tt> to <tt>wwwroot-renamed</tt>
 +
* Open '''Administrator: Command Prompt''' and make a symbolic link
  
We change the method '''can_serve''' in file '''handlers.rb''' (in folder C:\InstantRails2.0\ruby\lib\ruby\gems\1.8\gems\mongrel-1.1.2-x86-mswin32\lib\mongrel) so it will also serve '''index.htm'''. The snippet below shows added lines in bold.
+
mklink /D "C:\inetpub\wwwroot" "D:\wwwroot"
 +
 +
* Copy security settings from <tt>wwwroot-renamed</tt> to <tt>wwwroot</tt>. Notably settings for IIS_ISURS shoud be the same.  
 +
* Start IIS and check that the default site http://localhost is still working.
  
if File.directory? req_path
+
== UnxUtils ==
  # The request is for a directory
+
  index = File.join(req_path, @index_html)
+
  '''index2 = File.join(req_path, 'index.htm')'''
+
  if File.exist? index
+
    # Serve the index
+
    return index
+
  '''elsif File.exist? index2'''
+
    '''return index2'''
+
  elsif @listing_allowed
+
    # Serve the directory
+
    return req_path
+
  else
+
    # Do not serve anything
+
    return nil
+
  end
+
else
+
  
== EPF Wiki ==
+
UnxUtils is used to unzip uploaded zip files with content. To install it:
  
=== Required Gems ===
+
# Creat folder with path <tt>C:\UnxUtils</tt> and download and extract  there
 +
# Add the entry <tt>C:\UnxUtils\usr\local\wbin;</tt> for UnxUtils to your PATH variable
  
When using InstantRails we only need '''xhtmldiff'''.
+
After these steps yo-u should be able to run unzip from any folder. To test it:
  
# Start the InstantRails Manager (InstantRails.exe) and select '''I''' > '''Rails Applications''' > '''Manage Rails Applications'''. Press the button '''Create New Rails App..'''. This should open a Command Prompt.  
+
C:\Documents and Settings\Vmware>unzip --help
# Type '''gem install xhtmldiff'''. Note, if you need to install behind a proxy server you can use the p switch, the command will look something like '''gem install xhtmldiff -p http://myproxy.mydomain.com'''.
+
UnZip 5.42 of 14 January 2001, by Info-ZIP. Maintained by C. Spieler.  
 +
  ...
 +
C:\Documents and Settings\Vmware>
  
Example:  
+
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.
  
C:\InstantRails2.0\rails_apps\EPFWiki>gem install xhtmldiff -p http://myproxy.mydomain.com
+
== Install MySQL Server 5.5 ==
Bulk updating Gem source index for: http://gems.rubyforge.org
+
Successfully installed diff-lcs-1.1.2
+
Successfully installed xhtmldiff-1.0.0
+
2 gems installed
+
Installing ri documentation for diff-lcs-1.1.2...
+
Installing ri documentation for xhtmldiff-1.0.0...
+
Installing RDoc documentation for diff-lcs-1.1.2...
+
Installing RDoc documentation for xhtmldiff-1.0.0...
+
  
=== Create the EPF Wiki Application Folder ===
+
<tt>mysql-5.5.24-win32.msi</tt> 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.
  
# Create a folder with the name '''EPFWiki''' in the '''rails_apps''' folder of InstantRails.
+
TODO C:\Program Files\MySQL\MySQL Server 5.5\my.ini
# Download the '''EPFWiki.zip''' to this folder and extract the contents there
+
 
# Start the InstantRails Manager (InstantRails.exe) and select '''I''' > '''Rails Applications''' > '''Manage Rails Applications'''. The list of applications should now include '''EPFWiki'''.
+
== Helicon Zoo ==
# Create a folder with the name '''log''' in the folder '''EPFWiki'''
+
 
 +
[http://www.helicontech.com/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
 +
[http://www.microsoft.com/web/downloads/platform.aspx 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
 +
 
 +
<blockquote>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.</blockquote>
 +
 
 +
While MS Windows is busy downloading/installing you can complete the next step: create MySQL database user.
 +
 
 +
[[Image:Epfwf-wpi-change-options.png]]
 +
 
 +
== Install EPF Wiki ==
 +
 
 +
Download [http://www.eclipse.org/epf/downloads/epfwiki/downloads.php epfwiki_r1_6_20120916_0722.zip] and install it by
 +
extracting it to the folder <tt>D:\wwwroot\epfwiki_r1_6_20120916_0722</tt>.
 +
 
 +
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 ===
 
=== Create the MySQL Database User ===
  
# Start the InstantRails Manager (InstantRails.exe) and select '''I''' > '''Rails Applications''' > '''Manage Rails Applications'''. Press the button '''Create New Rails App..'''. This should open a Command Prompt.  
+
From the same command prompt window as used in the previous step you can now create the MySQL Database User Account.  
# Navigate to the EPF Wiki folder
+
 
 
# In the Command Prompt logon to MySQL as root
 
# In the Command Prompt logon to MySQL as root
 
# Create the user '''epfwiki''' with the password '''ikiwpur'''.
 
# Create the user '''epfwiki''' with the password '''ikiwpur'''.
 
# Grant privileges and usage to this database user.
 
# Grant privileges and usage to this database user.
  
Note: if you want to use a different database user and password, you should change the database config file (config/database.yml) accordingly.  
+
Of course you can use a different database user and password, you should change the database configuration file <tt>config/database.yml</tt> accordingly.  
  
 
Example:
 
Example:
 
C:\InstantRails2.0\rails_apps>cd EPFWiki
 
 
   
 
   
  C:\InstantRails2.0\rails_apps\EPFWiki>'''mysql -uroot'''
+
  C:\Users\Administrator\Documents\My Web Sites\EPFW>'''mysql -uroot'''
 
  Welcome to the MySQL monitor.  Commands end with ; or \g.
 
  Welcome to the MySQL monitor.  Commands end with ; or \g.
 
  Your MySQL connection id is 1 to server version: 5.0.27-community  
 
  Your MySQL connection id is 1 to server version: 5.0.27-community  
Line 118: Line 176:
 
  Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
 
  Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
 
   
 
   
  mysql> '''create user epfwiki identified by 'ikiwpur';'''
+
  mysql> '''create user 'epfwiki'@'localhost' identified by 'ikiwpur';'''
 
  Query OK, 0 rows affected (0.08 sec)
 
  Query OK, 0 rows affected (0.08 sec)
 
   
 
   
  mysql> '''grant all privileges on *.* to epfwiki;'''
+
  mysql> '''grant all privileges on *.* to 'epfwiki'@'localhost';'''
 
  Query OK, 0 rows affected (0.05 sec)  
 
  Query OK, 0 rows affected (0.05 sec)  
 
   
 
   
  mysql> '''grant usage on *.* to epfwiki;'''
+
  mysql> '''grant usage on *.* to 'epfwiki'@'localhost';'''
 
  Query OK, 0 rows affected (0.00 sec)
 
  Query OK, 0 rows affected (0.00 sec)
  
=== Create the database, load the schema and data ===
+
=== database.yml ===
  
# Start the InstantRails Manager (InstantRails.exe) and select '''I''' > '''Rails Applications''' > '''Manage Rails Applications'''. Press the button '''Create New Rails App..'''. This should open a Command Prompt.
+
Edit the database configuration file <tt>config/database.yml</tt>. Make sure that the <tt>production</tt> entry matches your username and password from the previous step.
# Navigate to the EPF Wiki folder
+
# Type '''set RAILS_ENV=production'''
+
# Run the migration scripts: '''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'''
+
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.
 +
[http://www.helicontech.com/articles/ruby-on-rails-on-windows-in-production/ More...]
 +
 
 +
For you convience all files that are required for IIS deployment are in a separate download
 +
[http://www.eclipse.org/epf/downloads/epfwiki/downloads.php 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 <tt>vendor/cache</tt>. HeliconTech you put those gems
 +
in a folder <tt>vendor/gems</tt> and upload to the IIS server to the <tt>vendor/gems</tt> directory.
 +
Now these/any gems will be installed automatically when you
 +
(re)start because the <tt>deploy.rb</tt> contains a line to install them.
 +
bundle install --local --path vendor/gems
 +
 
 +
=== Bundle Install ===
 +
 
 +
Rename folder <tt>vendor/gems</tt> to <tt>vendor/cache</tt>. 
 +
 
 +
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 <tt>deploy.rb</tt> file.
 +
 
 +
Edit <tt>deploy.rb</tt> and change bundle install command so that it install <tt>vendor/cache</tt>.
 +
 
 +
==== MySQL Connector/C ====
 +
 
 +
<tt>bundle install</tt> at the outputs a message similar to below,
 +
with instructions to download and put <tt>libmysql.dll</tt> in Ruby bin directory.
 +
I downloaded my version of the connector <tt>mysql-connector-c-noinstall-6.0.2-win32.zip</tt>
 +
from [http://dev.mysql.com/downloads/connector/c/#downloads 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 <tt>rake db:drop db:create db:migrate</tt>
  
 
Example:
 
Example:
  
  C:\InstantRails2.0\rails_apps\EPFWiki>rake db:create db:migrate
+
  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)
 
  (in C:/InstantRails2.0/rails_apps/EPFWiki)
 
  == 1 Initial: migrating =======================================================
 
  == 1 Initial: migrating =======================================================
Line 156: Line 291:
 
  == 9 CreateUpdates: migrated (0.0160s) ========================================
 
  == 9 CreateUpdates: migrated (0.0160s) ========================================
 
   
 
   
  C:\InstantRails2.0\rails_apps\EPFWiki>
+
  C:\Users\Administrator\Documents\My Web Sites\EPFW>
 +
 
  
 
=== TinyMCE ===
 
=== TinyMCE ===
  
To integrate TinyMCE with EPF Wiki:
+
EPF Wiki uses the rich text editor TinyMCE which is a separate download and install. To integrate TinyMCE with EPF Wiki:
  
# Download TinyMCE from [http://tinymce.moxiecode.com/download.php tinymce.moxiecode.com]
+
# Download '''TinyMCE 3.2.0.2''' from [http://tinymce.moxiecode.com/download.php tinymce.moxiecode.com].
 
# 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'''
 
# 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'''
  
EPF Wiki has been tested with TinyMCE version 2.0.8
+
----
 
+
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
=== Specify the details of your SMTP server ===
+
my [https://www.dropbox.com/sh/e11016pthwjxxpe/-Xz2mQXkMR/tiny_mce-3.2.0.2.zip dropbox] share.
 
+
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 the configuration file for the production environment '''production.rb''' (in folder config/environments/). It is recommended the EPF Wiki server gets anonymous access to the SMTP server. It is also recommended to test the access to the SMTP server using Telnet before making EPF Wiki available for use. On the internet there are many howto's on how to do that, see [http://www.google.nl/search?q=smtp+telnet+email&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:nl:official&client=firefox-a smtp telnet email]
+
 
+
With anonymous access to the SMTP server, the settings will look something like:
+
ActionMailer::Base.server_settings = {
+
  :address  => "smtp.resultinfra.com",
+
  :port  => 25,
+
  :domain  => 'resultinfra.com',
+
}
+
  
When you need to logon to use the SMTP server, there are other arguments you need to add:
+
== Configure EPF Wiki ==
:user_name  => "andy.kaufman@epf.eclipse.org",
+
:password  => "Andy Kaufman",
+
:authentication  => :login
+
  
=== Add and Configure EPF Wiki as an InstantRails Application ===
+
=== production.rb ===
  
# Start the InstantRails Manager (InstantRails.exe) and select '''I''' > '''Rails Applications''' > '''Manage Rails Applications'''.  
+
In EPF Wiki folder you might want to edit the configuration file for the production environment <tt>production.rb</tt>. At this point the three three configuration settings at the are the most important.
# From the list select '''EPFWiki'''and press '''Configure Startup Mode'''
+
# Replace '''development''' with '''production''' in the Runtime Mode field
+
# Replace '''3000''' with '''3003''' in the Port field
+
# Press '''Edit Apache Config File''' and add a Virtual Host directive for your server
+
  
Example of a Virtual Host directive:
+
  ENV['EPFWIKI_APP_NAME'] = 'EPF Wiki'
<VirtualHost *>
+
  ENV['EPFWIKI_REPLY_ADDRESS'] = "no-reply@epf.eclipse.org"
    ServerName myepfwiki
+
  ENV['EPFWIKI_HOST'] = "localhost" # used for jobs, when there is no host variable in the environment
    ProxyPass / http://localhost:3003/
+
    ProxyPassReverse / http://localhost:3003
+
</VirtualHost>
+
  
If you don't have a real, existing hostname in the DNS, you also have to edit the hosts file:
+
The no-reply address is rendered in every email as the from address.  
# Press '''Edit Windows Host File''' and add a entry for your hostname
+
 
+
Example of a host file entry:
+
127.0.0.1 myepfwiki
+
 
+
# Press '''Ok'''
+
 
+
 
+
=== Tell EPF Wiki about the Web Server Hostname ===
+
 
+
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. We can do this be editing the configuration file for the production environment (config/environments/production.rb).
+
 
+
# Open production.rb
+
# Replace '''ENV['EPFWIKI_HOST'] = "localhost"''' with the right hostname e.g. '''ENV['EPFWIKI_HOST'] = "myepfwiki"'''
+
  
 +
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"'''
 
Note: include a port number if you are not using the default port 80 e.g. '''ENV['EPFWIKI_HOST'] = "myepfwiki:8080"'''
  
=== Start EPF Wiki ===
+
=== web.config ===
  
# Start the InstantRails Manager (InstantRails.exe) and select '''I''' > '''Rails Applications''' > '''Manage Rails Applications'''
+
Edit <tt>web.config</tt> in the root of the EPF Wiki directory. Remove the following element.
# Check '''EPFWiki''' in the list and select '''Start With Mongrel'''
+
# Start an Internet Browser and navigate to your EPF Wiki application  e.g. http://myepfwiki. If you get an error about LIBMYSQL.dl, see the notes at the bottom of this page
+
  
The application should display a form where you can create the first user. This user will become the main administrator (most privileged account). To create this account you have to provide a name, email and a password.
+
<security>
 +
  <authorization>
 +
    <remove users="*" roles="" verbs="" />
 +
<add accessType="Allow" users="ostraaten" />
 +
    </authorization>
 +
</security>
  
==== Troubleshooting ====
+
=== Specify the details of your SMTP server ===
  
If Mongrel fails to start, start it from the command line:
+
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 <tt>config/initializers/setup_mail.rb</tt>. Change the file to match your SMTP server settings. An example for the Gmail SMTP server is
# Start the InstantRails Manager (InstantRails.exe) and select '''I''' > '''Rails Applications''' > '''Create New Rails App'''
+
# '''cd''' to the folder '''EPFWiki'''
+
# Type '''set RAILS_ENV=production'''
+
# Type '''ruby script/server'''
+
  
=== Add the Scheduled Tasks ===
+
  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 
 +
  }
  
EPF Wiki assumes that default four Scheduled Tasks will be created, three for reporting (daily, weekly and monthly) and one for creating and updating Wikis.
+
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 <tt>log/production.log</tt> 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
  
The Scheduled Tasks should run from the EPF Wiki Application root e.g. '''C:\InstantRails2.0\rails_apps\EPFWiki''' and we schedule it to run a bat file with the same name.
+
=== Start EPF Wiki using WebRick ===
  
In the '''Run''' field of the tasks we use the following entries:
+
Before we run EPF Wiki using IIS, we run EPF Wiki using the embedded WEBrick webserver. If something is wrong the
* job_daily_report.bat
+
WEBRick console will give us more clues what needs to be fixed. Open command prompt and navigate to EPF Wiki folder
* job_weekly_report.bat
+
set RAILS_ENV=production
* job_monthly_report.bat
+
rails server
* job_daily.bat
+
  
Each bat file runs the corresponding EPF Wiki job:
+
If the WEBrick starts without errors, navigate to http://localhost:3000/. You should see the screen to create the administrator account.
* ruby script/runner -e production 'job_daily_report'
+
* ruby script/runner -e production 'job_weekly_report'
+
* ruby script/runner -e production 'job_monthly_report'
+
* ruby script/runner -e production 'job_daily'
+
  
For the first three the timing of the task is important, of course. You want those tasks to run just after the period. So, for example, you would run the weekly report Monday morning. If you run it on Sunday it will report changes for the previous week.
+
If something is wrong the log file <tt>log/production.log</tt> will have more detailed information about errors.
  
Example bat file:
+
=== Add Scheduled Task(s) ===
call ../../use_ruby.cmd
+
cd EPFWiki
+
ruby script/runner -e production 'job_daily'
+
  
== Notes ==
+
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.
  
=== InstantRails ===
+
To update Wiki site with new baselines you execute the following command from EPF Wiki application root:
 +
rake epfw:update RAILS_ENV=production
  
"Instant Rails is a one-stop Rails runtime solution containing Ruby, Rails, Apache, and MySQL, all pre-configured and ready to run. No installer, you simply drop it into the directory of your choice and run it. It does not modify your system environment.". See [http://instantrails.rubyforge.org InstantRails Site] for more information.
+
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. <tt>D:\wwwroot\epfwiki_r1_6_20120916_0722</tt>. Navigate to the site,
 +
now you should also see the page to create the first administrator account.
  
=== The procedure entry point mysql_stmt_row_tell could not be located in the dynamic library LIBMYSQL.dll ===
+
[[Category:EPF]]
 
+
This is a known issue when using IntstantRails 2.0. Look for it on the internet. A quick workaround is to add '''LIBMYSQL.DLL''' to the '''ruby/bin''' directory. This DLL can be found in the MySQL bin directory.
+
 
+
=== Creating a Demo, Test Environment without SMTP server===
+
 
+
If you follow this instruction to create an environment for non-production use and you don't have a SMTP server available, you should disable the use of the SMTP server. Add the line '''config.action_mailer.delivery_method = :test''' to the configuration file for the production environment '''production.rb''' which is located in the folder '''config/environments'''.
+
 
+
Alternatively you can follow this instruction and use '''test''' where the production environment is mentioned e.g. '''test.rb''' instead off '''production rb''' and so on. That would be the preferred approach.
+
 
+
=== Page not found trying to start a Wiki ===
+
 
+
EPF Wiki uses path such as '''http://myepfwiki/wikis/rm/''' to start the Wiki site. The web server is configured to look for '''index.html''' but EPFC uses index.htm. When using InstantRails you cannot simply fix this by changing the DirectoryIndex directive. This has no effect because Apache is used only as a proxy server. The problem is caused by the Mongrel server.
+
 
+
This behaviour is not configurable with Mongrel. See the workaround.
+
 
+
Searching for: index.html
+
examples\httpd.conf(174): DirectoryIndex index.html
+
examples\httpd.conf(448): RewriteRule ^/$ /index.html [QSA]  
+
lib\mongrel\handlers.rb(121): def initialize(path, listing_allowed=true, index_html="index.html")
+
test\test_handlers.rb(63): "http://localhost:9998/files/rdoc/index.html",
+
Found 4 occurrence(s) in 3 file(s)
+

Latest revision as of 09:05, 24 October 2019

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.

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.

Back to the top