📜 ⬆️ ⬇️

Installing Fat Free Crm on Apache + Phusion Passenger

Recently, I was tasked with deploying a free CRM with a web interface. After a brief search on the Internet, I came across Fat Free Crm . On the site, I did not find installation instructions and therefore put on a whim. Hope my installation experience will help someone.
UPD Added on the basis of comments.

Preamble



My installation was on the Gentoo Linux OS, but I don’t think it will be difficult to repeat on other OSes.
So let's get started.
We believe that we have already installed Ruby on Rails. Here are the versions of the packages on which I deployed the application:

  # emerge ruby ​​rubygems rails rack passenger -p

 It would be merged, in order:

 Calculating dependencies ... done!
 [ebuild R] dev-lang / ruby-1.8.6_p369 
 [ebuild R] dev-ruby / rubygems-1.3.5 
 [ebuild R] dev-ruby / rack-1.0.0 
 [ebuild R] dev-ruby / rails-2.3.4 
 [ebuild R] www-apache / passenger-2.2.4

')

Installing and configuring CRM



We download source codes from here , we unpack on the server in a directory with the sites. For example, in /var/www/crm.example.com/htdocs/.

Go to this directory:
  # cd /var/www/crm.example.com/htdocs/ 


Create a MySQL database:
 # mysql -uMYSQL_USER -pMYSQL_PASSWORD
 > create database fat_free_crm;
 > grant all privileges on fat_free_crm. * to 'fat_free_crm' @ 'localhost' identified by 'PASSWORD';
 > flush privileges;
 > quit


MYSQL_USER your MySQL user to work with the database
MYSQL_PASSWORD user password MYSQL_USER
PASSWORD user password fat_free_crm

Now create a file with the database connection configuration:

config / database.yml:
 production:
   adapter: mysql
   encoding: utf8
   database: fat_free_crm
   host: localhost
   username: fat_free_crm
   password: PASSWORD


In the config / database.mysql.yml file there are examples that will help to adapt the configuration file to your needs, for example, connect to the database via a socket.

In the config / environment.rb file, comment out the line
  RAILS_GEM_VERSION = '2.3.2' unless defined?  RAILS_GEM_VERSION 

for the application to use the latest version of Rails installed on the system.

Next in the file public / dispatch.cgi you need a line
 require "dispatcher"

replaced by
 require "/usr/lib64/ruby/gems/1.8/gems/rails-2.3.4/lib/dispatcher.rb"


The point is to specify the full path to the Rails Manager in the file.

Now let's deploy the database schema:

 # RAILS_ENV = production rake crm: setup


Web server setup



It remains a trifle: configure apache to work with this wonderful application.
Let's set the rights to files:

 # chown -R apache: apache *


Instead of apache: apache, you need to enter the user: the group on whose behalf you want to run the application.

Now we will configure a virtual host.

/etc/apache2/vhosts.d/crm_example_com.conf:
 <VirtualHost *: 80>
         ServerName crm.example.com
         ServerAdmin dadmin@example.com
         ErrorLog /var/www/crm.example.com/error/error_log
         CustomLog /var/www/crm.example.com/error/access_log combined
         DocumentRoot /var/www/crm.example.com/htdocs/public
         <Directory /var/www/crm.example.com/htdocs/public>
                 Options Indexes ExecCGI FollowSymLinks
                 RailsEnv production # This line is optional, it is not needed for a normal installation.
                 AllowOverride all
                 Allow from all
                 Order allow, deny
         </ Directory>
 </ Virtualhost>


Final chord:

 # /etc/init.d/apache2 reload

Source: https://habr.com/ru/post/70534/


All Articles