-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Setup Microsoft Windows
Note If you want to try out a one-click installer (gives you everything you need to get started), take a look at https://bitnami.com/stack/fat-free-crm/installer
(Important note: this is a very old installation procedure and unlikely to work on recent versions of FFCRM)
This procedure describes installation of Fat Free CRM 0.10.1-rc2 with MySQL storage on Microsoft Windows VMs and computers. I used stack installers to avoid many problems "new users" have setting up a Rails server. It works with Windows XP SP3, Vista SP2 and Windows 7. I tried to find the most straightforward way for my colleagues to try out Fat Free CRM on Windows and if you are trying to do the same, then this is for you.
This procedure is provided without any express or implied warranty and using it is entirely at your own risk. Installing any software on a computer can have unintended consequences. You should back up your important files before trying this or any other installation.
- Fresh installation of Microsoft Windows XP SP3, Vista SP2 or 7 32-bit (physical or VM)
- Single, working network connection with a fixed IP address
- 512Mb RAM (XP VM), 768Mb (XP physical), 1Gb (Vista, 7 VM), 1.5Gb (Vista, 7 physical)
- 2GB of NTFS formatted free disk space
- User Account Control disabled on Vista and 7
- Ability to use the Windows GUI and command prompt
- Any 3rd party firewall configured correctly during installation
If you intend to deploy Fat Free CRM in a production environment there is more work involved to achieve an acceptable level of performance and security. The versions of software I used may not be the most recent and may have security issues that you should review. Installing the operating system, server stack, application and data on the same physical disk will not provide sufficient performance in production use. You should consider running the software and stack under separate and limited user accounts to restrict file system and database access in the event of intrusion.
- Fat Free CRM
- Rails Installer - railsinstaller 1.2.0
- XAMPP - xampp-win32-1.7.4-VC6-installer.exe
- Rubygems - rubygems-1.8.5.zip
- MySQL - mysql-5.5.8-win32.zip
If you do not have a notepad app that can recognize different character sets (Windows Notepad is not really up to the task) then I suggest installing Metapad 3.6 from http://liquidninja.com/metapad/download.html
- Double-click
xampp-win32-1.7.4-VC6-installer.exe
- Wait for installer to verify, choose language, and default installation folder
- On XAMPP Options screen, tick Install MySQL as service, then click Install, wait, click Finish
- Wait for installation finished message, click OK, click No to the control panel question
- Restart the VM/Computer
- Double-click XAMPP Control Panel icon on desktop, check that MySql has "running" beside it
- Click
Start
beside Apache, if Windows Firewall is enabled and gives a warning, click Unblock - Open your browser and go to http://127.0.0.1, choose language
- Click Security in left column, scroll down page that opens, click
xamppsecurity.php
link - Enter a MySQL root password and click Password changing then write it down
- Go back to the XAMPP control panel (on taskbar or icon in the tray area)
- Beside MySql, click
Stop
, count to 5, then clickStart
- Go to http://127.0.0.1/phpmyadmin and login with username root and password from step 10.
- If login is successful, MySQL is running and you can click the green exit icon (top left corner of page)
- Close browser and all windows and restart the VM/Computer
- Double-click
railsinstaller-1.2.0.exe
then clickNext
to step through - Accept license, default folder, click
Install
, wait, then clickFinish
- Enter a name and email (
[email protected]
is ok). When the command completes, close the window.
- Unzip
rubygems-1.8.5.zip
and copy the folder from the zip toC:\RailsInstaller
. The structure should then beC:\RailsInstaller\rubygems-1.8.5
with subfoldersbin
,test
,util
, etc. - Go to RailsInstaller on the Start menu, and click Command Prompt with Ruby and Rails
- Run the following commands:
cd C:\railsinstaller\rubygems-1.8.5`
ruby setup.rb
gem install --no-rdoc --no-ri rake -v 0.8.7
gem install --no-rdoc --no-ri rails3-generators
- When commands are complete, close the Command Prompt window
- Unzip
mysql-5.5.8-win32.zip
go into themysql-5.5.8-win32
folder and copy the subfolderinclude
toC:\xampp\mysql
The structure should then beC:\xampp\mysql\include
, containing a large nuber of.h
files - Run the following commands:
cd C:\railsinstaller\
subst X: C:\xampp\mysql
gem install --no-rdoc --no-ri mysql2 -v 0.2.7 -- with-mysql-dir=X: --with-mysql-lib=X:\bin --with-mysql-include=X:\include
gem update bundler
- When commands are complete, close the Command Prompt window
- Using Windows Explorer, go to
C:\xampp\mysql\bin
and copylibmysql.dll
toC:\RailsInstaller\Ruby1.8.7\bin
- Unzip the Fat Free CRM zip file (e.g.
fatfreecrm-fat_free_crm-0.10.1-rc2-0-g37bc96e.zip
), and copy the folderfatfreecrm-fat_free_crm-37bc96e
toC:\RailsInstaller
, then right click and rename the folder tofat_free_crm
- The folder structure should then be
C:\RailsInstaller\fat_free_crm
- At this point you will need to edit 3 different text files with a UNIX compatible editor. Windows notepad is NOT suitable. If you do not have a different editor please scroll up to Software to download before you begin and download Metapad from the link, then unzip and run it. The files can be dragged and dropped straight in to Metapad.
- In Windows Explorer, go to
C:\railsinstaller\ffcrm\config
and opendatabase.mysql.yml
in your editor. - Scroll down to the
production:
section - Beside
password:
, type the MySQL password you wrote down before. (Leave a space after the colon.) - Add a line under
socket: /tmp/mysql.sock
that sayshost: 127.0.0.1
. - The file should look something like this:
production: adapter: mysql2 encoding: utf8 database: crm_production pool: 5 username: root password: -your-pass-here- socket: /tmp/mysql.sock host: 127.0.0.1
-
Save the file as a new file at
C:\railsinstaller\ffcrm\config\database.yml
. -
Go to
C:\railsinstaller\ffcrm\config\environments
and openproduction.rb
in your editor, scroll down and paste in the following code block just aboveend
:
config.action_mailer.perform_deliveries = true
config.action_mailer.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
:address => "smtp.gmail.com",
:enable_starttls_auto => true,
:port => 587,
:authentication => :plain,
:user_name => "[email protected]",
:password => 'password'
}
config.action_mailer.default_url_options = { :host => 'dev.mydomain.com' }
Then double check to make sure end
is still the last line of the file and save the file.
- Go to RailsInstaller on the Start menu and click Command Prompt with Ruby and Rails
- Run the following commands:
cd C:\railsinstaller\ffcrm
bundle install # (this command takes about 5 minutes to complete)
rake db:create RAILS_ENV=production
rake ffcrm:setup RAILS_ENV=production
- Enter the administrator username and password you want when asked, then type yes (and press enter) to continue.
- In the Command Prompt, type:
rails server -e production
- Wait for the server to start (can take 30 seconds). A timed server log will appear when it's ready
- The application is now available on the local machine at http://127.0.0.1:3000
- The server listens on port 3000 so this must be opened at the firewall to allow access from the network
- On Windows Vista or 7 go to the Control Panel, then the Network and Sharing Center, then click Windows Firewall (bottom left) then Change settings (on the right). Go to step 9.4
- On Windows XP go to the Control Panel, then Network and Internet Connections, then click Windows Firewall at the bottom
- When the Windows Firewall Settings dialog box appears, click the Exceptions tab, then click
Add port
and use the following:
Name: | Rails |
Port number: | 3000 |
Developed by the Pinstripes Windows Server Lab, July 2011
Sources
-
Bundler 1.0.14 failure: http://stackoverflow.com/questions/6213600/error-fatal-i-dont-handle-protocol-git-when-using-bundle-install
-
Long discussion on installing mysql2: http://rorguide.blogspot.com/2011/03/installing-mysql2-gem-on-ruby-192-and.html
-
Discussion on actionmailer error: https://groups.google.com/forum/#!topic/fat-free-crm-users/xyNzc-PL-6g