我在我的Ubuntu服务器上设置了一个虚拟主机:
<VirtualHost *:80> ServerAdmin [email protected] ServerName dailysongfix.com ServerAlias www.dailysongfix.com DirectoryIndex index.php index.html DocumentRoot /var/www/dailysongfix/public # Custom log file locations LogLevel warn ErrorLog /var/log/apache2/dailysongfix/error_log CustomLog /var/log/apache2/dailysongfix/access_log combined </VirtualHost>
如果我去http:dailysongfix。 我得到一个禁止的错误。 这可能是我的目录权限问题…所以我去了/ var / www
这是我的权限:
ls -al /var drwxr-xr-x 3 root root 4096 May 26 22:47 www ls -al /var/www/ drwxr-xr-x 3 root root 4096 May 26 22:47 . drwxr-xr-x 14 root root 4096 May 26 22:46 .. drwxr-xr-x 3 root www-data 4096 May 26 22:53 dailysongfix ls -al /var/www/dailysongfix/ drwxr-xr-x 3 root www-data 4096 May 26 22:53 . drwxr-xr-x 3 root root 4096 May 26 22:47 .. drwxr-sr-x 2 root www-data 4096 May 26 22:59 public
我也在我的httpd.conf中有这个
User www-data Group www-data
有谁知道如何解决这一问题?
谢谢!
看起来像我需要更改目录权限:
<Directory "/var/www/dailysongfix/public"> Options Indexes FollowSymLinks AllowOverride None Order allow,deny Allow from all </Directory>
您也可以将“chgrp”从“root”改为“www-data”,以确保位于公共目录中的任何文件上载脚本能够正确地将文件保存到该目录。
“根”没有理由成为“公众”的主人群,我可以看到。