News:

Click here for Toll-Free Service for your business starting at $2.00 per month

Main Menu

Changing ownership of directories

Started by reverie, May 05, 2006, 05:03:43 PM

Previous topic - Next topic

reverie

I'm trying to set up a folder that permits uploading on my wiki but I obviously don't want to give it 777 permissions for security reasons. The best way to get around this would be to make apache (or httpd or whatever is used on these servers) the owner so that it can upload files and leave the directory with 755 permissions.

I dont' have access to SSH (my plesk control panel says it's forbidden) so what can I do to change the ownership?

Thanks!

brainiac744

Try chmodding it to 775. I'm pretty sure that that will work, and still not expose you to the dangers of world-writeable files.

reverie

Actually I tried that, but I still get an error that the directory is not writeable by the server. The safest way would be to change the ownership of the directory to the apache server so that it can change files without the security issue...

Any ideas on how to change the ownership if I don't have access to SSH? Is there any way to do it via FTP?

Evilsprouts

you colud use php:
<?php chmod("/somedir/somefile"0755); ?>

or ask the admin to change it.

reverie

#4
Thanks for the response. Unfortunately, it doesn't work as expected.

Here's what I used:
<?php chmod("/images"apache); ?>

And here's what the browser thought:
Warning: chown(): open_basedir restriction in effect. File(/images) is not within the allowed path(s): (/var/www/vhosts/mydomain.com/httpdocs:/tmp)

So nothing changed at all. I may need admin help...

(BTW: I tried using the chmod command as well but it also had no effect.)

brainiac744

/images is not your physical path, which is what you have to put there. The physical path will be:

/fpgs/fpgshttpd/YOURUSERNAMEHERE/PATH_HERE

Evilsprouts

Quote from: brainiac744 on May 08, 2006, 08:24:21 PM
/images is not your physical path, which is what you have to put there. The physical path will be:

/fpgs/fpgshttpd/YOURUSERNAMEHERE/PATH_HERE

Looks like this dude is on plesk so the path would be "/var/www/vhosts/YOURDOMAIN.COM/httpdocs/YOUR PATH"

brainiac744

Whooops, you're right, missed that sentence :-[

reverie

Thanks for your help guys. That worked like a charm!   ;D