November 28, 2012
Posted by on
What happens here is that I scped the file to server under my home directory, and then move it directly to the css folder. even I changed
the owner and permission, I keep getting permission error.
use command: ll, showing something like this:
-rwxr-xr-x 1 apache apache 69345 Nov 29 09:50 1place.css
-rwxr-xr-x 1 apache apache 2897 Nov 14 12:14 1place-framework.css
use command : ls -alZ
-rwxr-xr-x apache apache root:object_r:httpd_sys_content_t alert.css
-rwxr-xr-x apache apache user_u:object_r:httpd_sys_content_t alternate.css
we could see some files have a different value for sllinux from others. it points to my user account rather than the system one.
then we need to run command to fix it:
sudo restorecon *
another solution is to copy the file to a folder under var, and then move the file from the new folder to under css.