LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-19-2011, 10:55 AM   #1
riverbum
LQ Newbie
 
Registered: Sep 2011
Posts: 4

Rep: Reputation: Disabled
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
 
Old 09-19-2011, 11:08 AM   #2
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,699
Blog Entries: 23

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
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

Last edited by ButterflyMelissa; 09-19-2011 at 11:17 AM.
 
Old 09-19-2011, 11:20 AM   #3
riverbum
LQ Newbie
 
Registered: Sep 2011
Posts: 4

Original Poster
Rep: Reputation: Disabled
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
 
Old 09-19-2011, 11:24 AM   #4
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,699
Blog Entries: 23

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
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

Thor

Last edited by ButterflyMelissa; 09-19-2011 at 11:28 AM.
 
Old 09-19-2011, 07:33 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,345

Rep: Reputation: 2365Reputation: 2365Reputation: 2365Reputation: 2365Reputation: 2365Reputation: 2365Reputation: 2365Reputation: 2365Reputation: 2365Reputation: 2365Reputation: 2365
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....
 
0 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Apache issue with user-owned subdomains Trerro Linux - Server 2 03-23-2011 01:22 AM
[SOLVED] What's the difference between chmod 0755 file and chmod 755 file? cola Linux - Newbie 6 04-19-2010 04:29 PM
Apache: difference between chmod 644 and chmod 666 and chmod 600 for output/txt/dat? frenchn00b Programming 6 04-22-2009 01:10 PM
Granting permission to files owned by apache piforever Linux - Security 3 03-18-2006 08:51 PM
Make a file owned by root owned by a user sharpie Linux - Newbie 2 02-26-2004 01:26 AM


All times are GMT -5. The time now is 07:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration