Public-Html folder

zwollepatrick

New member
Joined
Apr 20, 2007
Messages
2
Location
Salzburg
Hello anny one

Patrick here I am a beginner and I reset the ownership for my public_html folder, Now my site is not vible any more

How can I change it back to the right setting.

Patrick
 
How did you change ownership? Only root can change owners.
 
How did you change ownership? Only root can change owners.

Some installation scripts via web(for example, when you install a extension in Joomla) change the owner and group of the files to "apache" (or the system apache user of your SO (nobody, www-data, etc etc)).
zwollepatrick said:
Hello anny one

Patrick here I am a beginner and I reset the ownership for my public_html folder, Now my site is not vible any more

How can I change it back to the right setting.

Patrick

If you have root access to the server you can fix it using:

chown user.apache /home/user/domains/yourdomain.com/public_html
chown -R user.user /home/user/domains/yourdomain.com/public_html/*


If you don't have root access somebody with root privileges should make the change for you.

With some apache secure software (as modsecurity, or phpsuexec) you can't run php or cgi script with incorrect owners or permissions.
 
change the owner and group of the files to "apache"

It can create the files and folders as apache but it cannot change the owners of existing files and folders to apache. And we don't know that the public_html folder is owned by apache. The op has never said who owns the public_html folder.

The op has never been clear as to what happened. Personally I think he changed the permissions and not the owners of the public_html folder. In that case he needs to chmod 755 the folder.
 
Yes you are right, but only a user with root or administrative privileges can change this permissions, normal user can't change the ownership of a file.

The first step for know the problem is "ls -l" to /home/user/domains/domain.com and ls -l public_html directory for check permissions and ownership of the files.
 
Yes you are right, but only a user with root or administrative privileges can change this permissions

Not true. The user can change permissions with the file manager or any ftp program.

normal user can't change the ownership of a file

And that is true.

Permissions and ownership are two different things.

The OP said owner but I think he meant permissions because there is nothing he can do in the way of ownership that would mess up his public_html folder (unless he is a root user) but he could change the permissions of it.
 
I may have an idea...

I have experienced this.
I however have root access to my server, But when I fixed the problem, I did so by just reinstalling the script for that domain. Make sure you back up any files where data is stored, with the sql, just rename the old one, reinstall the script using the old user name etc, the script will change the ownership as it sees fit.
Once your script is reinstalled, overwrite the files, like the index etc that you have altered
Then delete the new sql and rename the old one to connect as it was before.
this is not complicated, but if you do not have root access, this should get you up in no time
Paul
 
the script will change the ownership as it sees fit

A script cannot change ownership unless it is run as root.

But again the OP has not stated what happened. We do not even know if it was a script or not that did it. We do not have enough information from the OP to tell him how to fix it.
 
I beg to differ....

The script can and will change ownership to Apache if it needs to.
at that point the direct admin panel will show the option to reset ownership under the file manager, If selected it will reset to the user.
With some scripts this may stop them from functioning if they need to call something from Apache to opperate.
I own over 70 websites.... I have seen this first hand and fixed it a few times too.
Paul
 
The script can and will change ownership to Apache if it needs to

No it cannot. That is a fact. Only root can change ownerships. That is a Linux/Unix fact. If a regular user could change ownerships then anybody could modify anybody else's files. There would be no security at all. That is the whole point of ownership.

New files will be created as the user running the script.

DA can change owners because it runs as root.

If a regular user can change ownerships then why would you need to fix anything as root. I dare you to login as a regular user and change ownership of any file including your won files. A regular user cannot change owners of even his own files.
 
No, I know what he has done, all DIRS owned by Apache can be reset in the File Manager on the latest version of DA, This is what the op has done. Now the folder is not working because the permissions are incorrect, Originally public_html has 711 i think, Changing this to 755 should rectify the problem. I had a user who did this himself.
Thanks

iHost-UK
http://www.ihostuk.co.uk
 
If that is true then the question still remains how did the public_html directory become owned by apache? The File Manager does not give you the option to reset the directory unless is is already owned by apache.

I don't think the op even cares anymore since he has not posted in the last few days. I think we might be done with this thread if we cannot get any more information from the op. Without more information we cannot solve the problem since we do not even know what the problem is. No where did the op say anything about anything being owned by apache. I think we are all guessing at what his problem is and offering solutions based on our guesses. What we really need is for him to post more information and he seems to have ceased doing this.
 
I agree with you floyd it really makes it difficult to help people if they don't supply enough information or don't respond to requests for more. I personally try to provide if asked on the forum to go into more detail, although sometimes of course people can forget, get sidetracked etc. I hope the op managed to solve there problem.

As for public_html being owned by apache, I thought that was the standard setup for all new user accounts, I'm just getting used to DA after moving from Cpanel, so I would be intersted to know if this is not the case?

Cheers
 
public_html is supposed to be owned by the user. The only time files or folders are owned by apache is if a php script running as an apache module created them. If the php scripts are running as a cgi then they would get created as the user.
 
My current setup seems to create public_html and private_html with apache as the owner, at the moment this isn't causing any problems as permissions are set correctly automatically.

In your opinion do you think I should investigate this or just leave it lie?
 
If the owner of public_html is apache and the permissions are set correctly to 755 then that means you will not be able to upload anything to it.
 
Ahh many apologies how silly of me, It's the Group that's apache not the user:o
Just logged in and looked ooops! permission is on 750.
Sorry about that got my UID and GID columns mixed.
 
Back
Top