I'm hosting a simple Apache web server on a Raspberry Pi running Debian, which so far only serves up static content out of its default
I wanted to share the
/var/www/ folder via Samba so I can easily mount the folder from a Windows machine and make quick updates directly on the server.
From a Windows machine (via the Samba share), I'm able to...
- Read files of any filetype
- Rename, create, or delete files of any filetype
- Modify the contents of most filetypes
However, I am unable to modify
.htm files (perhaps other filetypes as well) from Windows and receive the following error message when trying to save a modification:
The process cannot access the file because it is being used by another process.
This happens regardless of which editor I use in Windows (e.g., Notepad, Visual Studio, etc).
From Windows, this gives me the interesting ability to rename an affected file (e.g., change it from
*.htm.edit), modify the contents, and then change the name back. But I cannot edit it without renaming.
I am still able to modify all files perfectly fine from Unix.
The owning user and file permissions are identical across both affected and unaffected files:
Note that other static web content that has been served up by the Apache server (e.g., CSS files) are still editable via Samba from the Windows client.
Since it seems limited to HTML-related files (thus far), my naive best guess is that it's some conflict between Samba and Apache, perhaps related to file locking. I tried disabling OpLocks for this Samba share (I'm not too familiar with them, but I've heard they can result in some locking woes) with no success.
The following is the portion of Samba configuration (
smb.conf) file relevant to this Samba share:
[www] Comment = WWW root folder Path = /var/www Browseable = yes Writeable = Yes only guest = no create mask = 0777 directory mask = 0777 Public = yes valid users = pi force user = pi strict locking = no oplocks = False level2 oplocks = False
I simply want the ability to edit
.html files from a Windows client using the Samba share. Any advice into how I might troubleshoot or resolve this issue would be appreciated.