Fedena/Installation
Fedena is a web application meant to install in a server and accessed using browsers in client computers. You can install and use Fedena in your personal computer or LAN using the steps given below. If you want to make use of the complete features of Fedena, you should install it in a cloud computing server.
Download
[edit | edit source]The Fedena source code is available on github.
You can clone the repository by using the following in the command line:
$ git clone git://github.com/projectfedena/fedena.git
Installation
[edit | edit source]Windows
[edit | edit source]- Step 1
- Install Ruby
Download and install One-Click Ruby Installer for Windows. http://rubyforge.org/frs/download.php/72085/rubyinstaller-1.8.7-p302.exe (Old link, rubyforge not active, use below link.) http://dl.bintray.com/oneclick/rubyinstaller/rubyinstaller-1.8.7-p374.exe?direct
- Step 2
- Install Rails
Now we can use the RubyGems package manager to download and install Rails 2.3.5(Note: Version should be 2.3.5),
- Open a command window and run the command
gem install rails -v=2.3.5 --remote
if error occurs with rake, run "gem install rake -v=0.8.7"
- Then, run the command
gem install prawn -v=0.6.3 --remote
- Step 3
- Install MySQL
- Download and install the "essential" version of the MySQL installer v5.0 http://downloads.mysql.com/archives/mysql-5.0/mysql-essential-5.0.90-win32.msi
- Copy libmysql.dll from MySQL bin directory (usually C:\Program Files\MySQL\MySQL Server 5.0\bin) to Ruby bin directory (usually C:\Ruby\bin)
- Step 4
- Prep for Fedena Setup
- Download Fedena source code from GitHub. Extract the ZIP/TAR archive and save to a folder (say C:\Fedena).
- Now go to the fedena source directory in the command window. (EG "CD C:\FEDENA" or "CD C:\projectfedena-fedena-84b5ad9")
- We need to install the correct MySQL gem, must be a specific version also.(Note, it will generate a bunch of output "No definition for ___", but this is normal. To verify it was installed, scroll up and if it shows "1 gem installed," you are fine.)
gem install mysql -v=2.8.1
- Install Declarative Authorization:
gem install declarative_authorization -v 0.5.1
- Install i18n:
gem install i18n -v 0.4.2
- Since the "rake" command installed is most likely higher version than what Fedena is written for, we need to check for that. Run the command: If you have anything but 0.8.7 installed, remove it/them. It will say that dependencies will not be met, but this is OK, remove it anyway; also remove the executable when you are prompted.
gem uninstall rake
- Then install the correct version, enter the command:
gem install rake -v=0.8.7
- Install the gem:
gem install win32-open3
- Now we need to update the gem system to the proper one:
gem update --system 1.4.2
- And last gem to install:
gem install rush
- Finally, you need to check your gem list versions or install them by specific versions from the beginning As
gem install bundler -v=1.16.2 gem install rake -v=0.8.7 gem install rails -v=2.3.5 gem install i18n -v=0.4.2 gem install mysql -v=2.8.1
- Step 5
- Set up Fedena
- Update the MySQL database details in <config\database.yml>. You will need to supply the correct MySQL 'root' password. It is recommended to use a text editor like the "edit" command at the command prompt, notepad doesn't show correct formatting.
- Run the command This will create the required databases.
rake db:create
- Run the command This will populate the database with required tables. NOTE: If you receive errors at this point, you may need to run the following command: "gem install rubygems-update -v 1.3.5" and re-enter "rake db:migrate".
rake db:migrate
- Install the plugins:
rake fedena:plugins:install_all
- Finally, run the command This would start the server and it will be accessible at http://localhost:3000 NOTE: The default username is admin and the default password is admin123.
ruby script/server
- Step 6
- Install RMagick for Fedena
- (This installation is needed to solve error when uploading student profile picture)
- Download RMagick-2.12.0-ImageMagick-6.5.6-8-Q8.zip
- Unzip ImageMagick-6.5.6-8-Q8.zip
- Go to the unzip result folder and run ImageMagick-6.5.6-8-Q8-windows-dll.exe to install it.
- Unzip RMagick-2.12.0.tar.gz
- Copy the result, Rmagick-2.12.0 folder to C:\
- Copy rmagick-2.12.0-x86-mswin32.gem to C:\RMagick-2.12.0
- Navigate into folder C:\RMagick-2.12.0 using Windows Command Prompt
- Run the command gem install rmagick—local
- Running in Production Mode
- If you want to run Fedena in production mode, run the command For this, Production database details should be given in config/database.yml
ruby script/server -e production
- For quicker running, run the following commands, then you can once again use the above command to launch:
- Install Mongrel
gem install mongrel
- Run the command:
mongrel_rails start -e production
- Open another terminal instance, go to the Fedena source directory, and run the following command:
rake jobs:work
- Making a Windows Service
- If you want to run Fedena as a Windows Service (which automatically starts), do the following commands:
- Open the Ruby Command prompt and go to your Fedena Installation director
- Install a Gem:
gem install win32-service
- Install a Gem:
gem install mongrel_service
- Run the command: (Replace C:\FEDENA with whatever your Fedena installation Directory is.) You may also wish to change the port from 3001 to 80 so when entering the address from other computers, it is not required that you enter a port.
mongrel_rails service::install -N Fedena -c C:\FEDENA -p 3001 -e production
- Go to windows search at the start menu, type:
services.msc
- Look for service named 'Fedena' and set it to automatic
- Restart your computer and see if the fedena start automatically. Always make sure that your server is running.
Ubuntu Linux
[edit | edit source]- Setting up the Rails development environment
Ruby, rubygems, rails and other required packages can be installed by :
sudo apt-get install rails
- Setting up MySQL server
Fedena uses mysql, so run,
sudo apt-get install mysql-server mysql-client libmysql-ruby
Do remember the mysql password you set during this step, it is required in step five.
- Download the latest Fedena source code from github
Download Fedena source code from GitHub. Extract the downloaded .tar archive to a convenient location where you would be running fedena . Let us say we extracted it to a directory named fedena in my home(~) directory.
- Install Rails version 2.3.5
Fedena runs on version 2.3.5 of rails, so open a terminal and run,
sudo gem install rails -v=2.3.5
- Setup your database details in the database.yml
Open the file database.yml in the config folder of the fedena soucre. Change the following details: database: fedena - The name of the database you want to use for fedena username: root - Mysql username for fedena password: mypass - The password for the above mysql user
- Install the prawn gem
Run
sudo gem install prawn -v=0.6.3
- Install the rest of the gems
Open a terminal and navigate to the fedena source directory, install the rest of the gems by running
sudo rake gems:install
- Set up Fedena databases
From the Fedena source directory in terminal run,
rake db:create
followed by,
rake db:migrate
- Change permissions for scripts
From the same directory grant executable permissions for the files in script directory by,
chmod +x script/*
- Run the inbuilt server
If everything went fine till now, you are ready to run fedena server by running the following from fedena source folder,
script/server
Web Server - Centos
[edit | edit source]Installing Fedena on Centos is a bit tricky since most of the stack used to run fedena is not available as packages and has to be compiled and installed from their sources. The Centos version 5.4, the version I used to test fedena, comes with a version of Ruby that is very old. So here is what you should do to get Fedena up and running. First the plan. Our plan is to install the Centos, Nginx (and passenger), MySQL and RoR stack and then install fedena. The instructions here are for installing on a VPS with a VM, installing it on your laptop or other hardware is similar.
Assuming that you have a working installion of Centos either on your laptop, server or a VM on the cloud here are the activities that you should do to get fedena up and running.
- Installing Ruby and Rails
Fedena requires Ruby 1.8.7 and Rails 2.3.5, The version numbers are extremely important and you should verify that these specific versions of ruby and rails have been installed before you proceed executing the subsequent steps.
[root@i-3781-9521-VM ~]# yum install -y gcc zlib zlib-devel
[root@i-3781-9521-VM ~]# wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p352.tar.gz
[root@i-3781-9521-VM ~]# tar xvf ruby-1.8.7-p352.tar.gz
[root@i-3781-9521-VM ~]# cd ruby-1.8.7-p352
[root@i-3781-9521-VM ruby-1.8.7-p352]# ./configure --enable-pthread
[root@i-3781-9521-VM ruby-1.8.7-p352]# make
[root@i-3781-9521-VM ruby-1.8.7-p352]# make install
Do a check on the version of ruby installed
[root@i-3781-9521-VM ruby-1.8.7-p352]# ruby -v
ruby 1.8.7 (2010-12-23 patchlevel 352) [x86_64-linux]
If you have a 64bit version of Centos you can make it a 64bit version
[root@i-3781-9521-VM ruby-1.8.7-p352]# cd ext/zlib
[root@i-3781-9521-VM ruby-1.8.7-p352]# ruby extconf.rb --with-zlib-include=/usr/include --with-zlib-lib=/usr/lib64
[root@i-3781-9521-VM ruby-1.8.7-p352]# cd ../../
[root@i-3781-9521-VM ruby-1.8.7-p352]# make
[root@i-3781-9521-VM ruby-1.8.7-p352]# make install
Check the version of ruby, again
[root@i-3781-9521-VM ruby-1.8.7-p352]# ruby -v
ruby 1.8.7 (2010-12-23 patchlevel 352) [x86_64-linux]
- Installing rubygems
After installing ruby you should install ruby gems. Like in the case of ruby, you should install ruby gems from source because the packages install a very old version of ruby gems. First download the source code from the repository to a directory "source" or "src". If you haven't got a directory then create one then make that directory your present working directory.
[root@i-3781-9521-VM ruby-1.8.7-p352]# cd /usr/local/src
Fedena requires ruby gems 1.3.7 so lets download it
[root@i-3781-9521-VM src]# wget http://rubyforge.org/frs/download.php/70696/rubygems-1.3.7.tgz
Unpack the sources. Once done you should see a directory rubygems-1.3.7.
[root@i-3781-9521-VM src]# tar -zxvf rubygems-1.3.7.tgz
[root@i-3781-9521-VM src]# cd rubygems-1.3.7
Compile and install rubygems
[root@i-3781-9521-VM rubygems-1.3.7]# sudo ruby setup.rb
You should see the following message and some information on notes and bugs
RubyGems 1.3.7 installed
=== 1.3.7 / 2010-05-13
Check the gems version
[root@i-3781-9521-VM rubygems-1.3.7]# gem -v
You should see
1.3.7
So far so good
Now install the gem: prawn. Ensure you install the specific version mentioned here.
[root@i-3781-9521-VM projectfedena-projectfedena_v2.0-a213125]# gem install prawn -v0.6.3
- Installing Rails
You should install the Rails framework.
[root@i-3781-9521-VM rubygems-1.3.7]# gem install rails -v2.3.5
Do not update the gems. You should also check if rake is version 0.8.7 otherwise do a gem uninstall rake and a gem install rake -v 0.8.7
- Installing MySQL
Some distributions come with MySQL 5.0.77-4.el5_6.6 so first lets remove it
[root@i-3781-9521-VM rubygems-1.3.7]# yum remove mysql mysql-server mysql-devel
Now install the MySQL database
[root@i-3781-9521-VM rubygems-1.3.7]# yum install mysql mysql-server mysql-devel
You should see the following message Complete!
Now lets start MySQL and secure the "root" user
[root@i-3781-9521-VM rubygems-1.3.7]# sudo /etc/init.d/mysqld start
While the MySQL server is being started you will be presented with instructions to create user accounts
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h i-3781-9521-VM password 'new-password'
Test your password using the following command
[root@i-3781-9521-VM rubygems-1.3.7]# mysql -uroot -p<your password>
Now install support for rails
[root@i-3781-9521-VM rubygems-1.3.7]# gem install mysql -- --with-mysql-config=/usr/lib64/mysql/mysql_config
Thats quick. Lets check to see if its properly installed. Start the interactive ruby shell
[root@i-3781-9521-VM rubygems-1.3.7]# irb
irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require 'mysql'
=> true
irb(main):003:0>
Now its time to install a server to serve your rails application over the web. Lets install Phusion's passenger
- Phusion's Passenger
There are other servers like Thin, Mongrel etc however Phusion is the preferred because it doesn't replicate the http request handling functionality of apache/nginx/lighttpd but instead latches on to apache and nginx as a module.
We'll now need to install the Passenger server to serve Fedena to all http requests coming in through Nginx.
[root@i-3781-9521-VM ruby-1.8.7-p352]# gem install passenger
[root@i-3781-9521-VM ruby-1.8.7-p352]# passenger-install-nginx-module
Its very likely that you see the following messages
Checking for required software...
* GNU C++ compiler... not found
* The 'make' tool... found at /usr/bin/make
* A download tool like 'wget' or 'curl'... found at /usr/bin/wget
* Ruby development headers... found
* OpenSSL support for Ruby... not found
* RubyGems... found
* Rake... found at /usr/local/bin/rake
* rack... found
* Curl development headers with SSL support... not found
* OpenSSL development headers... found
* Zlib development headers... not found
Some required software is not installed.
But don't worry, this installer will tell you how to install them.
Press Enter to continue, or Ctrl-C to abort.
Installation instructions for required software
* To install GNU C++ compiler:
Please run yum install gcc-c++ as root.
* To install OpenSSL support for Ruby:
Please (re)install Ruby with OpenSSL support by downloading it from http://www.ruby-lang.org/.
* To install Curl development headers with SSL support:
Please run yum install curl-devel as root.
* To install Zlib development headers:
Please run yum install zlib-devel as root.
If the aforementioned instructions didn't solve your problem, then please take
a look at the Users Guide:
At this point install the missing software and install ruby again with openssl support Lets first install zlib support
[root@i-3781-9521-VM ~]# cd ~/ruby-1.8.6
[root@i-3781-9521-VM ruby-1.8.7-p352]# ruby extconf.rb --with-zlib-include=/usr/include --with-zlib-lib=/usr/lib
[root@i-3781-9521-VM ruby-1.8.7-p352]# make
[root@i-3781-9521-VM ruby-1.8.7-p352]# sudo make install
Lets install openssl
[root@i-3781-9521-VM ruby-1.8.7-p352]# cd ~/ruby-1.8.6/ext/openssl
[root@i-3781-9521-VM openssl]# ruby extconf.rb
[root@i-3781-9521-VM ruby-1.8.7-p352]# make
[root@i-3781-9521-VM ruby-1.8.7-p352]# sudo make install
Install the passenger nginx module. If all is well you should see the following message
[root@i-3781-9521-VM ruby-1.8.7-p352]# passenger-install-nginx-module
http {
...
passenger_root /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.8;
passenger_ruby /usr/local/bin/ruby;
...
}
After you (re)start Nginx, you are ready to deploy any number of Ruby on Rails
applications on Nginx.
Suppose you have a Ruby on Rails application in /somewhere. Add a server block
to your Nginx configuration file, set its root to /somewhere/public, and set
'passenger_enabled on', like this:
server {
listen 80;
server_name www.yourhost.com;
root /somewhere/public; # <--- be sure to point to 'public'!
passenger_enabled on;
}
And that's it! You may also want to check the Users Guide for security and
optimization tips and other useful information:
/usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.8/doc/Users guide Nginx.html
- Download and setup Fedena
Download fedena from Github. The—no-check-certificate flag allows wget to connect without checking the certificate
[root@i-3781-9521-VM ~]# wget --no-check-certificate https://github.com/projectfedena/projectfedena_v2.0/tarball/master
A file "master" will be downloaded. Now rename the file as shown below
[root@i-3781-9521-VM ~]# cp master projectfedena-projectfedena_v2.0-a213125.tar.gz
[root@i-3781-9521-VM ~]# rm master
[root@i-3781-9521-VM ~]# chmod 777 projectfedena-projectfedena_v2.0-a213125.tar.gz
[root@i-3781-9521-VM ~]# tar -xvf projectfedena-projectfedena_v2.0-a213125.tar.gz
The contents of the file will be extracted into a directory
- Make changes to the database configuration file
Recollect the password you provided when you installed MySQL' Open the file database.yml in the config folder of the fedena source. Change the following details: database: fedena - The name of the database you want to use for fedena username: root - Mysql username for fedena password: mypass - The password for the above mysql user
- Set up Fedena databases
From the Fedena source directory in terminal run,
"rake db:create"
followed by,
"rake db:migrate"
- Install rest of the gems
"gem install declarative_authorization -v 0.5.1"
"gem install searchlogic -v 2.4.27"
"gem install i18n -v 0.4.2"
- Configure the virtual hosts
[root@i-3781-9521-VM ~]# nano /etc/httpd/conf/httpd.conf
<VirtualHost *:80>
ServerAdmin yourmailid@domain.ext
DocumentRoot /projectfedena-projectfedena_v2.0-a213125
ServerName www.domain.ext
</VirtualHost>
Restart the nginx server.
sudo /etc/init.d/httpd reload
Thats all there is to it. Visit the URL and you should see the fedena login page.
Other Options
[edit | edit source]A dedicated operating system iso of Fedena is available in Turnkey linux. Single click installer of Fedena for windows and Linux is available from certain Fedena Pro Service companies.
Sources
[edit | edit source]- http://www.projectfedena.org/download
- http://www.projectfedena.org/install
- http://projectfedena.org/forum/2-fedena-installation-and-troubleshooting/topics/837-rake-db-create-error-please-help-me
- http://erjayant.blogspot.com/2014/02/v-behaviorurldefaultvmlo_15.html (Has a lot of very helpful info)
- http://stackoverflow.com/questions/5176782/uninitialized-constant-activesupportdependenciesmutex-nameerror
- http://stackoverflow.com/questions/11028804/undefined-method-name-for-actionmailerstring
- http://stackoverflow.com/questions/12104860/rake-aborted-no-such-file-to-load-rush
- http://projectfedena.org/forum/2-fedena-installation-and-troubleshooting/topics/998-localhost-3000-error-on-windows
- http://www.projectfedena.org/forum/2-fedena-installation-and-troubleshooting/topics/553-how-to-start-the-fedena-server-automatically-when-windows-starts
- http://latunyj.wordpress.com/2012/03/29/install-project-fedena-version-2-2-on-win32/
- Video - Install in Windows http://www.youtube.com/watch?v=G5nQ-4Ng0vk
- Video - Install in Ubuntu http://www.youtube.com/watch?v=i0dF69o5r4M