Forums

Resolved
0 votes
Hi,
For some reason (starting yesterday) I can't copy files to the folder /var/www/html/ like I've done for the last year(s).

I'm using a Mac and before I've just Selected "Go->Connect to server" and connected to my IP over SMB, entered my ClearOS username and then selected the folder I want to connect to.
I can connect to it and read the content but not write to it.

I can still do it to another folder located in /var/www/virtual/ in the same way as I've done before.

I've seen that the permissions looks different on the two folders but I don't want to start making changes when I'm not 100% sure on what I'm doing. :)

The permissions for the /var/www/html looks like this:
[root@system html]# ls -ldh
drwxr-xr-x 2 root root 8,0K 5 nov 02.47 .


The permissions for the virtual folder looks like this:
[root@system yyy.xxx.se]# ls -ldh
drwxrwx--- 5 apache allusers 79 8 jul 2018 .


Please give me a hint on how to proceed, I'm getting a bit desperate. Is it possible to "reset" everything using the webconfig?
Monday, April 15 2019, 06:04 PM
Share this post:

Accepted Answer

Monday, April 15 2019, 06:41 PM - #Permalink
Resolved
0 votes
I'm not quite sure what stomped on your permissions like that. If your other folder has the right permissions that you want you can copy the permission using this nifty trick:

chmod --reference <source> <destination>
chown --reference <source> <destination>


OR...

chmod --reference /var/www/virtual/yyy.xxx.se /var/www/html
chown --reference /var/www/virtual/yyy.xxx.se /var/www/html
The reply is currently minimized Show
Responses (7)
  • Accepted Answer

    Monday, April 15 2019, 06:55 PM - #Permalink
    Resolved
    0 votes
    /var/log/virtual ??

    I hope you mean /var/www/virtual ;)
    The reply is currently minimized Show
  • Accepted Answer

    Monday, April 15 2019, 07:06 PM - #Permalink
    Resolved
    0 votes
    Your /var/www/html is wrong. It should be apache:allusers:
    [root@server ~]# ls -lA /var/www
    total 4
    drwxr-xr-x 2 root root 6 Jun 27 2018 cgi-bin
    drwxrwx--- 7 apache allusers 4096 Mar 31 22:15 html
    drwxr-xr-x 7 root root 126 May 3 2018 virtual


    [root@server ~]# ls -lA /var/www/virtual
    total 0
    drwxrwx--- 6 apache allusers 54 Jul 1 2018 sandbox.howitts.co.uk
    drwxrwx--- 3 apache allusers 64 Mar 21 08:05 standard.howitts.co.uk
    drwxrwx--- 5 apache allusers 40 Feb 3 2018 test2
    drwxrwx--- 5 apache family 40 Feb 3 2018 test2.howitts.co.uk
    drwxrwx--- 5 apache allusers 40 Jan 7 2018 test.howitts.co.uk
    The reply is currently minimized Show
  • Accepted Answer

    Monday, April 15 2019, 07:10 PM - #Permalink
    Resolved
    0 votes
    Worked like a charm! :D

    It's now after Dave's hint like this:
    [root@system www]# ls -lA /var/www
    totalt 12
    drwxr-xr-x 2 root root 6 5 nov 02.47 cgi-bin
    drwxrwx--- 2 apache allusers 8192 15 apr 21.05 html
    drwxr-xr-x 3 root root 31 3 maj 2018 virtual


    @Dave: If you edit your post I will accept it as answer (I will even like it). ;)
    The reply is currently minimized Show
  • Accepted Answer

    Monday, April 15 2019, 08:14 PM - #Permalink
    Resolved
    0 votes
    Can you tell us if you're using Linode, and also the contents of /etc/clearos-release?
    The reply is currently minimized Show
  • Accepted Answer

    Monday, April 15 2019, 09:26 PM - #Permalink
    Resolved
    0 votes
    Göran,

    Thanks for reporting this. Nick sent me a private message and got me thinking as to what may have caused this. Well, this is a long term problem and we are supposed to have a workaround for it. Basically, /var/www/html is owned by the upstream httpd package and it will ALWAYS set the permissions back to root:root. Not a big issue except for the reasons you specify. As a workaround (not the best way but it works) we run a script nightly that is supposed to reset the permissions. We record what they are supposed to be in /etc/clearos/flexshare.conf and then run this script, nightly:

    /usr/clearos/apps/flexshare/deploy/set-file-permissions

    Ah...but it doesn't work right. I've validated this on 7.5 and it doesn't work there either. So this is a bug. I've reported it here:

    https://gitlab.com/clearos/clearfoundation/app-flexshare/issues/10

    You shouldn't have any issues with it until the next time that upstream updates the httpd package or if we can get the bug fixed first. Reverting the behavior will cause other bugs since you are running into this as a result of a previous patch. That being said, the bug fix I'm proposing will require that you change a control here once in place.

    Thanks for reporting this. If anyone wants to try and fix it in the community, feel free to send us a merge request.
    The reply is currently minimized Show
  • Accepted Answer

    Monday, April 15 2019, 09:47 PM - #Permalink
    Resolved
    0 votes
    Nick Howitt wrote:

    Can you tell us if you're using Linode, and also the contents of /etc/clearos-release?


    Nope, no Linode as of what I know, pure ClearOS with Plex.

    Content of what you asked for:
    [root@system ~]# cat /etc/clearos-release
    ClearOS release 7.6.0 (Final)
    The reply is currently minimized Show
  • Accepted Answer

    Saturday, April 20 2019, 06:14 AM - #Permalink
    Resolved
    0 votes
    Did u used below codes?If yes then pls check your path..Many times issues arise due to either destination or source paths..So check it once myschoolbucks
    chmod --reference <source> <destination>
    chown --reference <source> <destination>
    The reply is currently minimized Show
Your Reply