LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How do I CHMOD a file owned by Apache? (https://www.linuxquestions.org/questions/linux-newbie-8/how-do-i-chmod-a-file-owned-by-apache-903853/)

riverbum 09-19-2011 10:55 AM

How do I CHMOD a file owned by Apache?
 
I am installing Magento on a Fasthosts dedicated server and I have the following problem:

The installation process requires me to change the permissions of a folder (and its contents) in order to proceed with the installation. The folder in question is ../var/session

1. I tried changing the permissions in Filezilla but I was unable to do so
2. I tried changing the permissions in File Manager within Plesk but I was unable to do so as the folder is 'owned' by Apache
3. I enabled shell access to the domain/hosting set up in Plesk so I could login via SSH using Putty and attempted to CHOWN the folder in question but this would not work
4. I presume that the correct way to do it is via SSH while logged in as root...? The problem is I have no idea of the syntax for navigating using Putty to the domain directory of a particular domain when logged in as root. I would be really grateful if someone could help me with this!

Thanks,
Ben

ButterflyMelissa 09-19-2011 11:08 AM

Hi,

To change ownership with CHOWN

Quote:

chown -R apache:apache /var/session
Assuming apache is in a group called apache, in general:

Quote:

chown [option] member:group file
See the manpages for more!

To change permissions for a folder

Quote:

chmod -R +x /var/session
Also, in general

Quote:

chmod [option] [toggle] [file/folder]
toggles execute up (allows it) - there's a manpage on this too...

...but chmod is more fine tuned, use the numbers...you can calculate these and then use the number instead...

Chmod can be a life saver...learn all there's to learn about it!

Luck!

And, by the way: welcome to the forum :)

Thor

riverbum 09-19-2011 11:20 AM

Thanks!

The complete path for the domain is httpdocs/var/session and using the command you suggest, returns the error 'No such file or directory'. The root login is for the dedicated server and not for the hosting/domain I have created on it and which I am trying to configure. I'm guessing my problem is with the path I am using?

Ben

ButterflyMelissa 09-19-2011 11:24 AM

Quote:

httpdocs/var/session
There's something missing...the slash in front, it should read

Quote:

/httpdocs/var/session
if the folder httpdocs is the one on root level (all the way on top) - the way you entered it, the command looked for httpdocs/var/session in the current folder...
If it's not, enter everything...for example, to chmode a file on apache, I had to enter:

Quote:

chmod +r /var/www/html/aSite/documents/manual.html
where /var is a folder in the main list (on top, as I mentionned)...

Been there too dont worry :D

Thor

chrism01 09-19-2011 07:33 PM

2 points:

1. there is no '+r' http://linux.die.net/man/1/chmod

2. don't use '-R' which does recursive(!) changes unless you really want that....


All times are GMT -5. The time now is 05:45 PM.