11
gediminasbyt
Re: own server == / != phpsuexec 777 / 755

What do you mean all the time? This will be only when you decide to add new module in xoopsroot/modules directory. Let say you decide to upload AMS, you login as regular user and you can't write to that directory, you change as root copy AMS and chown it to apache, that's it. Another thing you can do is use of 'sudo'. Youll have to edit sudoers file, be careful to what permissions you give to your user.

I'd recommend to chmod like that from your xoopsroot:

find -type d -exec chmod 2775 {} \; <-all directories
find -type f -exec chmod 664 {} \; <-all files

then go and issue chmod 444 mainfile.php

Gediminas

12
gediminasbyt
Re: own server == / != phpsuexec 777 / 755

I should clarify my previous post:

Ownership does not change when you edit file as another user. When you copy some files as another user then those files will belong to that user.

For example:

example.txt owner is apache, you login as root and edit that file, after you save it it still belongs to apache. But if you create new file in that directory it will belong to root.

Gediminas

13
gruessle
Re: own server == / != phpsuexec 777 / 755
  • 2005/12/4 19:49

  • gruessle

  • Friend of XOOPS

  • Posts: 348

  • Since: 2003/9/20


That is true as of how it is now too, right?

The files aren't owned by nobody they are owned by the virtual host name as of now. Only apache is running as nobody.
Let me explain what I mean. I am running cPanel have created a new account lets say as john. Have upladed and created the files as john so they are owned by john.

If I log in as root and create a new file it is not going to be owned by nobody, or the virual host name john, it going to be root, right?

Let's go back to the problem.
The problem is that I have to chmod the folders cache and c_template as 777.
What I need is 755. So if I change apache to run as apache rather then nobody can I then change ownership of folders cache and c_template to be apache rather then john and chmod only those folders to 755?
Grüssle
......

http://www.vmclinks.com

14
gediminasbyt
Re: own server == / != phpsuexec 777 / 755

I think I answered your questions about 5 times already in previous posts.
Quote:
The files aren't owned by nobody they are owned by the virtual host name as of now. Only apache is running as nobody.

Files can not be owned by virtual host name, there must be a user for that account. nobody is just a system account for un-assigned files with no access permission, no login permissions, no email basically restricted user permission with acess to nobody.

Quote:
If I log in as root and create a new file it is not going to be owned by nobody, or the virual host name john, it going to be root, right?


Correct. In special cases if there is no account for that user files might be assigned to the number, but you should not worry about it, it's only when you try to preserve permissions in special cases.

All files within your website SHOULD belong to the same user as apache is running as. And you should run apache as apache user, most likely it already has properly setup permissions.


Quote:
Let's go back to the problem.
The problem is that I have to chmod the folders cache and c_template as 777.
What I need is 755. So if I change apache to run as apache rather then nobody can I then change ownership of folders cache and c_template to be apache rather then john and chmod only those folders to 755?


See my post #11 on how to chmod ALL directories. There is no need for WorldWideWrite permissions on any folder. You should give only read and sometimes required execute permissions to all folders for others.

Gediminas

15
gruessle
Re: own server == / != phpsuexec 777 / 755
  • 2005/12/4 20:58

  • gruessle

  • Friend of XOOPS

  • Posts: 348

  • Since: 2003/9/20


You have been very helpful.

Thank you
Grüssle
......

http://www.vmclinks.com

16
gediminasbyt
Re: own server == / != phpsuexec 777 / 755

Glad to hear that

17
gediminasbyt
Re: own server == / != phpsuexec 777 / 755

gruessle

I'd like to tell you a couple more things. Some contradicting with what I said before. Completely forgot to ask you what version of Apache you are using. Thing is that user 'nobody' was default user for apache 1.3 and user 'apache' did not even appear till Apache2 came out.

You could have just run your version of apache as 'nobody' as safe as with 'apache' only you would have chowned files to 'nobody'. Not sure what the heck I was smokin' while telling you to not run as nobody and must run as apache. There is no difference in those 2 accounts if they are setup properly.

Guess I just did not like nobody

18
gruessle
Re: own server == / != phpsuexec 777 / 755
  • 2005/12/5 18:33

  • gruessle

  • Friend of XOOPS

  • Posts: 348

  • Since: 2003/9/20


Thats why I have been so presistence, have been in your shoes many time. There are just so many possibilities it is sometimes hard to think of all of them.

Here it is

Server Version:
Apache/1.3.34 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 PHP/4.4.1
Grüssle
......

http://www.vmclinks.com

19
gediminasbyt
Re: own server == / != phpsuexec 777 / 755

In either case you are fine. If you want go to httpd.conf and update:

User apache
Group apache
or

User nobody
Group nobody

Restar httpd and then chown your files according to the user you have chosen. That's it!

Gediminas

P.S. If you are OK now with apache user running httpd I would not worry.

Login

Who's Online

229 user(s) are online (144 user(s) are browsing Support Forums)


Members: 0


Guests: 229


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits