Linux Guide/Installing SugarCRM On Linux

Here is how I installed 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
 * 1) cd /usr/src
 * 2) rpm -i MySQL* 		(don’t worry if MySQL fails to start)
 * 3) mysql_install_db
 * 4) mysqld_safe &


 * Now set the root password for MySQL
 * 1) mysqladmin –u root password ‘enter-new-root-password-in-single-quotes’

Enter Password:
 * Now check to see if install was successful
 * 1) mysqlshow –p

You should see something like:

Databases - mysql test

Enter Password: mysql>SET PASSWORD FOR ‘root’@’localhost’=OLD_PASSWORD(‘New-Password’); mysql>use mysql mysql>delete from user where User=’’; mysql>quit
 * 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.
 * 1) mysql –u root –p

--with-mysql-sock=/var/lib/mysql/mysql.sock
 * Now MySQL is installed and we need to install Apache and PHP. Type:
 * 1) gzip –d httpd-2.0.54.tar.gz
 * 2) tar xvf httpd-2.0.54.tar
 * 3) gunzip php-4.3.11.tar.gz
 * 4) tar -xvf php-4.3.11.tar
 * 5) cd httpd-2.0.54
 * 6) ./configure --enable-so
 * 7) make
 * 8) make install
 * 9) cd ../php-4.3.11
 * 10) ./configure --with-apxs2=/usr/local/apache2/bin/apxs \   (hit enter key)
 * 1) make
 * 2) make install


 * Now copy the php.ini file to the correct place
 * 1) cp php.ini-dist /usr/local/lib/php.ini

Search for: memory_limit = 8M, change 8M to 16M Save & Close file
 * Edit the php.ini 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
 * 1) /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:
 * 1) chcon –t shlib_t /usr/local/apache2/modules/libphp4.so

now try and start:
 * 1) /usr/local/apache2/bin/apachectl start

Create a file in /usr/local/apache2/htdocs/ named test.php and enter the following line in the file:
 * Test Apache by opening a web browser and typing in http://localhost/ . You should see an apache success screen.
 * Test PHP



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 or create the /etc/my.cnf file, make it look like the following:
 * Edit MySQL’s my.cnf file

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

Save and close file.


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

Find: basedir=/ and change to: basedir=/var/lib/mysql

select mysql, click restart
 * restart MySQL by going clicking Desktop -> System Settings -> Server Settings -> Services


 * 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:
 * 1) chmod -R 777 /usr/local/apache2/htdocs/sugarsuite


 * alternate instructions that worked great for me...
 * 1) cd .. [now in htdocs folder]
 * 2) chown -R apache sugarsuite [change file owner to the apache webserver]
 * 3) cd sugarsuite [back to sugar webroot]
 * 4) chmod -R 775 cache custom data modules
 * alternately #chmod -R 775 ./cache/ ./custom/ ./data/ ./modules/
 * 1) chmod 664 config.php
 * 1) 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.
 * 1) chmod -R 755 /usr/local/apache2/htdocs/sugarsuite
 * 2) cd /usr/local/apache2/htdocs/sugarsuite
 * 3) chmod -R 777 ./cache/ < does not work!
 * 4) chmod -R 777 ./custom/
 * 5) chmod -R 777 ./data/
 * 6) chmod -R 777 ./modules/
 * 7) 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:
 * 1) cp /usr/local/apache2/bin/apachectl /etc/init.d/


 * Edit the /etc/init.d/apachectl file: Add the lines in bold.

# #chkconfig: - 85 15 #description: Apache is a Web server to serve HTML files and CGI. #
 * 1) 1/bin/sh
 * 1) copyright (c) 2000-2004 The Apache Software Foundation


 * To enable httpd to start automatically. Type in a terminal:
 * 1) /sbin/chkconfig --add apachectl


 * Reboot server to see if everything starts up and works!