Global Open Versity, Vancouver Canada
Installing SugarCRM on FC10, CentOS52 & RHE5 v1.3
SugarCRM on Linux HowTo by Kefa Rabah,
[email protected]
March 27, 2009
Here are two methods you can use to install SugarCRM on Linux FC10, CentOS5 & RHE5. In our case we used Method I to install SugarCRM on Linux CentOS5 on a VMWare on a PC running Windows XP Pro. However, if you have enough guts and power of time and frustration then go for Method II. Install Linux CentOS52 1. Download the CentOS5 image files DVD ISO and burn onto a DVD. 2. Install CentOS5 using the standard “Server” settings (don’t check to install Server option setup as it will put all the Apache, PHP, and MySQL files in the wrong place. Enable Firewall, Enable SELinux and set it to Permissive mode, Install Default Software Packages). 3. Finish Installing, Reboot, Login as ‘root’ 4. After booting, click Desktop -> Security -> Security Level, check the box next to WWW (HTTP), click OK to close.
Install SugarCRM SugarCRM is the market-leading, commercial Open Source customer relationship management (CRM) application. SugarCRM’s Open Source architecture easily adapts to any business environment by offering a more flexible, cost-effective alternative than proprietary applications. It offers a complete CRM system for businesses of all sizes. For a small business SugarCRM can be a huge time and expense saver. It requires minimal technical knowledge to get it installed and the built in web administration console and backup system allow you to feel comfortable that it’s going to keep running. Core SugarCRM functionality includes sales automation, marketing campaigns, support cases, project mgmt, calendaring and more. Built in PHP, supports MySQL and SQL Server allows it that cool functionality LAMP system.
Method I: SugarCRM on XAMPP XAMPP is a LAMPP package developed by Apache Friends. Many people know from their own experience that it's not easy to install an Apache web server and it gets harder if you want to add MySQL, PHP and Perl as you can see from Method I above. XAMPP is an easy to install Apache distribution containing MySQL, PHP and Perl. XAMPP is really very easy to install and to use - just download, extract and start. Step 1: Download Download XAMPP from http://www.apachefriends.org/en/xampp.html. Choose option for your favorite OS, mine is Linux. The latest package as of this writing is: xampp-linux-1.7.tar.gz. Step 2: Installation After downloading simply type in the following commands: 1. Go to a Linux shell and login as the system administrator root:
April 2007, Kefa Rabah, Global Open Versity, Vancouver Canada
www.globalopenversity.org
1
A GOV Open Knowledge Access Technical Publication HowTo
Global Open Versity, Vancouver Canada
# su
Installing SugarCRM on FC10, CentOS52 & RHE5 v1.3
\\ to change to root user
2. Extract the downloaded archive file to /opt: # tar -xvzf xampp-linux-1.7.tar.gz -C /opt Warning: Please use only this command to install XAMPP. DON'T use any Microsoft Windows tools to extract the archive, it won't work. Warning 2: already installed XAMPP versions get overwritten by this command. That's all. XAMPP is now installed below the /opt/lampp directory. 3. Edit the php.ini file in /opt/lampp/etc/ as follows: Search for: memory_limit = 8M, change 8M to 32M Again search: upload_max_filesize = 8M change 2M to 8M Save & Close file Step 3: Start 1. To start XAMPP simply call this command: # /opt/lampp/lampp start
2. You should now see something like this on your screen: Starting XAMPP 1.7... LAMPP: Starting Apache... LAMPP: Starting MySQL... LAMPP started. Ready. Apache and MySQL are running. If you get any error messages please take a look at the
Linux FAQ.
Step 4: Test OK, that was easy but how can you check that everything really works? Just type in the following URL at your favorite web browser: http://localhost
Now you should see the start page of XAMPP containing some links to check the status of the installed software and some small programming examples. Make to click the Security link and follow the instruction necessary to secure your XAMPP engine.
April 2007, Kefa Rabah, Global Open Versity, Vancouver Canada
www.globalopenversity.org
2
A GOV Open Knowledge Access Technical Publication HowTo
Global Open Versity, Vancouver Canada
Installing SugarCRM on FC10, CentOS52 & RHE5 v1.3
Step 5: Install SugarCRM on XAMPP 1. Go to http://www.sugarcrm.com/crm/download/sugar-suite.html and download SugarCRM Community Edition the open source option or buy the commercial version as desired. At the time of writing we downloaded the: SugarCE 5.2.0a.zip To perform the installation procedure ensure that you change to root user, i.e., su 2. Copy and extract the downloaded archive file to /opt/lampp/htdocs directory # cp SugarCRM-5.2.0a.zip
/opt/lampp/htdocs
# cd /opt/lampp/htdocs [root @fcds httdocs]# unzip SugarCRM-5.2.0a.zip 3. Rename the SugarCRM-5.2.0a to sugarsuite and then issue these commands from the terminal window to set the permission as follows: #chmod -R 755 /opt/lampp/htdocs/sugarsuite #cd /opt/lampp/htdocs/sugarsuite #chmod #chmod #chmod #chmod #chmod #chmod
-R -R -R -R -R -R
777 777 777 777 777 777
./cache/ ./custom/ ./data/ ./modules/ config.php .htaccess
3. To install SugarCRM, open a browser and type: http://localhost/sugarsuite/ 4. Follow installation instruction: Create User, Create Database. Finish Installation. Hooray! Sugar install on Linux XAMPP is finished!
Method II: Install SugarCRM using LAMP (Linux, Apache, PHP, and MySQL) 1. Launch your favorite Web browser from your installed Linux CentOS5 2. From www.mysql.com download the v5.0.77 MySQL Linux x86 RPM Files, you will need the Server, Client Program, Libraries & Headers, and Dynamic Client Libraries. 3. From www.php.net download PHP 5.2.8 (tar.gz) 4. From www.apache.org download Apache 2.2.3 (tar.gz) 5. Copy downloaded files to /usr/src directory 6. Open a terminal window, Applications -> System Tools -> Terminal 7. Type the following in the terminal to install MySQL: #cd /usr/src #rpm -i MySQL* #mysql_install_db #mysqld_safe &
\\(don’t worry if MySQL fails to start)
April 2007, Kefa Rabah, Global Open Versity, Vancouver Canada
www.globalopenversity.org
3
A GOV Open Knowledge Access Technical Publication HowTo
Global Open Versity, Vancouver Canada
Installing SugarCRM on FC10, CentOS52 & RHE5 v1.3
< hit enter again > 8. Now set the root password for MySQL #mysqladmin –u root password 'enter-new-root-password-in-single-quotes'
9. Now check to see if install was successful #mysqlshow –p Enter Password:
10. You should see something like: Databases ------------mysql test 11. 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 12. 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 \ --with-mysql-sock=/var/lib/mysql/mysql.sock #make #make install
13. Now copy the php.ini file to the correct place #cp php.ini-dist /usr/local/lib/php.ini 14. Edit the php.ini file
April 2007, Kefa Rabah, Global Open Versity, Vancouver Canada
www.globalopenversity.org
4
A GOV Open Knowledge Access Technical Publication HowTo
Global Open Versity, Vancouver Canada
Installing SugarCRM on FC10, CentOS52 & RHE5 v1.3
Search for: memory_limit = 8M, change 8M to 32M Again search: upload_max_filesize = 8M change 2M to 8M Save & Close file 15. Look for libphp4.so file in /usr/local/apache2/modules/ to make sure it’s there. 16. Edit the Apache configuration file in /usr/local/apache2/conf/httpd.conf 17. Find loadmodule and make sure this line was added, ( or add ) LoadModule php4_module modules/libphp4.so
18. Find addtype and add: #AddType application/x-tar.tgz AddType application/x-httpd-php .php .phtml AddType application/x-httpd-php-source .phps
19. Find directoryindex and add index.php to the line: DirectoryIndex index.php index.html index.html.var 20. 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 /usr/local/apache2/modules/libphp4.so –t shlib_t 21. Now try and start: #/usr/local/apache2/bin/apachectl start 22. Test Apache by opening a web browser and typing in http://localhost/. You should see an apache success screen. 23. Test PHP 24. Create a file in /usr/local/apache2/htdocs/ named test.php and enter the following line in the file: Save and Close. Set permissions on file to 755 using chmod command. Now in a browser type http://localhost/test.php. You should see a PHP information screen with your current settings. 25. Edit MySQL’s my.cnf file Edit or create the /etc/my.cnf file, make it look like the following: April 2007, Kefa Rabah, Global Open Versity, Vancouver Canada
www.globalopenversity.org
5
A GOV Open Knowledge Access Technical Publication HowTo
Global Open Versity, Vancouver Canada
Installing SugarCRM on FC10, CentOS52 & RHE5 v1.3
[mysqld] #use old password encryption method (needed for 4.0 and older clients). old-passwords basedir=/var/lib/mysql Save and Close file. 26. Edit the MySQL startup file /etc/init.d/mysql Find: basedir=/ Change to: basedir=/var/lib/mysql 27. Restart MySQL by going clicking Desktop -> System Settings -> Server Settings -> Services select mysql, click Restart or use command-line: service mysqld start 28. Create sugarsuite folder in /usr/local/apache2/htdocs 29. Copy the contents of the SugarCRM-5.2.0a folder ( or latest ) to the sugarsuite folder, i.e., # cd /usr/local/apache2/htdocs # mv SugarCRM-5.2.0a
sugarsuite
30. Set SugarCRM directory permissions in terminal window as follows. #chmod -R 755 /usr/local/apache2/htdocs/sugarsuite 31. Set permissions on all files to 777 for installation from the terminal as follows: # cd /usr/local/apache2/htdocs/sugarsuite # # # # # #
chmod chmod chmod chmod chmod chmod
-R -R -R -R -R -R
777 777 777 777 777 777
./cache/ ./custom/ ./data/ ./modules/ config.php .htaccess
32. To install SugarCRM, open a browser and type http://localhost/sugarsuite/ You can also http://www.mydomain.com/sugarsuite. 33. Follow install Wizard instruction: Create User, Create Database. Finish Installation. 34. Hooray! Sugar install is finished! 35. 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/ 36. Edit the /etc/init.d/apachectl file: Add/uncomment the lines in bold. # 1/bin/sh
April 2007, Kefa Rabah, Global Open Versity, Vancouver Canada
www.globalopenversity.org
6
A GOV Open Knowledge Access Technical Publication HowTo
Global Open Versity, Vancouver Canada
Installing SugarCRM on FC10, CentOS52 & RHE5 v1.3
# chkconfig: - 85 15 # description: Apache is a Web server to serve HTML files and CGI. # # copyright (c) 2000-2004 The Apache Software Foundation
37. To enable httpd to start automatically. Type in a terminal: # /sbin/chkconfig --add apachectl 38. Reboot server to see if everything starts up and works! 39. Login into your SugarCRM
April 2007, Kefa Rabah, Global Open Versity, Vancouver Canada
www.globalopenversity.org
7
A GOV Open Knowledge Access Technical Publication HowTo
Global Open Versity, Vancouver Canada
Installing SugarCRM on FC10, CentOS52 & RHE5 v1.3
40. Enjoy Enterprise quality CRM by SugraCRM.
41. Stay tuned for future improvement on SugarCRM Useful Links: • • • • • •
http://dan.drydog.com/apache2php.html PHP and Apache install http://us3.php.net/manual/en/install.unix.apache2.php PHP and Apache install http://dev.mysql.com/doc/mysql/en/old-client.html using old passwords with MySQL http://www.sugarcrm.com/forums/showthread.php?t=3056 using old passwords with MySQL http://www.sugarcrm.com/forums/showthread.php?t=3773 setting file permissions http://www.apachefriends.org/en/xampp.html - XAMPP by Apache Friends
------------------------------------------------Kefa Rabah is the Founder and CIO, of Serengeti Systems Group Inc. Kefa is knowledgeable in several fields of Science & Technology, IT Security Compliance and Project Management, and Renewable Energy Systems. He is also the founder of Global Open Versity, a Center of Excellence in online eLearning.
April 2007, Kefa Rabah, Global Open Versity, Vancouver Canada
www.globalopenversity.org
8
A GOV Open Knowledge Access Technical Publication HowTo