linux - access denied in debian guest apache using a windows share -


this complicated (for me, @ least) problem, please bear me.

i have 3 virtual machines assorted guest operating systems (listed below) running in virtualbox 4.2.10, running either apache 2.2+ or iis 7.5 web servers point same network share on host machine (windows 8).

the guest operating systems/server/php versions:

  1. windows 7 ultimate - iis 7.5 - php 5.3.23
  2. windows xp pro - apache/2.2.24 - php/5.2.9
  3. debian 6.0.7 - apache/2.2.16 - php 5.3.3

all 3 servers (4, including host) can access , display web pages fine, , php scripts execute correctly well, 1 major exception: neither apache nor php can write location within network share.

the network share mounted (supposedly) read/write permissions through fstab, using following command:

//dmorton/http /var/www cifs rw,user=dmorton/server,password=****** 

the share mounts fine, , can read/write files through either gedit or terminal, know share correctly mounted, though expect code in fstab use bit of makeover. used connection through network, rather using virtualbox's shared folders feature because no matter tried, couldn't apache recognize share @ way.

as mentioned above, apache can display web pages , execute php scripts fine, except when tries write either log file (apache) or debugging file (php). had relocate apache logs able read them, since weren't being written when configured write share, other 2 guests are. here's excerpt relevant error log:

[fri apr 05 08:02:23 2013] [error] [client 192.168.1.100] php warning:  file_put_contents(/var/www/pgo2.1/chatbot/debug/7o13ii3te7a6u2q52hpu1b3m86.mem_trace.txt): failed open stream: permission denied in /var/www/pgo2.1/library/error_functions.php on line 333, referer: http://dmorton-deb64/pgo2.1/gui/plain/index.php?say=test&submit=say&bot_id=1&format=html  fri apr 05 09:01:25 2013] [error] [client 192.168.1.100] php warning:  file_put_contents(commonwords.dat): failed open stream: permission denied in /var/www/tmp/sort_cw.php on line 6, referer: http://dmorton-deb64/tmp/ 

as can see, php being denied access files in @ least 2 different locations within document root. know permissions issue, , i've tried different methods (listed below) correct this, i'm missing here. i'm relative newb when comes *nix systems, expect it's simple. anyway, here methods i've tried "fix" this: *

  1. created special account on host os vm's can use access share full permissions
  2. set "full control" permissions host folder "everyone"
  3. set account in debian same credentials host account, giving full permissions
  4. configured apache run user mentioned in #3, , "root" group permissions
  5. attempted other mount options in fstab make share writable everyone
  • please note i'm aware of security implications involved or of these settings. once find out how correct problem, i'll revert these more secure footing, 1 @ time.

ok, have overall gist of issue, have ask:

how can correct issue described above, , missing here?

i did further poking , prodding, , stumbled upon answer. in order *nix systems able have read/write permissions windows shares, have connect specific set of credentials (which knew), , said set of credentials not fall under general category of "everybody" (which didn't know). had go "advanced sharing" under sharing tab of folder's properties, , click permissions button there (not under "security", had tried, without success). added correct credentials , set permissions full access, hit apply/ok needed, , gave go. viola! debian , ubuntu servers can write correct folders, , able put security settings way belonged. sincerely hope helps folks in future.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -