Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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
share|improve this question

2 Answers 2

up vote 0 down vote accepted

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

share|improve this answer
    
drwxrwxrwx 1 root root 0 2009-11-04 22:02 websites –  lyrae 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 –  Pier 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" –  lyrae May 14 '10 at 5:03
    
So you can create any file you want with www-data user in that dir? If yes...what apache logs say? –  Pier May 14 '10 at 8: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" –  lyrae May 14 '10 at 16:46

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
share|improve this answer

Your Answer

 
discard

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.