View Full Version : Question about FTP/Apache
Jamesk5
9th February 2007, 03:06
I'm just wondering how I need to go about letting both Apache and FTP system users have read and write access to some of my virtual host directories. I followed Falko's proftpd tutorial to setup proftpd with a mysql backend.
However, since I'm running wordpress (and I use it to upload alot of files) on a few different VHosts, I need to allow for access to the files by both apache and proftpd.
Thanks :)
till
9th February 2007, 13:12
There are several possibilities:
1) create a group for each vhost, make all files group writable and make sure that all users that shall be able to write files are members of this group.
2) Use SuPHP to run your PHP scripts under the same user that you use for FTP.
Jamesk5
11th February 2007, 10:39
1) create a group for each vhost, make all files group writable and make sure that all users that shall be able to write files are members of this group.
I've tried this - but it doesn't *seem* to be working. My FTP client is giving me permission errors saying it can't delete the file.
falko
12th February 2007, 15:42
My FTP client is giving me permission errors saying it can't delete the file.I guess the file was created by your Apache user?
The solution would be what Till posted under point 2.
Jamesk5
19th February 2007, 06:31
I guess the file was created by your Apache user?
The solution would be what Till posted under point 2.
But if the group has read/write permissions on the file wouldn't *any* member of that group also be able to delete that file??
falko
20th February 2007, 17:41
But if the group has read/write permissions on the file wouldn't *any* member of that group also be able to delete that file??
Yes, that's right.
Jamesk5
3rd March 2007, 08:43
Yes, that's right.
If that's right, why isn't it working in my case? :P
I can't delete files created by another user of the same group as my ftp user, using my FTP client.
martinfst
3rd March 2007, 13:05
To delete a file, the group must have write rights on the directory. So 775 and the same group in the above directory level.
Jamesk5
4th March 2007, 12:34
To delete a file, the group must have write rights on the directory. So 775 and the same group in the above directory level.
I realise that, all the folders/files have the 775 and correct group applied through a chmod -R and chown -R
martinfst
4th March 2007, 13:24
I realise that, all the folders/files have the 775 and correct group applied through a chmod -R and chown -Rthen it should work:confused:
Jamesk5
5th March 2007, 06:31
Here's a bunch of data that might help someone help me with my problem!!
Entry for stfaiths group in /etc/groups:
stfaiths:x:2004:www-data,ftpuser
ls -l on /var/www/virtual/stfaiths (directory that I'm trying to get to work with both apache2 and proftpd):
drwxrwxr-x 5 www-data stfaiths 4096 2007-01-27 13:18 dev
drwxrwxr-x 6 www-data stfaiths 4096 2007-01-26 23:08 dev.bak
drwxrwxr-x 5 www-data stfaiths 4096 2007-01-27 19:01 dev.youth
-rwxrwxr-x 1 www-data stfaiths 1121622 2007-02-25 19:59 devyouth.zip
drwxrwxr-x 3 www-data stfaiths 4096 2007-02-25 19:47 __MACOSX
drwxrwxr-x 5 www-data stfaiths 4096 2007-01-27 13:06 www
drwxrwxr-x 6 www-data stfaiths 4096 2007-01-27 13:03 www.bak
Output of a ps -ef | grep ftp (while a connection to the server is active):
ftpuser 16447 1 0 14:24 ? 00:00:00 proftpd: (accepting connections)
ftpuser 22057 16447 0 15:31 ? 00:00:00 proftpd: stfaiths.org.au - udsl-6-137.NSW.dft.com.au: LIST -a
james 22069 14262 0 15:31 pts/0 00:00:00 grep ftp
I don't know if that will help anyone, but I hope I can get this problem resolved. If you think any more info will help you, let me know!
falko
5th March 2007, 19:09
Please post the output of ls -la /var/www/virtual/stfaiths
Jamesk5
6th March 2007, 01:30
ls -la on /var/www/virtual/stfaiths.org.au (that's the directory.. not just stfaiths like I posted above)
drwxrwxr-x 8 www-data stfaiths 4096 2007-02-25 20:01 .
drwxr-xr-x 8 nobody nogroup 4096 2007-02-16 14:37 ..
drwxrwxr-x 5 www-data stfaiths 4096 2007-01-27 13:18 dev
drwxrwxr-x 6 www-data stfaiths 4096 2007-01-26 23:08 dev.bak
drwxrwxr-x 5 www-data stfaiths 4096 2007-01-27 19:01 dev.youth
-rwxrwxr-x 1 www-data stfaiths 1121622 2007-02-25 19:59 devyouth.zip
drwxrwxr-x 3 www-data stfaiths 4096 2007-02-25 19:47 __MACOSX
drwxrwxr-x 5 www-data stfaiths 4096 2007-01-27 13:06 www
drwxrwxr-x 6 www-data stfaiths 4096 2007-01-27 13:03 www.bak
falko
6th March 2007, 18:12
Looks ok, too. :confused:
Jamesk5
8th March 2007, 04:56
Looks ok, too. :confused:
Ahh, that's no good! I'm wondering if it's Debian doing something weird??
I'm planning on rebuilding the whole machine soon (I'm registering a domain name so the box will have a proper hostname), so perhaps a rebuild with a more recent version of Debian will fix the problem. I'm only running Debian Etch (Unstable).
Anyone else got any suggestions?? Perhaps something wrong with my FTP DB setup?
Jamesk5
24th April 2007, 18:00
I'm planning on rebuilding the whole machine soon (I'm registering a domain name so the box will have a proper hostname), so perhaps a rebuild with a more recent version of Debian will fix the problem. I'm only running Debian Etch (Unstable).
I've moved to Debian Etch (Stable) [some of you will already know this] and still no resolution.
How Secure is suPHP? Security is obviously pretty important, especially when running multiple sites.
falko
25th April 2007, 14:37
How Secure is suPHP? Security is obviously pretty important, especially when running multiple sites.
Pretty secure, I'd say.
fr0m_heaven
25th April 2007, 20:18
check for the sticky bit attributes of the files ..
do ls -a
if see
" trwxrw_r_ " check outy for the " t " bit .......
fr0m_heaven
25th April 2007, 20:28
check out for the sticky bits
" trwxrw_r_ _ " if this is what u see ... u need to work around ..
Jamesk5
26th April 2007, 11:15
check out for the sticky bits
" trwxrw_r_ _ " if this is what u see ... u need to work around ..
You can see from my postings above that I'm not getting a 't' in my listings via ls.
Also, you should have asked me to type ls -l not ls -a
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.