777 is unsafe for a web folder. The reason you needed 777 to work is
apache is running as a different user AND group than the upload folder
is owned by. Check your httpd.conf/apache2.conf for the "User" and
"Group" option to see which user apache is trying to use (sometimes
it's www-data, sometimes nobody). If it's ubuntu/debian you'll see
this option in /etc/apache2/envvars .
After you've determined what user the web server is running as, take a
look at the upload folder's ownership by using ls to look at the parent
folder. For example if your upload folder is
/var/www/html/xcart/upload you would use:
ls -l /var/www/html/xcart
and in that listing you'll see the username and group that owns the
upload folder. It may be root, or another user (ftp). To change the
directory owner, use:
chown www-data /var/www/html/xcart/upload
only if www-data is the user that apache is running as. To change the
group (preffered) use:
chgrp www-data /var/www/html/xcart/upload
only if www-data is the group that apache is running as. You can
remove the public write access with:
chmod 770 /var/www/html/xcart/upload
This should allow you to upload files from the admin interface, even
with php safe mode on.
Mike Hoy wrote:
Thanks,
First I tried chmod 775, but turns out it still needed public write so
I gave it chmod 777 and it worked fine. Is it safe to have an image
directory for a website 777?
On Mon, Dec 1, 2008 at 1:31 PM, Stephen <
cryptworks@gmail.com> wrote:
you are on the right track, however i would do a man chmod just to get
a feel. you may need to add group permissions.
On Mon, Dec 1, 2008 at 1:28 PM, Mike Hoy <
mhoy06@gmail.com> wrote:
I'm pretty new at Linux still and I am confused about directory
permissions. I'm trying to upload products to our website here at work
(Linux Server Cent OS). It says a certain directory lacks write
permissions.
I wanted to see what the permissions were on it so I did a ls -l, but
that shows the contents of the directory (and it's huge, full of
images).
Then I want to give write access to that directory. Is it CHMOD that I
need to use here?
Any feedback appreciated. Gotta get these products uploaded and fast!
--
Mike Hoy
---------------------------------------------------
PLUG-discuss mailing list -
PLUG-discuss@lists.plug.phoenix.az.us
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
--
A mouse trap, placed on top of your alarm clock, will prevent you from
rolling over and going back to sleep after you hit the snooze button.
Stephen
---------------------------------------------------
PLUG-discuss mailing list -
PLUG-discuss@lists.plug.phoenix.az.us
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
---------------------------------------------------
PLUG-discuss mailing list -
PLUG-discuss@lists.plug.phoenix.az.us
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss