Help! Permissions got screwed up (only) for httpd log files

5 posts / 0 new
Last post
#1 Fri, 05/10/2019 - 23:14
rajanv07

Help! Permissions got screwed up (only) for httpd log files

I am hosted on a linux CentOS, have root access

The Apache logs are all stored in /var/log/virtualmin The way it was setup: each shell/sftp user had read access to their own log files in the above directory, but not to their archives So, one of my colleagues who had root access, tried adding one of the users to a group, etc and screwed it up. Now no user can read the log files.

How do i reset the permissions of the log files without having to reinstall virtualmin all over again?

Please help. Thanks a ton, in advance

Rajan

Sun, 05/12/2019 - 16:32
adamjedgar

hi I am not an expert at this however i can at least provide you with the settings i have on my system (i run Debian not Centos)

Firstly, the /var/log/Virtualmin directory itself ownership is root:root with permissions 0711. However, the files inside that directory are owned by virtualservers:apache (not root:root) and also have 0660 as permissions. See below...

In Webmin>Others>Filemanager navigate to

/var/log/virtualmin/

select the log files according to the username (ie all of the logs that belong to specific usernames)

Then go to the tools menu>change ownership

Make sure each file is owned as virtual-server-name:www-data (or it might be "httpd" for Centos?)

In my case i run debian, so if "one" of my virtual servers in virtualmin was called Adam, an example of ownership owner Adam:www-data. You are running Centos, is its apache webserver name httpd? If so you would use httpd instead of www-data

In mine all permissions for /var/log/virtualmin are set to 0660

To do this in /var/log/virtualmin/ choose the "Select all" button (found to the left of File menu), Then go to "Tools" > Change Permissions (then set all permissions to 0660

You may need to also repeat this process for every page in your log file (if there are more than one page of logs)

I hope this is enough to sort your problem out

AJECreative is the home of $5 webhosting, $15/month VPS servers (1cpu,1gb RAM, 25GB storage)
Centos7, Debian9, or Ubuntu18LTS
Available Control Panels = Centos-Webpanel, Cyberpanel, or Virtualmin

https://ajecreative.com.au

Mon, 05/13/2019 - 03:07
rajanv07

Thank you so so much!

The "tools->change permissions" in Virtual min is greyed out. I have root access. So, i guess "Make sure each file is owned as virtual-server-name:www-data (or it might be "httpd" for Centos?)" you mean it is the same as chown on shell, right? chown [OPTIONS] USER[:GROUP] FILE(s) ?

Thanks once again

Mon, 05/13/2019 - 07:23 (Reply to #3)
adamjedgar

Hi Rajan, yes the tools>Change permissions will be greyed out.

You must first "select" the folders and files you want to change permissions on,

Only after you have actually selected at least one folder or file will that option will not be greyed out anymore and you will be able to change the ownership and permissions within the Virtualmin interface as i have explained.

kind regards Adam

AJECreative is the home of $5 webhosting, $15/month VPS servers (1cpu,1gb RAM, 25GB storage)
Centos7, Debian9, or Ubuntu18LTS
Available Control Panels = Centos-Webpanel, Cyberpanel, or Virtualmin

https://ajecreative.com.au

Tue, 05/14/2019 - 04:23
Eightmile

If the problem still exists it surely can be fixed with [url=https://www.enteros.com/solutions/]database software solutions[/url].

Topic locked