哪些文件控制您网站的可见性?
我在 uni 上对我的用户帐户运行以下命令
chmod -R 700 *
然后,我运行
chmod -R 755 public_html
当我浏览到它时,我的主页仍然是“禁止”。
我的用户帐户的权限
4 drwx------ 5 Newbie staff 4096 2008-12-19 12:39 Desktop
4 drwx------ 10 Newbie staff 4096 2009-04-16 02:28 Documents
4 drwx------ 4 Newbie staff 4096 2008-11-28 20:48 irclogs
4 -rwx------ 1 Newbie staff 1686 2008-09-10 16:00 kieli
4 drwxr-xr-x 3 Newbie www 4096 2009-04-16 02:14 public_html
4 drwx------ 2 Newbie staff 4096 2008-09-01 08:43 Templates
4 drwx------ 4 Newbie staff 4096 2008-12-21 03:15 tmp
4 drwx------ 7 Newbie staff 4096 2008-09-03 21:39 Windows
4 drwx------ 4 Newbie staff 4096 2008-10-03 16:29 workspace
public_html 中文件的权限
4 -rwxr-xr-x 1 newbie staff 3414 2009-04-15 02:23 index.html
4 -rwxr-xr-x 1 newbie staff 2219 2008-09-16 10:46 index.html~
144 -rwxr-xr-x 1 newbie staff 140120 2009-04-14 22:16 jquery.js
4 -rwxr-xr-x 1 newbie staff 699 2009-04-15 01:05 template.css
I run the following command at uni to my user account
chmod -R 700 *
Then, I run
chmod -R 755 public_html
My homepage remains to be "Forbidden" when I browse to it.
The permissions of my user account
4 drwx------ 5 Newbie staff 4096 2008-12-19 12:39 Desktop
4 drwx------ 10 Newbie staff 4096 2009-04-16 02:28 Documents
4 drwx------ 4 Newbie staff 4096 2008-11-28 20:48 irclogs
4 -rwx------ 1 Newbie staff 1686 2008-09-10 16:00 kieli
4 drwxr-xr-x 3 Newbie www 4096 2009-04-16 02:14 public_html
4 drwx------ 2 Newbie staff 4096 2008-09-01 08:43 Templates
4 drwx------ 4 Newbie staff 4096 2008-12-21 03:15 tmp
4 drwx------ 7 Newbie staff 4096 2008-09-03 21:39 Windows
4 drwx------ 4 Newbie staff 4096 2008-10-03 16:29 workspace
The permissions of files in public_html
4 -rwxr-xr-x 1 newbie staff 3414 2009-04-15 02:23 index.html
4 -rwxr-xr-x 1 newbie staff 2219 2008-09-16 10:46 index.html~
144 -rwxr-xr-x 1 newbie staff 140120 2009-04-14 22:16 jquery.js
4 -rwxr-xr-x 1 newbie staff 699 2009-04-15 01:05 template.css
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
好吧,您的第二个 chmod 似乎工作得不太好,因为您的 public_html 目录的模式是 744,而不是 755。
您还需要进行设置,以便 Web 服务器可以“查看”您的主目录; www 用户需要对该目录有执行权限。
chmod o+x .
可能是您最好的选择。Well, your second chmod doesn't seem to be working very well, since your public_html directory is mode 744, not 755.
You'll also need to make it so that your home directory can be "looked through" by the Web server; www user needs execute permission on the directory.
chmod o+x .
is probably your best bet.目录中有索引文件吗?
Do you have an index file in the directory?
您还需要授予 public_html 中文件的执行权限。 在您授予权限 chmod -R 755 public_html 的语句中,给出的权限仍然只有 744。因此也授予执行权限。
You would also need to give excute permission to the files in public_html. In the statement you are giving permissions chmod -R 755 public_html, still the permissions given is only 744. So give the execute permissions as well.
我发现了另一个错误。
我的用户文件夹的权限是700。
我把它改成了701。
我现在可以看到我的网站了。
好像需要701。
I found another bug.
My user folder had the permissions 700.
I changed it to 701.
I can now see my website.
It seems that 701 is required.