I installed Centos 7 (minimal) with LAMP stack on a dedicated development server on my home LAN as a development platform to migrate my Drupal 6 website to Drupal 7. Drush was used to install a new standard Drupal 7.x-dev platform, but could not initially get past the Apache welcome page to finish the Drupal 7 install. After tweaking .htaccess, settings.php, and /etc/httpd/conf/httpd.conf I now cannot browse anything on the server without getting the "Forbidden" error. The Apache log error is:

[Wed Dec 21 20:33:15.366352 2016] [core:crit] [pid 2891] (13)Permission denied: [client] AH00529: /var/www/html/drupal7/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/var/www/html/drupal7/' is executable

I assume this may be a permissions or ownership issue. Document root is /var/www/html/drupal7 with ownership and permissions for the directories and config files are: /var (root) 755; /www (root) 755; /html (apache) 755; /drupal7 (apache) 775; .htaccess (root) 644; index.php (apache) 755; install.php (apache) 644; and /etc/httpd/conf/httpd.conf (root) 644.

Have I got these permissions right? The $base_url is currently set to "http://localhost" but I'm not sure this is right either. -Any suggestions?

  • I'm voting to close this question as off-topic because this question belongs on Server Fault. – marcvangend Dec 21 '16 at 22:56
  • Possible duplicate of Drupal files folder owner/group for CentOS? – No Sssweat Dec 22 '16 at 0:01
  • 1
    the folder onwer/group needs to be apache. So cd /var/www/html then do sudo chown apache:apache -R drupal7. In addition, you also need to disable SELinux (see the link in my previous comment) – No Sssweat Dec 22 '16 at 0:03
  • Well...following your suggestion to disable SELinux made a difference. Instead of "Forbidden...", I now get "Internal Server Error" (The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator at root@localhost to inform them of the time this error occurred, and the actions you performed just before this error. More information about this error may be available in the server error log.) – BGood Dec 22 '16 at 3:01
  • The Apache error log says: [Thu Dec 22 02:55:11.601119 2016] [core:alert] [pid 1915] [client] /var/www/html/drupal7/.htaccess: <Directory not allowed here, referer: uxserver. This error is new. – BGood Dec 22 '16 at 3:06