4

I'm having issues with getting Apache working with my virtualhosts, and I've narrowed it down to the fact that I'm adding manually-created virtual hosts (vs. the others which are created by a python script). When I run:

ls -l

I get this:

-rw-r--r--  1 root      wheel   772 May 10 17:53 host1.com
-rw-r--r--  1 root      wheel   766 May 10 17:53 host2.com
-rw-r--r--@ 1 myname    wheel   914 Mar 28 14:24 host3.com
-rw-r--r--  1 root      wheel  3897 May 10 17:53 host4.com
-rw-r--r--  1 root      wheel  5240 May 10 17:53 host5.com
-rw-r--r--  1 root      wheel  4037 May 10 17:53 host6.com

I'm not sure what the "@" refers to, but that manually-created file my username as the owner instead of root. When I view the file info in OS X (Finder), I see that permissions for most of the files show "system" has Read & Write access, but my manually-created vh file shows that I (my username) has Read & Write access.

Can someone tell me how to set the permissions for "system" or "root" in Terminal? I do have superuser access.

4

2 回答 2

9

您可以使用更改终端中文件的所有权

sudo chown owner:group filepath

或者在你的情况下

sudo chown root:wheel filepath

此外,您可以使用更改文件的权限chmod

于 2013-05-11T22:54:01.853 回答
0

@ 表示有扩展属性。您可以使用命令 xattr 查看它们
您可以使用 chown 设置所有者

于 2013-05-11T22:59:20.637 回答