Setting up SugarCRM on CentOS

Quick setup notes for setting up a SugarCRM system on a fresh CentOS install.’, ‘After installing CentOS we\’ll create a user account so that we don\’t have to log in as root all the time.. which could be dangerous.

#useradd \’username\’
#passwd \’username\’

Next, we\’ll start with running yum to get the system up to date:

#yum -y update

After this completes, but, before we reboot, lets shut off the services we don\’t need:

#chkconfig apmd off
#chkconfig isdn off
#chkconfig pcmcia off
#chkconfig cups off
#chkconfig netfs off
#chkconfig nfslock off
#chkconfig portmap off

Reboot:

#shutdown -r now

Now, let\’s install some additional services:

#yum -y install mysql mysql-bench mysql-server mysql-devel mysqlclient10 php-mysql httpd gcc pcre-devel php-gd gd mod_ssl glib2-devel gcc-c++

When that is complete, let\’s set the services to start on boot up:

#chkconfig mysqld on
#chkconfig httpd on

Now.. we don\’t want people to be able to ssh in as the root account (just bad practice) so we are going to remove that access from SSH, and you will need to log in with a user account and do \’su -\’ to become root.

#vi /etc/ssh/sshd_config

Now, change the following:

Original: #Protocol 2,1
NEW: Protocol 2

So, you are removing the # and the ,1 from that line.

Original: #PermitRootLogin yes
NEW: PermitRootLogin no

Again, we are removing the # and changing the \’yes\’ to \’no\’

Optional
I prefer to install Webmin to help with managing the server.. so you can do that now.

Ok.. installing SugarCRM.

So, we head over to http://www.sugarcrm.com and download the following .zip file:

Sugar Open Source 4.2.1d.zip

#unzip SugarSuite-4.2.1d.zip

#cd SugarSuite-Full-4.2.1d

#cp -R * /var/www/html
# chown -R apache.apache /var/www/html/*

Now we need to increase the php memory limit which is defaulted to 8M.. we need 32M.

#vi /etc/php.ini

Change:

Original: memory_limit = 8M
NEW: memory_limit = 32M

Now to setup permissions on the files for SugarCRM:

#cd /var/www/html

#chmod -R 777 config.php custom/ modules/ data/ cache/

Now, we restart apache so that the php.ini config changes are in use.

#service httpd restart

Next, open your web browser and go to http://yourmachineIP/install.php

You should see the SugarCRM install wizard.

Click next a few times, and on the Database Config page, click the \’create database\’ and \’create user\’ check boxes and click next.

Next.. create password, next..next.. and your done! 🙂

Now, just change the root password in MySQL:

#mysqladmin -u root password PaSsWoRd

and it\’s good to go!

Upgrading CRM

First, let\’s make a backup. Since I didn\’t mention this above, I will do it now.

Go to the admin panel and select “Backups” and type in the following:

Directory: /tmp
Filename: sugarbackup03012007.zip

Click “Confirm Settings” and the “Run Backup”. You will now have a .zip file in your /tmp directory. I suggest you sftp that file out to another server just to be safe, and you should probably run this often enough to make sure that if something happens you don\’t lose all your configs and settings. But, you still need to backup your MySql data.

Next, do this:

# mysqldump –opt -u root -p sugarcrm > sugarsql03012007.bak
type in the password and it should dump the data. Next, let\’s gzip it to make it smaller.

# gzip sugarsql03012007.bak

All done.

Enough of this, let\’s get on with the upgrade.

Back on the admin page, you will see that there is an upgrade available.. So first, we click on “About” in the upper right corner to see which version we are currently running. Our is 4.2.1d.. so we need to upgrade from that to 4.5.1.. so lets head over to sugarcrm.com and download the latest version.. We are going to use the “Sugar Open Source” link as it is for installing on top of your existing stack. So, we want to get the “Sugar Open Source Upgrade 4.2.1 to 4.5.1 ” version.


So, click on the link and download the file to your computer. When that is done, go to the admin screen and click on “Upgrade Wizard”, click the “browse” button and select the file you downloaded above. Now, click the “Upload” button and wait.

If your upstream is like mine.. you wait.. and wait.. Eh.. let\’s go get a soda..

Yeah.. now we just click on the “Install” button.

Now, because we have custom layouts, we are going to get prompted and we are going to leave all the check boxes blank.. it\’s up to you if you want to recreate the changes. Click “Commit”

If you get a message stating files need to be writeable, just go into the following directory:

# cd /var/www/html

and type:

# chmod 777 -R include/ install/

etc.. and do it for every file or directory listed.

Then go back to admin/Upgrade Wizard and do it again.

Follow the prompts..

Leave a Reply