Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I hope this is the right place for this. I have a Ubuntu 11.10 server with Apache on. Apaches doc root is on a shared folder sourced via cifs from a windows Machine.

All this is fine on every network I have set it up on until today when I came to set it up at home.

I am viewing my website, on my Apache server in a web browser (lets say Firefox) and every couple of refreshes I get a 403 response or no data at all back for certain files from the servers cif share in Firebug.

Now through the process of elimination I have been able to determine it is cifs. I came to this conclusion by copying my doc root to a local folder on the Ubuntu install and trying to get the same behaviour, which I did not.

Now I understand this is very hard to grasp through plain text so here are a couple of pictures to describe the problem.

This first picture shows everything on one refresh and it is all fine: Image of everything working

This picture shows the next refresh, as you can see Firebug responds that apache suddenly cannot access my files, not only that but what Firebug is not reporting that there are also images missing off of that page. I should mention the images actually come from DB, so not sure how cifs is interferring with that but the images work with the local version of the site so it must be. Image of the problem

This problem is intermitant.

Now I did try and Google this but then I realised, after a couple of tries, I wasn't actually quite sure what to Google for.

Can some one point me in the right direction to diagnose my problems? Maybe some one has had this problem before and can share their solution?


Update: Ok so I did a little searching around in the APache logs and it comes up with this:

[Thu Jan 19 20:59:03 2012] [error] [client] (12)Cannot allocate memory: file permissions deny server access: /server_ws/htdocs/css/960.css, referer:

I have seen this error quite a lot and it always has a different meaning. So first I decided to check the actual file permissions in Linux before I did a refresh after this problem:

drwxrwxrwx 1 www-data sam      0 2012-01-17 18:33 .
drwxrwxrwx 1 www-data sam   4096 2012-01-17 21:40 ..
-rwxrwxrwx 1 www-data sam  10641 2012-01-17 18:33 960.css
-rwxrwxrwx 1 www-data sam      0 2012-01-20 18:58 c_css.css
-rwxrwxrwx 1 www-data sam 129488 2012-01-17 18:33 main.css
-rwxrwxrwx 1 www-data sam   1086 2012-01-17 18:33 reset.css
drwxrwxrwx 0 www-data sam      0 2012-01-17 18:33 .svn

Everything looks tip top there. So I checked Windows to make sure I will always have access to it. I have shared the server_ws folder from windows using the built in protocol and have assigned my Windows user "Sam" as the owner. I have told cifs to hook into this Windows like so:

// /media/server_ws cifs username=Sam,password=****,rw,uid=www-data,gid=sam,iocharset=utf8,dir_mode=0777,file_mode=0777 0 0

Nothig immediately wrong there and if there was something terrible there why would it only happen every so oftern.

Though now that I've found the error in Apache Ima do more Google searching.

If anyone knows something please let me know :)

share|improve this question
Perhaps you can find further information in the error.log file? grep facebox.js /var/log/apache2/error.log – Luis Bruno Jan 19 '12 at 23:01
Originally I didn't see anything special but I'll take another look tonight see if I can find some kind of error message or code, thanks – Sammaye Jan 20 '12 at 9:13
I actually found something this time around, I have updated the post thanks. – Sammaye Jan 20 '12 at 19:13
up vote 1 down vote accepted

I think I found it. This is actually a subset of a more common problem: I found this solution a long time ago for another problem but never thought of using it here.

It seems on some installs you must tell Windows to act as a file server by setting the registry keys above. If you do that then it seems Windows will always allocate the resources required to complete a transfer even if its intensive.

I cannot get my server to repeat this problem now :D.

Thank you, Luis for you help without the thought of checking Apache again I would never have got to the bottom of it.

share|improve this answer

I'll have to go out on a limb here and guess a bit. I can't be sure which directory the DocumentRoot for points to.

Whichever it is, you can wait until you get an error and impersonate the www-user using sudo, and then try to find which folder has wrong permissions:

sudo -u www-data -s
cd /path/to/your/docroot

If this fails, cd / and then cd to each path component in turn until you get a permission-denied error.

If you're really serving from /media/server_ws, it's possible that the permissions on /media are being changed under your feet. If you are suffering from this, I'd mount it under /srv which I think it's the usual place.

share|improve this answer
Thanks for the reply, My DocumentRoot now points to /srv/server_ws/htdocs that is where I am serving the files from. I tried to find a permissions problem as ww-data but I could not, I even edited and save 960.css when I got the problem. Tested it with another permissions problem too on a query-ui.js source file but that turned up nothing :(. I changed my mount point from media to srv just incase but still to no effect. Overall this seems a very elusive problem. – Sammaye Jan 21 '12 at 0:24

I've found myself returning to this question and its answers because as we onboard new hires, we seem to have to redo this step. Therefore, I created a registry file based off the accepted answer's link so we can easily make the adjustment that I wanted to offer up.

You'll want to open notepad, and enter the following:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management]


Save the file as whatever_you_want.reg and run it (will require administrator access, so you'll likely have to accept UAC). This has been tested on Win 7 x64 Pro

hope this helps!

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.