SuiteCRM on CentOS 7 / permission error

I have few tasks pending and wonder if somebody can please help.
The major task should be migrating an existing SugarCRM CE (on Windows Server) to SuiteCRM (on Linux) and the minor one should be to
install a new SuiteCRM instance. That was the plan … :lol:

Currently I’m trying to install SuiteCRM on CentOS 7 following the installation guide
CentOS is set up is and Apache, MariaDB, phpmyadmin and SuiteCRM are basically installed.
Now I’m trying to use install.php to configure SuiteCRM.

I searched through different forums and applied user (apache), group (apache) and permissions (775) to the suitecrm folder.
So far no luck, every time I try to run the install.php I get errors that the permissions on cache custom modules themes data upload config_override.php are not correct. :huh:

I guess I missed something.
Any hints will be highly appreciated. :slight_smile:

Thank you.

If you cd to the directory in the terminal and type ll what do the permissions of these folders say?
These should be correct assuming apache is the correct group(note the . at end of lines)
sudo chown -R apache:apache .
sudo chmod -R 755 .
sudo chmod -R 775 cache custom modules themes data upload config_override.php

1 Like

I can check tomorrow and post the details.
Thanks!

Apologies for the delay

I ran the chmod and chown commands as described (again).

1)The error output from install.php is

[i]The config override file exists but is not writeable. Please take the necessary steps to make the file writeable. Depending on your Operating system, this might require you to change the permissions by running chmod 766, or to right click on the filename to access the properties and uncheck the read only option.

Writeable Custom Directory
The Custom Directory exists but is not writeable. You may have to change permissions on it (chmod 766) or right click on it and uncheck the read only option, depending on your Operating System. Please take the needed steps to make the file writeable.

Writable Cache Sub-Directories
The files or directories listed below are not writeable or are missing and cannot be created. Depending on your Operating System, correcting this may require you to change permissions on the files or parent directory (chmod 755), or to right click on the parent directory and uncheck the ‘read only’ option and apply it to all subfolders.

Please fix the following files or directories before proceeding:
/var/www/html/suitecrm/cache/
/var/www/html/suitecrm/cache/images
/var/www/html/suitecrm/cache/layout
/var/www/html/suitecrm/cache/pdf
/var/www/html/suitecrm/cache/xml
/var/www/html/suitecrm/cache/include/javascript

Writable Modules Sub-Directories and Files
Warning: Not Writable
Please fix the following module directories and the files under them before proceeding:
/modules

Writable Upload Directory
Warning: Not Writable[/i]

When I check the permissions within suitecrm directory running ll the output is

[size=3]-rwxrwxr-x. 1 apache apache 2743 Aug 25 17:10 acceptDecline.php
drwxrwxr-x. 4 apache apache 33 Aug 14 19:01 cache
-rwxrwxr-x. 1 apache apache 3590 Aug 25 17:10 campaign_tracker.php
-rwxrwxr-x. 1 apache apache 2748 Aug 25 17:10 campaign_trackerv2.php
-rwxrwxr-x. 1 apache apache 47 Aug 25 17:10 config_override.php
-rwxrwxr-x. 1 apache apache 3922 Aug 25 17:10 cron.php
-rwxrwxr-x. 1 apache apache 2446 Aug 25 17:10 crossdomain.xml
drwxrwxr-x. 10 apache apache 4096 Aug 25 17:10 custom
drwxrwxr-x. 3 apache apache 4096 Aug 25 17:10 data
-rwxrwxr-x. 1 apache apache 2388 Aug 25 17:10 dictionary.php
-rwxrwxr-x. 1 apache apache 11578 Aug 25 17:10 download.php
-rwxrwxr-x. 1 apache apache 2392 Aug 25 17:10 emailmandelivery.php
drwxrwxr-x. 2 apache apache 4096 Aug 25 17:10 examples
-rwxrwxr-x. 1 apache apache 4912 Aug 25 17:10 export.php
-rwxrwxr-x. 1 apache apache 718163 Aug 25 17:10 files.md5
-rwxrwxr-x. 1 apache apache 2811 Aug 25 17:10 HandleAjaxCall.php
-rwxrwxr-x. 1 apache apache 2371 Aug 25 17:10 ical_server.php
-rwxrwxr-x. 1 apache apache 2735 Aug 25 17:10 image.php
drwxrwxr-x. 54 apache apache 4096 Sep 24 08:46 include
-rwxrwxr-x. 1 apache apache 2525 Aug 25 17:10 index.php
drwxrwxr-x. 6 apache apache 4096 Aug 25 17:10 install
-rwxrwxr-x. 1 apache apache 24507 Aug 25 17:10 install.php
-rwxrwxr-x. 1 apache apache 13373 Aug 25 17:10 json_server.php
drwxrwxr-x. 3 apache apache 4096 Aug 25 17:10 jssource
-rwxrwxr-x. 1 apache apache 2737 Aug 25 17:10 leadCapture.php
-rwxrwxr-x. 1 apache apache 34539 Aug 25 17:10 LICENSE.txt
drwxrwxr-x. 2 apache apache 30 Aug 25 17:10 log4php
-rwxrwxr-x. 1 apache apache 2313 Aug 25 17:10 log_file_restricted.html
-rwxrwxr-x. 1 apache apache 2376 Aug 25 17:10 maintenance.php
drwxrwxr-x. 2 apache apache 4096 Aug 25 17:10 metadata
-rwxrwxr-x. 1 apache apache 2298 Aug 25 17:10 metagen.php
drwxrwxr-x. 8 apache apache 4096 Aug 25 17:10 mobile
drwxrwxr-x. 3 apache apache 4096 Aug 25 17:10 ModuleInstall
drwxrwxr-x. 104 apache apache 4096 Aug 25 17:10 modules
-rwxrwxr-x. 1 apache apache 2890 Aug 25 17:10 pdf.php
-rwxrwxr-x. 1 apache apache 2794 Aug 25 17:10 README.md
-rwxrwxr-x. 1 apache apache 2737 Aug 25 17:10 removeme.php
-rwxrwxr-x. 1 apache apache 73 Aug 25 17:10 robots.txt
-rwxrwxr-x. 1 apache apache 3588 Aug 25 17:10 run_job.php
drwxrwxr-x. 11 apache apache 4096 Aug 25 17:10 service
drwxrwxr-x. 2 apache apache 4096 Aug 25 17:10 soap
-rwxrwxr-x. 1 apache apache 4091 Aug 25 17:10 soap.php
-rwxrwxr-x. 1 apache apache 5327 Aug 25 17:10 SugarSecurity.php
-rwxrwxr-x. 1 apache apache 150 Aug 25 17:10 sugar_version.json
-rwxrwxr-x. 1 apache apache 2264 Aug 25 17:10 sugar_version.php
-rwxrwxr-x. 1 apache apache 162 Aug 25 17:10 suitecrm_version.php
drwxrwxr-x. 5 apache apache 46 Aug 25 17:10 themes
-rwxrwxr-x. 1 apache apache 5843 Aug 25 17:10 TreeData.php
drwxrwxr-x. 2 apache apache 23 Aug 25 17:10 upload
-rwxrwxr-x. 1 apache apache 2707 Aug 25 17:10 vcal_server.php
-rwxrwxr-x. 1 apache apache 2980 Aug 25 17:10 vCard.php
-rwxrwxr-x. 1 apache apache 2743 Aug 25 17:10 WebToLeadCapture.php
drwxrwxr-x. 2 apache apache 35 Aug 25 17:10 XTemplate
drwxrwxr-x. 8 apache apache 4096 Aug 25 17:10 Zend[/size]

Having just solved this issue for our own test installation a little over an hour ago (and then immediately running into a separate issue, of course :pinch:), I can provide you with how we came to our solution:

I’ve learned that one of the first things to do when permission issues like these crop up is to check for SELinux configuration issues. Personally I use audit2why. I can’t remember if it’s part of the minimal/core installation for CentOS 7, but if not, it is provided by the policycoreutils-python package. In my case (which I’m 90% certain would also apply to your own), it suggested that I could fix the most recent issues with the following command:

sudo setsebool -P httpd_unified 1

HOWEVER: One of the important things to know when using tools like this is that their suggestions often void the principle of least access/privilege by suggesting the easiest possible solution. Thus, more research is often required to do as little damage as possible to the overall security of the system.

A quick search led me to the httpd_selinux manpage. It gives the following description for the httpd_unified boolean:

If that is confusing to you, you’re not alone. So I looked at the search results a bit more and found these threads in the Fedora forums and Red Hat mailing lists to be particularly helpful in explaining things. A search for “httpd_unified” will turn up many other links that might be of use, but those were the ones I immediately found that were helpful.

I won’t repeat everything that they say here because I’d likely do a poorer job at explaining than they do, but the long and short of it is that certain SELinux attributes need to be manually setup on directories, so that the system knows what is static content, what is executable, what requires read/write, etc. Setting httpd_unified to 1 (on) tells the system to not check or otherwise care for those attributes.

Apparently, httpd_unified defaulted to 1 (on) in RHEL 5 and 6, but this was set to change in RHEL 7 (source). I assume this change occurred at the same time for CentOS (i.e. in CentOS 7).

2 Likes

Apologies for the delay on answering.
I can confirm that deactivating SELinux for the installation is one important thing.

Finally for my installations these steps did it for the migration from SugarCRM 6.5.2x to SuiteCRM 7

  1. Full backup of the old installation
  2. Upgrade SugarCRM 6.5.2x to SuiteCRM 7.1.x
  3. Upgrade SuiteCRM 7.1.x to 7.3.x
  4. Download of the installation package for SuiteCRM from Bitnami (7.3)
  5. Install SuiteCRM on the new machine - the installation scripts deactivates SELinux before the installation and reactivates it afterwards.
  6. Export the data via phpmyadmin from the old installation
  7. Import the data to the new installation into a new database and relocate the SuiteCRM installation to that new DB
  8. Rebuild layouts (pending)

Take care if you’re using a more recent version of SugarCRM than 6.5.20 - the data migration won’t work directly from SugarCRM 6.5.21/6.5.22 to SuiteCRM 7.x because SuiteCRM 7.x is based on SugarCRM 6.5.20.

I disabled SELinux and all is well now.