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 (12)
  • Accepted Answer

    Saturday, September 03 2022, 05:40 AM - #Permalink
    Resolved
    0 votes
    If you couldn’t change anything, it suggests you don’t have write access at one level up .. check the privileges on the parent directory
    The reply is currently minimized Show
  • Accepted Answer

    Friday, September 02 2022, 08:51 PM - #Permalink
    Resolved
    0 votes
    ------ SOLVED ------

    So to the next question:

    How do I set the following permissions on my folders /var/www/html and /var/www/virtual?
    drwxrwx--- 3 apache allusers


    I tried:
    chmod 0770 html
    while being in the www folder without success just to get the letter combination right without success. :(

    This is something that I obviously haven't changed myself in the first hand, so I'm afraid this has happened in one of the updates.

    Sorry for being such a noob asking these basic questions. :(
    The reply is currently minimized Show
  • Accepted Answer

    Saturday, August 27 2022, 12:57 PM - #Permalink
    Resolved
    0 votes
    Note the difference ... you've got incorrect ownership and access rights.
    Correct settings ...
    drwxrwx--- 3 apache allusers


    Your settings ...
    drwxr-xr-x 3 apache allusers 
    drwxr-xr-x 3 root root

    Your settings are for owner write access only - ie. apache and root. Neither have group write access (which would give you write access via the allusers group).
    The reply is currently minimized Show
  • Accepted Answer

    Friday, August 26 2022, 10:07 PM - #Permalink
    Resolved
    0 votes
    Now we're there again, :(
    How should I be able to copy files via smb to /var/www/html? How should the rights look like and how do I achieve it?

    [root@system html]# ls -ldh
    drwxr-xr-x 3 apache allusers 12K 24 mar 15.58 .
    [root@system html]# cd ..
    [root@system www]# cd virtual
    [root@system virtual]# ls -ldh
    drwxr-xr-x 3 root root 31 29 apr 2019 .
    [root@system virtual]#
    The reply is currently minimized Show
  • Accepted Answer

    Friday, August 26 2022, 10:05 PM - #Permalink
    Resolved
    0 votes
    Now we're there again, :(
    How should I be able to copy files via smb to /var/www/html? How should the rights look like and how do I achieve it?

    [root@system html]# ls -ldh
    drwxr-xr-x 3 apache allusers 12K 24 mar 15.58 .
    [root@system html]# cd ..
    [root@system www]# cd virtual
    [root@system virtual]# ls -ldh
    drwxr-xr-x 3 root root 31 29 apr 2019 .
    [root@system virtual]#
    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
  • 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

    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, 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, 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, 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, 06:55 PM - #Permalink
    Resolved
    0 votes
    /var/log/virtual ??

    I hope you mean /var/www/virtual ;)
    The reply is currently minimized Show
Your Reply