Difference between revisions of "Installing SugarCRM"

From Freephile Wiki
Jump to navigation Jump to search
(New page: A pre-requisite to Importing contacts, you need to install SugarCRM if you do not already have a working system == Download and Install SugarCRM == SugarCRM provides easy stack instal...)
 
(adds Dependencies into a section)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
A pre-requisite to [[Importing contacts]], you need to install SugarCRM if you do not already have a working system
 
A pre-requisite to [[Importing contacts]], you need to install SugarCRM if you do not already have a working system
 +
 +
== Dependencies for SugarCRM ==
 +
There are some PHP modules that Sugar relies on, so you may want to check for those prior to installing.  Sugar is programmed to use the PHP IMAP module for mailing and the PHP CURL module for getting remote files.
 +
<source lang="bash">
 +
php -m | grep -i curl
 +
php -m | grep -i imap
 +
</source>
 +
If those modules are not installed, then you can install them via apt-get
 +
<source lang="bash">
 +
sudo apt-get install php5-curl php5-imap
 +
</source>
  
 
== Download and Install SugarCRM ==
 
== Download and Install SugarCRM ==
SugarCRM provides easy stack installers which make trying the system as close to a one-click operation as possible.  However, in the many scenarios the developer or system administrator will want to install into an existing infrastructure so we'll assume that approach.
+
SugarCRM provides easy stack installers which make trying the system as close to a one-click operation as possible.  That is great for trying it out.
 +
If you are beyond the exploration stage you will want to install into an existing infrastructure, so we'll assume that approach.
 +
 
 
# Visit the [http://sugarcrm.com SugarCRM homepage], and click the top navbar link to "Sugar Open Source"
 
# Visit the [http://sugarcrm.com SugarCRM homepage], and click the top navbar link to "Sugar Open Source"
 
# Skip the "Wizard" and go right to the "Download Page" because you know what you're doing and also have a pre-existing setup of Linux, Apache MySQL and PHP
 
# Skip the "Wizard" and go right to the "Download Page" because you know what you're doing and also have a pre-existing setup of Linux, Apache MySQL and PHP
 
# Download SugarCE-5.0.0e.zip (production release) or the later available production release (getting only the application).
 
# Download SugarCE-5.0.0e.zip (production release) or the later available production release (getting only the application).
 
# Visit the recommended "Installation" instructions page at http://www.sugarforge.org/content/installation/
 
# Visit the recommended "Installation" instructions page at http://www.sugarforge.org/content/installation/
# Install SugarCRM according to the instructions. Note: I immediately ran into trouble because the instructions did say to chmod 766 all files that needed to be writable by the web_user. This command renders the directories non-executable which manifests in include errors because the web user (www-data) can not see into those directories (to find includes). The following snippet is a fix:
+
# Install SugarCRM according to the instructions.
 +
## The short version is to extract the zip to a place in your webroot <source lang="bash">unzip -d /var/www/ SugarCE-5.1.0a.zip</source>
 +
## I typically use a symbolic link to make the application home at a friendly URL and easier to manage <source lang="bash">ln -s SugarCE-5.1.0a crm</source>
 +
# There are a number of directories that Sugar expects to have write access to, but they won't be from the unzip. There are also a couple of configuration files that the installer needs to be able to write to; namely config.php and .htaccess
 +
# Execute this simple command to prepare your web directory
 
<source lang="bash">
 
<source lang="bash">
# find directories in the ./crm path and change the mode on them so that all users can execute (see into) the directory
+
# recursively change ownership on the directories and set the sticky bit
find ./crm/ -type d |xargs chmod a+x  
+
for x in cache custom data modules; do sudo chown -R www-data:www-data $x; sudo chmod -R +t $x; done
</source>  
+
# change ownership of the configuration files
 +
for x in config.php .htaccess; do sudo chown www-data:www-data $x; done
 +
</source>
  
There is one more 'gotcha' that I ran into with the installation.  The application wants to create a .htaccess file (which doesn't exist in the distribution and would not necessarily be writable to the web user.)  As a failsafe, the .htaccess content is printed to the screen in the installer.  However it doesn't properly display (lacking newline characters) so the content is not suitable for copy and paste into the file.  I resorted to the source which generates the .htaccess content, and used that.  An alternative is to simply touch and chmod 777 a .htaccess file '''prior''' to running the installer; and then chmod'ing it go=r after install.
+
After the install, I believe you should secure your configuration files with <source lang="bash">
 +
chmod go -rwx config.php .htaccess
 +
</source>

Latest revision as of 12:56, 3 October 2008

A pre-requisite to Importing contacts, you need to install SugarCRM if you do not already have a working system

Dependencies for SugarCRM[edit | edit source]

There are some PHP modules that Sugar relies on, so you may want to check for those prior to installing. Sugar is programmed to use the PHP IMAP module for mailing and the PHP CURL module for getting remote files.

php -m | grep -i curl
php -m | grep -i imap

If those modules are not installed, then you can install them via apt-get

sudo apt-get install php5-curl php5-imap

Download and Install SugarCRM[edit | edit source]

SugarCRM provides easy stack installers which make trying the system as close to a one-click operation as possible. That is great for trying it out. If you are beyond the exploration stage you will want to install into an existing infrastructure, so we'll assume that approach.

  1. Visit the SugarCRM homepage, and click the top navbar link to "Sugar Open Source"
  2. Skip the "Wizard" and go right to the "Download Page" because you know what you're doing and also have a pre-existing setup of Linux, Apache MySQL and PHP
  3. Download SugarCE-5.0.0e.zip (production release) or the later available production release (getting only the application).
  4. Visit the recommended "Installation" instructions page at http://www.sugarforge.org/content/installation/
  5. Install SugarCRM according to the instructions.
    1. The short version is to extract the zip to a place in your webroot
      unzip -d /var/www/ SugarCE-5.1.0a.zip
      
    2. I typically use a symbolic link to make the application home at a friendly URL and easier to manage
      ln -s SugarCE-5.1.0a crm
      
  6. There are a number of directories that Sugar expects to have write access to, but they won't be from the unzip. There are also a couple of configuration files that the installer needs to be able to write to; namely config.php and .htaccess
  7. Execute this simple command to prepare your web directory
# recursively change ownership on the directories and set the sticky bit
for x in cache custom data modules; do sudo chown -R www-data:www-data $x; sudo chmod -R +t $x; done
# change ownership of the configuration files
for x in config.php .htaccess; do sudo chown www-data:www-data $x; done

After the install, I believe you should secure your configuration files with

chmod go -rwx config.php .htaccess