Understanding permissions


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Understanding permissions
# 1  
Old 12-12-2011
Understanding permissions

Hi,

I just installed wordpress on localhost, and I have some issues with permissions here. I recently switched to linux, so I'm still learning things.

While I'm installing linux, I can't ( that is wordpress can't ) make file wp-config.php in directory I want to install it /var/www/wordpress

when I do something like this:
Code:
chmod 777 /var/www/wordpress

, everything is fine and I can create file and install wordpress.

Than, I want to install new theme, plugin or make updates. Whenever I try to do this, again I need to change permissions, because I get something like this

Image

than i get back to terminal and type this:
Code:
chown -R www-data:www-data /var/www/wordpress

(someone recommended me this command, I don't what actually does, but it lets me proceed with installation ) . I click Proceed button and theme,plugin,update install easily.

Than, as I'm developing wordpress themes, I need to change file inside /var/www/wordpress/wp-content/themes/themename/header.php, and than I can't write to this file.
Than I type this in terminal:
Code:
chown my_username /var/www/wordpress/wp-content/themes/themename/header.php

and now everything is fine and I can write to file.


Can anyone explain me nicely what I'm doing, and why I'm doing this? It's not about that I make everything work, I want to understand the process here.

I will be very grateful for your help,
regards
# 2  
Old 12-13-2011
Ok,
Lets take your actions from the beginning:
1) "I just installed wordpress on localhost"
As who ( what account did you use to install?
2) " While I'm installing linux"
Should that not be done before?
3) "I can't ( that is wordpress can't ) make file wp-config.php in directory I want to install it /var/www/wordpress"
Again what account are you using?
this here can be more subtle for you may (you dont say anything of it...) have created an account for this software and so the software is using his account which of course depending of the permissions set but more likely the ownership may lead to your described issues. Setting everything to 777 is not the good way to solve things, it is like bringing up a server and to avoid user/privileges setting decide to have only one like old PCs... and so create a great playground for all the viruses and malware...
# 3  
Old 12-13-2011
ok, I'm really sorry, I didn't want to say linux, I wanted to say wordpress

Quote:
While I'm installing wordpress, I can't ( that is wordpress can't ) make file wp-config.php in directory I want to install it /var/www/wordpress
of topic: editing post doesn't work, I click on edit, and it never loads, that's why I can't edit post and fix errors

Quote:
what account did you use to install?
I guess I used root, I'm the only user of this computer ( that's also a bit confusing to me, when I installed system I entered the username: eg. Leo, so Am I the root? I saw files that have root as owner, and Leo as owner as well. It doesn't make sense)

---------- Post updated at 09:30 AM ---------- Previous update was at 09:30 AM ----------

ok, I'm really sorry, I didn't want to say linux, I wanted to say wordpress

Quote:
While I'm installing wordpress, I can't ( that is wordpress can't ) make file wp-config.php in directory I want to install it /var/www/wordpress
of topic: editing post doesn't work, I click on edit, and it never loads, that's why I can't edit post and fix errors

Quote:
what account did you use to install?
I guess I used root, I'm the only user of this computer ( that's also a bit confusing to me, when I installed system I entered the username: eg. Leo, so Am I the root? I saw files that have root as owner, and Leo as owner as well. It doesn't make sense)
# 4  
Old 12-13-2011
What linux and version are you using?
If you have an account "as" leo then you are not root (explaining your issues...) but you may have root access via some administration interface or commands (like su or sudo...).
If I were you I would go and deinstall the software and start again, and before starting type: script wordpress_install.out so you have a trace of all what you have done including what appeared on your screen (unless graphical stuff of course...)
Have you read correctly the installation documentation, are all the prerequisites OK?
You may read you have to create a user for the software, is it so?

Courage
# 5  
Old 12-13-2011
Quote:
Originally Posted by zdorian
I guess I used root, I'm the only user of this computer ( that's also a bit confusing to me, when I installed system I entered the username: eg. Leo, so Am I the root? I saw files that have root as owner, and Leo as owner as well. It doesn't make sense)
leo is not root. leo's leo, root's root.

If you ran anything with sudo though, you did run it as root.

A file can't have two owners. They have an owner and a group.

If any of the files you installed are owned by the user or group of root, something wrong happened.

Could you tell us exactly what you did, word for word, letter for letter, keystroke for keystroke? If you can't, we're stuck guessing.
# 6  
Old 12-13-2011
I use Debian 6.0.3

@Corona688 Some files have Leo as owner, other root as owner. Of course that individual files have only one owner. I should improve my way of explaining things because I'm being quite "not understood" Smilie


I don't run anything with sudo, everything works with simple chown or chmod.

I know I should read documentation, I did (from debian.org) but the part about permissions is hard to get.

So, root is the owner of many files. I am not the root. I am Leo. Can I write to the files that root owns? I can, I know I can. But how I did it if I'm not the root? I am Leo.

Than wordpress jumps in. I guess I installed wordpress as Leo. Than wordpress can't write to the file because he is not the owner. I change permission so Leo is the owner of /etc/var/www ( the place where wordpress should be installed) and than wordpress can write to the file. How he can write if he is not the owner?

---------- Post updated at 10:46 AM ---------- Previous update was at 10:45 AM ----------

I use Debian 6.0.3

@Corona688 Some files have Leo as owner, other root as owner. Of course that individual files have only one owner. I should improve my way of explaining things because I'm being quite "not understood" Smilie


I don't run anything with sudo, everything works with simple chown or chmod.

I know I should read documentation, I did (from debian.org) but the part about permissions is hard to get.

So, root is the owner of many files. I am not the root. I am Leo. Can I write to the files that root owns? I can, I know I can. But how I did it if I'm not the root? I am Leo.

Than wordpress jumps in. I guess I installed wordpress as Leo. Than wordpress can't write to the file because he is not the owner. I change permission so Leo is the owner of /etc/var/www ( the place where wordpress should be installed) and than wordpress can write to the file. How he can write if he is not the owner?

---------- Post updated at 10:48 AM ---------- Previous update was at 10:46 AM ----------

and again, vbulletin makes my answers double
# 7  
Old 12-13-2011
First, get another web browser. I edit posts all the time in many browsers and it works.
Quote:
Originally Posted by zdorian
I don't run anything with sudo, everything works with simple chown or chmod.
If chown wasn't spitting error messages, you were running chown as root.

Quote:
I know I should read documentation, I did (from debian.org) but the part about permissions is hard to get.

So, root is the owner of many files. I am not the root. I am Leo. Can I write to the files that root owns? I can, I know I can. But how I did it if I'm not the root? I am Leo.
Every file has 3 sets of rwx permissions -- owner, group, and world.

If you're the owner, and it's set owner-writable, you can write to it.

If you're in the group the file belongs to, and it's set group-writable, you can write to it.

If you're in neither, but the file is set world-writable, you can write to it.

If there are files in there belonging to root that you weren't expecting, something very wrong happened.

Please tell me exactly what you did, word for word, letter for letter, keystroke for keystroke. If you can't, then I don't have a hope of even guessing what you did.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Understanding $PATH better

Dear all, I have a script which triggers a C program in it after initialising parameters. Below is the sample #! /bin/sh . /my_data/environment HOME=/home/execs/testing/ cd $HOME compare $1 $2 X exit $? (10 Replies)
Discussion started by: PikK45
10 Replies

2. Shell Programming and Scripting

Need your help in understanding this

Hi, I found this in a script and I would like to know how this works Code is here: # var1=PART1_PART2 # var2=${var1##*_} # echo $var2 PART2 I'm wondering how ##* makes the Shell to understand to pick up the last value from the given. (2 Replies)
Discussion started by: sathyaonnuix
2 Replies

3. Shell Programming and Scripting

ksh; Change file permissions, update file, change permissions back?

Hi, I am creating a ksh script to search for a string of text inside files within a directory tree. Some of these file are going to be read/execute only. I know to use chmod to change the permissions of the file, but I want to preserve the original permissions after writing to the file. How can I... (3 Replies)
Discussion started by: right_coaster
3 Replies

4. UNIX for Dummies Questions & Answers

Understanding Groups

Hi cat /etc/group : .... oinstall:x:401: dba:x:400:oracle ... cat /etc/passwd|grep oracle oracle:x:130:401::/home/oracle:/bin/ksh 1. Is that mean that : ORACLE user has OINSTALL as it Primary group and DBA as secondary group ? 2. What is the linux comman to set ORACLE user with... (2 Replies)
Discussion started by: yoavbe
2 Replies

5. UNIX for Dummies Questions & Answers

understanding {%/*}/

Hi Gurus: I am trying to understand the following line of code.I did enough of googling to understand but no luck.Please help me understand the follow chunk of code: X=$0 MOD=${X%/*}/env.ksh X is the current script from which I am trying to execute. Say if X=test.ksh $MOD is echoing :... (3 Replies)
Discussion started by: vemana
3 Replies

6. Shell Programming and Scripting

need help understanding mv

I just started shell coding and I'm a bit confused on how 'mv' works can someone explain to me how it works and if i did this correctly. Thanks. echo "Enter Name of the first file:" read file1 #echo $file1 if ; then echo "Sorry, file does not exist." exit 1 ... (16 Replies)
Discussion started by: taiL
16 Replies

7. Shell Programming and Scripting

Understanding ${parameter}

I was reading Bash Cookbook and it had a line of command that assigned a value from var2 to var1 if var1 was empty. Someone told me I could do the same with ${parameter}. I'm just trying to understand this. Would the following be correct? For: answer= default=1Should I assume that the two... (1 Reply)
Discussion started by: victorbrca
1 Replies

8. HP-UX

To give the "unzip" permissions & "create" file permissions

Hi, I am a Unix Admin. I have to give the permissions to a user for creating new file in a directory in HP-Ux 11.11 system since he cannot able to create a new file in the directory. Thanks in advance. Mike (3 Replies)
Discussion started by: Mike1234
3 Replies

9. Linux

A little help understanding FIFOs?

This isn't strictly a Linux question, but... I've been working on a project to archive some streaming media for time shifting using 'mplayer' and have been using FIFOs to archive in Ogg Vorbis format: mkfifo program_name.wav (mplayer -ao pcm -aofile program_name.wav &)... (0 Replies)
Discussion started by: deckard
0 Replies
Login or Register to Ask a Question