Pages

Thursday, February 13, 2014

SugarCRM Troubleshooting: SugarCRM 7 Installs

Wow! - That was my initial reaction when I first saw early versions of SugarCRM 7.0 (Sugar 7) a little over a year ago. It reminded me of how impressed I was the first time I saw Sugar in its 3.0 days.

Fast forward to today and a lot of folks have had a chance to experience the same. New customers utilizing the SugarCRM OnDemand environment have had access to 7.0 for a few months. More recently, new on-premise customers utilizing classic LAMP stacks have also been able to take advantage of all the great new features in 7.0. 

As the with any new software release, as it gets exposed to greater quantity of users, certain patterns emerge relating to common problems users encounter. Sugar 7 is no exception. 

Perhaps the most common issue in the 7.0 world today is one where the install procedure completes without error, but after completion, the Sugar login page never displays. In its place, users will see the following:

It would seem Sugar never stops loading because the message never goes away. This is actually not far from the truth, but fortunately, there is a very simple fix to this problem. Before we look at the solution, it is worth briefly discussing the nature of the problem, as it is directly related to an important change that has been introduced into the Sugar architecture.

The reason for the error is that Sugar 7 relies on a web server feature termed URL rewriting in order to access its new RESTful API and in turn, function as an application. Were you to examine the .htaccess file located in the root directory of a Sugar 7 install, you would see the various rewrite rules that Sugar 7 relies upon. 

Side note: If you wish to learn more about URL rewriting, take a look at this post: http://www.addedbytes.com/articles/for-beginners/url-rewriting-for-beginners/

In order for this feature to work on Apache, one must do two things: enable the mod_rewrite Apache module and configure the corresponding directory for a site to allow rewriting. Both of these are typically accomplished by means of some edits to the Apache configuration file, httpd.conf.

Most Linux distributions already include mod_rewrite, but it is not always enabled. To enable it, edit the Apache configuration file and ensure that the line loading the mod_rewrite.so module is not commented out. Note that depending on your distribution, the main Apache configuration file may be loading other configuration files indicating which modules should be loaded.

Our next change relates to the configuration of the directory where the Sugar 7 files have been placed. For the purposes of our example, let us assume that Sugar 7 was installed to /var/www/html/sugarcrm/

Our httpd.conf entry for this directory would need to be configured as follows:

<Directory "/var/www/html/sugarcrm">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>

After you have applied your changes, restart Apache and try loading Sugar 7 once again. If all went well, you should now see the new login page, picture below:

If you continue to see the Loading... message, double check that the mod_rewrite module is indeed enabled. One quick way to check from within your browser if the configuration is adequate is by attempting to visit the following URL:

http://your_sugarcrm_url/rest/v10/help

Should you see anything besides a help file listing a number of API methods, it is an indicator that mod_rewrite is not functioning/enabled or the directory configuration is not allowing rewriting. Neither of these is optional.

3 comments:

  1. I'm with Nirban, the rest/v10/help works fine, the Loading screen still shows.

    ReplyDelete
  2. Can you try the following to see if it corrects your problem?

    1. Edit your PHP configuration to disable the JSMin extension.
    2. Restart Apache.
    3. Purge the contents of the ./cache directory on your instance.
    4. Reload Sugar in your browser.

    ReplyDelete

Your comments, feedback and suggestions are welcome, but please refrain from using offensive language and/or berating others. Thank you in advance.