Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be 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"

(Tell EPF Wiki about the Web Server Hostname)
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. There is a guide for Ubuntu see [[EPF Wiki Installation Guide for Ubuntu]].
+
This guide describes how to install EPF Wiki on Windows with [http://learn.iis.net/page.aspx/868/iis-express-overview/| IIS Express]. As IIS Express is a IIS release for developers, this describes the creation of a 'development' environment. But this guide could also be used for creating a production environment, the basic steps remain the same. Note however that he recommended production environment for Rails (and so for EPF Wiki) is Linux/Ubuntu, see [[EPF Wiki Installation Guide for Ubuntu]].
  
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]. Install sources can be found on the [http://www.eclipse.org/epf/downloads/downloads.php EPF Downloads] page.
+
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].  
  
Previous and other versions of this guide:
+
More on information on EPF Wiki in in the [[EPF Wiki User Guide]].
* [http://wiki.eclipse.org/index.php?title=EPF_Wiki_Installation_Guide&oldid=117090 EPF Wiki Installation Guide for version 1.5 RC 1]
+
* [[EPF Wiki Installation Guide for Ubuntu]]
+
 
+
More information on EPW Wiki can be found in  
+
# [[EPF Wiki User Guide]]
+
# [[EPF Wiki Development Guide]]
+
 
+
If you are using release 1.5 RC 1 and you want to upgrade, see the [[EPF Wiki R1.5 Patch]]
+
  
 
== Requirements ==
 
== Requirements ==
  
* InstantRails 2.0 (also includes Apache, MySQL)
+
This guide assumes you will use a current version of IIS of IIS Express. This guide is based on IIS 7.5 Express. First and foremost requirements for IIS apply. This installation guide was tested using [http://www.microsoft.com/en-us/download/details.aspx?id=11575 Windows Virtual PC VHD] which can be used freely for 90 days. And then you will need the following:
* Internet Browser (FireFox 3.0 recommended)
+
 
* Windows XP Professional
+
* EPF Wiki 1.6
* Latest EPF Wiki zip file from http://www.eclipse.org/epf
+
* .Net Framework Version 4.0
 
* UnxUtils
 
* UnxUtils
* HTML Tidy
+
* MySQL Server 5.5
* 7-zip
+
 
* TinyMCE
+
For your convenience most of the install files can be found in one location on [https://www.dropbox.com/sh/e11016pthwjxxpe/GRAX3rnx80 Dropbox]
  
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.
+
== Install Utilities ==
  
== UnxUtils ==
+
=== UnxUtils ===
  
 
UnxUtils is used to unzip uploaded zip files with content. To install it:
 
UnxUtils is used to unzip uploaded zip files with content. To install it:
Line 40: Line 32:
 
  C:\Documents and Settings\Vmware>
 
  C:\Documents and Settings\Vmware>
  
== HTML Tidy ==
+
== Install IIS 7.5 Express ==
  
HTML tidy is used to cleanup HTML. This is done to improve differences analysis using XHTMLDiff.  
+
=== .Net Framework Version 4.0 ===
  
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).
+
Required for IIS. Download and install [http://www.microsoft.com/downloads/nl-nl/confirmation.aspx?familyid=9cfb2d51-5ff4-4491-b0e5-b386f32c0992 dotNetFx40_Full_setup.exe]
  
To test it:
+
=== WebMatrix ===
  
C:\Documents and Settings\Vmware>'''tidy -v'''
+
[http://en.wikipedia.org/wiki/Microsoft_WebMatrix Microsoft WebMatrix] is a free, all-in-one, extensible web development application for Windows, developed by Microsoft. This will also install [http://www.microsoft.com/web/downloads/platform.aspx Web Platform Installer] (WPI) by Microsoft. You can install from the Microsoft site using the following link: [http://www.microsoft.com/web/gallery/install.aspx?appid=webmatrix Install Microsoft WebMatrix].
HTML Tidy for Windows released on 25 January 2008
+
  
== InstantRails ==  
+
== Helicon Zoo ==
  
# 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]
+
[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 WPI
  
You can now start the '''InstantRails Manager''' (InstantRails.exe) from the root of the extracted file.
+
* Start WPI. I use wpilauncher_3_10.exe, you can find this executable on Microsoft site or the Dropbox folder.
 +
* Select '''Options'''
 +
* Enter the Helicon Zoo feed http://www.helicontech.com/zoo/feed/ and select '''Add feed''' and '''OK'''.
 +
* You should now see a tab '''Zoo'''. Select that and '''Add''' the following components
 +
** Ruby Hosting Package
 +
** WebMatrix Templates
  
== EPF Wiki ==
+
[[File:Wpi-change-options.png]]
  
=== Required Gems ===
+
== Install MySQL Server 5.5 ==
  
When using InstantRails we only need '''xhtmldiff'''.
+
Installation of MySQL is beyond scope of this document but for the record. I used mysql-5.5.24-win32.msi. With '''Typical''' as the setup type. '''Standard Configuration''' as the configuration type. Installed as Windows Service and I included bin directory in Windows PATH.
  
# 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.
+
== Install EPF Wiki ==
# 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'''.
+
  
Example:
+
=== Create Empty Site ===
  
C:\InstantRails2.0\rails_apps\EPFWiki>gem install xhtmldiff -p http://myproxy.mydomain.com
+
Start WebMatrix and select '''Site From Template'''. Select '''Rails Site''' and enter '''EPFW''' as site name. On '''OK''' this should create a URL and location for our application. You can follow the URL and see a message that a new empty site has been created. The empty site will be configured to run a <tt>development</tt> environment. Unless you want to create an actual development environment, it is recommended (for performance reasons) to configure it to run as a <tt>production</tt> environment.
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 ===
+
Edit the file <tt>web.config</tt> and change <tt>RACK_ENV</tt>
 +
<add name="RACK_ENV" value="development" />
 +
to
 +
<add name="RACK_ENV" value="production" />
  
# Create a folder with the name '''EPFWiki''' in the '''rails_apps''' folder of InstantRails.
+
Note: is you are creating an environment using IIS and you don 't have access to WebMatrix, you can't perform this step. In that case you can download <tt>epfwiki_r1_6_20120710_2140_IIS_site_template.zip</tt> from [http://www.eclipse.org/downloads/download.php?file=/technology/epf/wiki/epfwiki_r1_6_20120710_2140_IIS_site_template.zip].
# Download the EPF Wiki install sources from [http://www.eclipse.org/epf/downloads/downloads.php EPF Downloads] 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'''.
+
=== Download and Install ===
# Create a folder with the name '''log''' in the folder '''EPFWiki'''
+
 
 +
Download [http://www.eclipse.org/downloads/download.php?file=/technology/epf/wiki/epfwiki_r1_6_20120710_2140.zip epfwiki_r1_6_20120710_2140.zip] from [http://www.eclipse.org/epf/downloads/epfwiki/downloads.php downloads] and extra the content to the location created in the previous step. Overwrite any existing files and folders.
 +
 
 +
=== production.rb ===
 +
 
 +
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.
 +
 
 +
  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"'''
 +
 
 +
=== Bundle Install ===
 +
 
 +
Via '''Start''' > '''All Programs''' > '''Ruby 1.9.3-p0''' > '''Start Command Prompt with Ruby'''. Navigate to the application folder and enter <tt>bundle install</tt>
 +
 
 +
[[File:Epfw-r1.6-bundle-install.png]]
 +
 
 +
==== 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 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 config 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 105: Line 131:
 
  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
 +
 
 +
=== 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 143: Line 181:
 
  == 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 ===
+
== Configure EPF Wiki ==
 
+
To integrate TinyMCE with EPF Wiki:
+
 
+
# 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'''
+
 
+
----
+
The 1.5 release uses TinyMCE 3.2.0.2 but the first release candidate for the 1.5 release uses TinyMCE version 2.0.8 and 2.1.3. These TinyMCE versions are not compatible. If you are upgrading your installation, see [[EPF Wiki R1.5 Patch]]
+
----
+
  
 
=== Specify the details of your SMTP server ===
 
=== 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 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]
+
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
  
With anonymous access to the SMTP server, the settings will look something like:  
+
  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 
 +
  }
  
ActionMailer::Base.delivery_method = :smtp
+
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.smtp_settings = {
+
   ActionMailer::Base.delivery_method = :test
  :address  => "smtp.epf.eclipse.org",
+
   :port  => 25,
+
  :domain  => 'epf.eclipse.org',
+
}
+
  
When you need to logon to use the SMTP server, there are other arguments you need to add:
+
=== Start EPF Wiki ===
:user_name  => "andy.kaufman@epf.eclipse.org",
+
:password  => "Andy Kaufman",
+
:authentication  => :login
+
  
=== Add and Configure EPF Wiki as an InstantRails Application ===
+
You can now restart EPF Wiki for the changed settings to take effect. Start WebMatrix and restart. If you see a message that MySQL could not connect to 'localhost', you have to restart some more or even reboot maybe for WebMatrix to pick up the changed configuration.
  
# Start the InstantRails Manager (InstantRails.exe) and select '''I''' > '''Rails Applications''' > '''Manage Rails Applications'''.  
+
[[File:Epfw-r1.6-iis-webmatrix-restart.png]]
# From the list check '''EPFWiki''' and select '''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:
+
After restart navigate to EPF Wiki by clicking the URL link displayed in WebMatrix. This should then show the screen to create the administrator account.
<VirtualHost *>
+
    ServerName myepfwiki
+
    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:
+
[[File:You-there.png]]
# Press '''Edit Windows Host File''' and add a entry for your hostname
+
  
Example of a host file entry:
+
If this is not the case, the first thing to do is to check the log file <tt>log/production.log</tt> for any clues on what is going wrong.
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 (in folder instantrails/rails_apps/epfwiki/config/environments)
+
# Replace '''ENV['EPFWIKI_HOST'] = "localhost"''' with the right hostname e.g. '''ENV['EPFWIKI_HOST'] = "myepfwiki"'''
+
 
+
Note: include a port number if you are not using the default port 80 e.g. '''ENV['EPFWIKI_HOST'] = "myepfwiki:8080"'''
+
 
+
=== Start EPF Wiki ===
+
 
+
# Start the InstantRails Manager (InstantRails.exe) and select '''I''' > '''Rails Applications''' > '''Manage Rails Applications'''
+
# 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.
+
 
+
==== Troubleshooting ====
+
 
+
If Mongrel fails to start, start it from the command line:
+
# 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 Task ===
 
=== Add the Scheduled Task ===
Line 231: Line 223:
  
 
This job should run at night or at when ever your site is used the least.
 
This job should run at night or at when ever your site is used the least.
 
== Notes ==
 
 
=== InstantRails ===
 
 
"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.
 
 
 
=== The procedure entry point mysql_stmt_row_tell could not be located in the dynamic library LIBMYSQL.dll ===
 
 
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.
 
 
=== Running multiple instances of EPF Wiki ===
 
 
The following section describes the basic steps involved when you want to run multiple instances of EPF Wiki using InstantRails. Such instances are completely seperate, which could be useful for instance for create a demo, training, test or staging environment. These instances are accesible via different ports. Of course you could also use different domain names for each environment.
 
 
# Create multiple application directories in the '''rails_apps''' directory (for example create folders named EPFWiki_production EPFWiki_demo).
 
# Create multiple database, one for each instance
 
# Edit the '''database.yml''' files in each EPF Wiki directory to match the created databases
 
# Start InstantRails manager and select '''I > Rails Applications > Manage Rails Applications'''
 
# Press '''Refresh List'''
 
# Check the first EPF Wiki application and press '''Configure Startup Mode'''
 
# Specify runtime mode and port, for example <code>production</code> and <code>3003</code>
 
# Press '''Edit Apache config file'''
 
# Add '''listen''' and '''virtual host directives''' for each port you want to use, see example below
 
# Repeat step 7 for each environment using different port numbers
 
# select '''I > Rails Applications > Manage Rails Applications''', check all EPF Wiki boxes and press '''Start with mongrel'''
 
 
Example snippet Apache config file
 
...
 
listen 80
 
listen 81
 
...
 
<VirtualHost *:80>
 
    ServerName myepfwiki
 
    ProxyPass / http://localhost:3003/
 
    ProxyPassReverse / http://localhost:3003
 
</VirtualHost>
 
 
<VirtualHost *:81>
 
    ServerName myepfwiki
 
    ProxyPass / http://localhost:3004/
 
    ProxyPassReverse / http://localhost:3004
 
</VirtualHost>
 

Revision as of 09:11, 11 July 2012

This guide describes how to install EPF Wiki on Windows with IIS Express. As IIS Express is a IIS release for developers, this describes the creation of a 'development' environment. But this guide could also be used for creating a production environment, the basic steps remain the same. Note however that he recommended production environment for Rails (and so for EPF Wiki) is Linux/Ubuntu, see EPF Wiki Installation Guide for Ubuntu.

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 in in the EPF Wiki User Guide.

Requirements

This guide assumes you will use a current version of IIS of IIS Express. This guide is based on IIS 7.5 Express. First and foremost requirements for IIS apply. This installation guide was tested using Windows Virtual PC VHD which can be used freely for 90 days. And then you will need the following:

  • EPF Wiki 1.6
  • .Net Framework Version 4.0
  • UnxUtils
  • MySQL Server 5.5

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

Install Utilities

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 UnxUtils there
  2. Add the entry C:\UnxUtils\usr\local\wbin; for UnxUtils to your PATH variable

After these steps you 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>

Install IIS 7.5 Express

.Net Framework Version 4.0

Required for IIS. Download and install dotNetFx40_Full_setup.exe

WebMatrix

Microsoft WebMatrix is a free, all-in-one, extensible web development application for Windows, developed by Microsoft. This will also install Web Platform Installer (WPI) by Microsoft. You can install from the Microsoft site using the following link: Install Microsoft WebMatrix.

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 WPI

  • Start WPI. I use wpilauncher_3_10.exe, you can find this executable on Microsoft site or the Dropbox folder.
  • Select Options
  • Enter the Helicon Zoo feed http://www.helicontech.com/zoo/feed/ and select Add feed and OK.
  • You should now see a tab Zoo. Select that and Add the following components
    • Ruby Hosting Package
    • WebMatrix Templates

File:Wpi-change-options.png

Install MySQL Server 5.5

Installation of MySQL is beyond scope of this document but for the record. I used mysql-5.5.24-win32.msi. With Typical as the setup type. Standard Configuration as the configuration type. Installed as Windows Service and I included bin directory in Windows PATH.

Install EPF Wiki

Create Empty Site

Start WebMatrix and select Site From Template. Select Rails Site and enter EPFW as site name. On OK this should create a URL and location for our application. You can follow the URL and see a message that a new empty site has been created. The empty site will be configured to run a development environment. Unless you want to create an actual development environment, it is recommended (for performance reasons) to configure it to run as a production environment.

Edit the file web.config and change RACK_ENV

<add name="RACK_ENV" value="development" />

to

<add name="RACK_ENV" value="production" />

Note: is you are creating an environment using IIS and you don 't have access to WebMatrix, you can't perform this step. In that case you can download epfwiki_r1_6_20120710_2140_IIS_site_template.zip from [1].

Download and Install

Download epfwiki_r1_6_20120710_2140.zip from downloads and extra the content to the location created in the previous step. Overwrite any existing files and folders.

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"

Bundle Install

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

Epfw-r1.6-bundle-install.png

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 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 config 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

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>

Configure EPF Wiki

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

You can now restart EPF Wiki for the changed settings to take effect. Start WebMatrix and restart. If you see a message that MySQL could not connect to 'localhost', you have to restart some more or even reboot maybe for WebMatrix to pick up the changed configuration.

Epfw-r1.6-iis-webmatrix-restart.png

After restart navigate to EPF Wiki by clicking the URL link displayed in WebMatrix. This should then show the screen to create the administrator account.

File:You-there.png

If this is not the case, the first thing to do is to check the log file log/production.log for any clues on what is going wrong.

Add the Scheduled Task

Create a Scheduled Task job_daily. This job will send reports (daily, weekly, monthly) and will update Wiki sites if updates have been scheduled. It 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 name job_daily.bat with the following contents:

call ../../use_ruby.cmd
cd EPFWiki
ruby script/runner -e production 'job_daily'

This job should run at night or at when ever your site is used the least.

Back to the top