I am trying to use my QNAP TS-210 NAS to develop Drupal websites. I suddenly got 403 forbidden access problems on anything related to the webserver including phpmyadmin.

After much head scratching and perusing various forums I found the problem myself. There was a .htaccess file in my qweb root - I removed this and access was fine again.

However, whenever I install a new module in Drupal this .htaccess file reappears giving the 403 error again. I have to keep removing this file to reinstate access. So, it would appear, that Drupal keeps placing this .htaccess file in my root directory.

Can anyone suggest why this is happening?

Cheers,

Mike

Comments

yelvington’s picture

It's not clear what you are doing. Are you running a PHP/MySQL/Apache instance directly on the storage device? What is in the .htaccess file you are finding?

Drupal expects its "files" directory tree to be managed by Drupal and only Drupal. It will write a security-configured .htaccess file in that directory, and if you try to use it for any purpose other than Drupal, you'll run into problems. If you have a Drupal installation somewhere that is configured to use your storage appliance's root directory for file storage, you'll encounter the problem you described.

wmike’s picture

Hi all,

Fiddled about a bit. Decided to edit the .htaccess - left it blank. This seems to have cured the problem.

Still baffled, however, why I should have to do this.

Cheers,

Mike

crimsondryad’s picture

This is ok for a dev area, but you don't want to do that on a prod site. The .htaccess file has a lot of Apache settings to prevent people from being able to gawk at your file system, set up garbage collection correctly, etc.

What is your directory structure from your webroot? The previous post was right, if Drupal is not the only thing in the webroot you will have conflicts. The solution may be to put drupal one level down in its own directory ( ie /var/www/html/webroot/drupal/ ). If you do that, you need to edit your settings.php and possibly the .htaccess file to tell it that it's not in the webroot.

wmike’s picture

Hi all,

Thanks for the feedback.

The QNAP is a NAS with built in webserver. The Drupal installation is in a sub directory of the webserver (were it should be). I also have other installations such as wordpress in the webserver sub directories. These have all been working fine. It is the Drupal 7 installation that seem to write the .htaccess everytime a module is installed.

I take crimson's point - I wouldn't dream of messing with the .htaccess file on a live site.

Cheers,

Mike

drupa11y’s picture

I have similar issues but in my case I have a Debian Server with Drupal and the NAS in the network.
The Debian Server has mounted the shared NAS folders.

Would it somehow be possible to manage the access with a virtual link to the nas-share?

With LDAP, would it be better to run the LDAP-Server on the Drupal-Server or on the NAS?

thanks for the ansers!