0

I have LAMP running in Ubuntu.

However, my files are located on a separate NTFS hard drive (/media/shared/mysite/).

going to http://localhost gives me a 403

how can i, securely, allow apache to read/write the NTFS disk?

'shared' is currently being mounted when system boots. here's the entry in fstab:

/dev/sda1       /media/shared    ntfs-3g    quiet,defaults,locale=en_US.utf8,umask=000     0      0
sqram
  • 147
  • 1
  • 2
  • 6

2 Answers2

2

After many many attempts here is what succeeded for me that is : changing the configuration of Apache so that it uses « www-data » (Apache user) no more but my own user instead.

Very simple to do. In my version of Apache the two lines to be changed are in the « /etc/apache2/envvars » file (it can be another file in another version) :

export APACHE_RUN_USER=www-data
export APACHE_RUN_GROUP=www-data

I replaced « www-data » by my user name (here « toto » :)) :

export APACHE_RUN_USER=toto
export APACHE_RUN_GROUP=toto
Acheu
  • 21
  • 2
0

What are the permissions of the files there? Try a ls -l /media/shared

PiL
  • 1,599
  • 8
  • 6
  • drwxrwxrwx 1 root root 0 2009-11-04 22:02 websites – sqram May 13 '10 at 15:08
  • Check if the share is mounted RO or RW #mount If it's RW, make: # su - www-data # cd /media/shared # touch test.test # ls -l test* and see what's happen – PiL May 13 '10 at 16:45
  • RW. doing what you say, shows everything is owned by root. for example, here's a line from the output: "-rwxrwxrwx 1 root root 85 2009-06-30 06:19 del.php" – sqram May 14 '10 at 05:03
  • So you can create any file you want with www-data user in that dir? If yes...what apache logs say? – PiL May 14 '10 at 08:43
  • 127.0.0.1 - - [14/May/2010:12:45:41 -0400] "GET / HTTP/1.1" 403 496 "-" "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/533.2 (KHTML, like Gecko) Chrome/5.0.342.9 Safari/533.2" – sqram May 14 '10 at 16:46
  • I was also able to create files and dirs as www-data user – sqram May 14 '10 at 22:14
  • I mean about the logs, when you try to access to your web server and you get error 403, what the logs say? – PiL May 15 '10 at 06:46
  • error log is blank. access log: "127.0.0.1 - - [14/May/2010:12:45:41 -0400] "GET / HTTP/1.1" 403 496 "-" "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/533.2 (KHTML, like Gecko) Chrome/5.0.342.9 Safari/533.2" – sqram May 15 '10 at 12:11