Linux Guide/Installing SugarCRM On Linux

Here is how I installed SugarCRM on a new PC:

  • Download the four Fedora Core 4 image files and make install CD’s
  • Install Fedora Core 4 using the standard “Workstation” settings ( don’t use the Server setup as it will put all the Apache, PHP, and MySQL files in the wrong place. Enable Firewall, Enable SELinux, Install Default Software Packages )
  • Finish Installing, Reboot, Login as ‘root’
  • After booting, click Desktop -> Security -> Security Level ( if using Gnome GUI ), check the box next to WWW (HTTP), click OK to close.
  • Launch WEB browser
  • From http://www.mysql.com/ download the v4.1.12 MySQL Linux x86 RPM Files, you will need the Server, Client Program, Libraries & Headers, and Dynamic Client Libraries.
  • From http://www.php.net/ download PHP 4.3.11 (tar.gz)
  • From http://www.apache.org/ download Apache 2.0.54 (tar.gz)
  • Copy downloaded files to /usr/src directory
  • Open a terminal window, Applications -> System Tools -> Terminal
  • Type the following in the terminal to install MySQL
#cd /usr/src
#rpm -i MySQL*          ( don’t worry if MySQL fails to start )
#mysql_install_db
#mysqld_safe &
< hit enter again >
  • Now set the root password for MySQL
#mysqladmin –u root password ‘enter-new-root-password-in-single-quotes’
  • Now check to see if install was successful
#mysqlshow –p
Enter Password:

You should see something like:

Databases
---------
mysql
test
  • Now we need to set the ‘root’ password to the old password format and delete the blank user that was created automatically when MySQL was installed.
#mysql –u root –p
Enter Password:
mysql>SET PASSWORD FOR ‘root’@’localhost’=OLD_PASSWORD(‘New-Password’);
mysql>use mysql
mysql>delete from user where User=’’;
mysql>quit
  • Now MySQL is installed and we need to install Apache and PHP. Type:
#gzip –d httpd-2.0.54.tar.gz
#tar xvf httpd-2.0.54.tar
#gunzip php-4.3.11.tar.gz
#tar -xvf php-4.3.11.tar
#cd httpd-2.0.54
#./configure --enable-so
#make
#make install
#cd ../php-4.3.11
#./configure --with-apxs2=/usr/local/apache2/bin/apxs \        (hit enter key)
 --with-mysql-sock=/var/lib/mysql/mysql.sock
#make
#make install
  • Now copy the php.ini file to the correct place
#cp php.ini-dist /usr/local/lib/php.ini
  • Edit the php.ini file

Search for: memory_limit = 8M, change 8M to 16M Save & Close file

  • Look for libphp4.so file in /usr/local/apache2/modules/ to make sure it’s there.
  • Edit the Apache configuration file in /usr/local/apache2/conf/httpd.conf

Find loadmodule and make sure this line was added, ( or add )

LoadModule php4_module modules/libphp4.so

Find addtype and add

AddType application/x-tar.tgz
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps

Find directoryindex and add index.php to the line:

DirectoryIndex index.php index.html index.html.var
  • launch apache by typing in the terminal
#/usr/local/apache2/bin/apachectl start

If you get the following error: “ Cannot load /usr/local/apache2/modules/libphp4.so into server: /usr/local/apache2/modules/libphp4.so : cannot restore segment prot after reloc: Permission Denied” Type:

#chcon –t shlib_t /usr/local/apache2/modules/libphp4.so

now try and start:

#/usr/local/apache2/bin/apachectl start
  • Test Apache by opening a web browser and typing in http://localhost/ . You should see an apache success screen.
  • Test PHP

Create a file in /usr/local/apache2/htdocs/ named test.php and enter the following line in the file:

<?php phpinfo(); ?>

Save and close. Set permissions on file to 755. Now in a browser type http://localhost/test.php You should see a PHP information screen with your current settings.

  • Edit MySQL’s my.cnf file

Edit or create the /etc/my.cnf file, make it look like the following:

[mysqld]
#use old password encryption method ( needed for 4.0 and older clients ).
old-passwords
basedir=/var/lib/mysql

Save and close file.

  • Edit the MySQL startup file /etc/init.d/mysql

Find: basedir=/ and change to:

basedir=/var/lib/mysql
  • restart MySQL by going clicking Desktop -> System Settings -> Server Settings -> Services

select mysql, click restart

  • create sugarsuite folder in /usr/local/apache2/htdocs
  • copy the contents of the SugarCRM 3.0.1 folder ( or latest ) to the sugarsuite folder
  • Set permissions on all files to 777 for installation. Type in a terminal :
#chmod -R 777 /usr/local/apache2/htdocs/sugarsuite
    • alternate instructions that worked great for me...
#cd ..  [now in htdocs folder]
#chown -R apache sugarsuite    [change file owner to the apache webserver]
#cd sugarsuite   [back to sugar webroot]
#chmod -R 775 cache custom data modules
    • alternately #chmod -R 775 ./cache/ ./custom/ ./data/ ./modules/
#chmod 664 config.php
  • To install SugarCRM, open a browser and type http://localhost/sugarsuite/
  • Follow install instruction: Create User, Create Datbase. Finish Installation.
  • Set SugarCRM directory permissions in terminal window.
#chmod -R 755 /usr/local/apache2/htdocs/sugarsuite
#cd /usr/local/apache2/htdocs/sugarsuite
#chmod -R 777 ./cache/ < does not work!
#chmod -R 777 ./custom/
#chmod -R 777 ./data/
#chmod -R 777 ./modules/
#chmod -R 444 config.php
  • Sugar install is finished!
  • Now let’s add apache to the startup process. First. Let’s copy the apache startup file to the startup directory. Type in the terminal:
#cp /usr/local/apache2/bin/apachectl /etc/init.d/
  • Edit the /etc/init.d/apachectl file: Add the lines in bold.
#1/bin/sh
#
#chkconfig: - 85 15
#description: Apache is a Web server to serve HTML files and CGI.
#
#copyright (c) 2000-2004 The Apache Software Foundation
  • To enable httpd to start automatically. Type in a terminal:
#/sbin/chkconfig --add apachectl
  • Reboot server to see if everything starts up and works!
Last modified on 21 February 2009, at 21:04