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:
The permissions for the virtual folder looks like this:
Please give me a hint on how to proceed, I'm getting a bit desperate. Is it possible to "reset" everything using the webconfig?
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?
In Web Server
Share this post:
Accepted Answer
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:
OR...
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
Responses (12)
-
Accepted Answer
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
-
Accepted Answer
Worked like a charm!
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). -
Accepted Answer
-
Accepted Answer
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. -
Accepted Answer
-
Accepted Answer
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> -
Accepted Answer
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]# -
Accepted Answer
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]# -
Accepted Answer
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). -
Accepted Answer
------ 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:
while being in the www folder without success just to get the letter combination right without success.chmod 0770 html
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. -
Accepted Answer
Please login to post a reply
You will need to be logged in to be able to post a reply. Login using the form on the right or register an account if you are new here.
Register Here »