修复我的本地主机上拒绝的权限

时间:2014-02-19 09:52:03

标签: php apache localhost

我正在使用Ubunto。当我浏览本地主机时,我希望看到我的共享目录名为myproj。现在,当我浏览它时,这是我收到的消息:

Forbidden

You don't have permission to access / on this server.

我试过了:

1)授予此目录中任何人的权限,并将所有者更改为我当前的用户 2)将我的conf设置更改为:

任何人都可以帮我解决这个问题吗?

我的conf设置如下:

<VirtualHost *:80>
  ServerAdmin webmaster@localhost

DocumentRoot /etc/apache2/sites-available/myproj
<Directory /myproj>
  Options FollowSymLinks
  AllowOverride All
</Directory>

<Directory /etc/apache2/sites-available/myproj>
  Options -Indexes FollowSymLinks MultiViews
  AllowOverride All
  Order allow,deny
  deny None
  allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
  AllowOverride All
  Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
  Order allow,deny
  Allow from all
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog ${APACHE_LOG_DIR}/access.log combined

1 个答案:

答案 0 :(得分:0)

在conf中你应该改变:

-Indexes

要:

Indexes

然后,在重新启动Apache并提供/etc/apache2/sites-available/myproj没有index.html或index.php作为默认文档后,您可以看到浏览器中显示的该文件夹的内容。

相关问题