猿问

错误消息“禁止您访问/在此服务器上没有权限”

错误消息“禁止您访问/在此服务器上没有权限”

我自己配置了我的apache,并尝试加载phpMyAdmin在虚拟主机上,但我收到了:

禁止您访问/访问此服务器

我的httpd.conf

#
# This is the main Apache HTTP server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.2> for detailed information.
# In particular, see 
# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do.  They're here only as hints or reminders.  If you are unsure
# consult the online docs. You have been warned.  
#
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with "/" (or "drive:/" for Win32), the
# server will use that explicit path.  If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "logs/foo.log"
# with ServerRoot set to "C:/Program Files (x86)/Apache Software Foundation/Apache2.2" will be interpreted by the
# server as "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/logs/foo.log".
#
# NOTE: Where filenames are specified, you must use forward slashes
# instead of backslashes (e.g., "c:/apache" instead of "c:\apache").
# If a drive letter is omitted, the drive on which httpd.exe is located
# will be used by default.  It is recommended that you always supply
# an explicit drive letter in absolute paths to avoid confusion.

和vhosts.conf:

NameVirtualHost 127.0.0.1:80

<VirtualHost 127.0.0.1:80>
    DocumentRoot i:/projects/webserver/__tools/phpmyadmin/
    ServerName dbadmin.tools
</VirtualHost>


跃然一笑
浏览 1619回答 3
3回答

大话西游666

我知道这个问题已经解决了,但我碰巧自己解决了这个问题。原因禁止您没有访问/在此服务器上的权限中的apache目录的默认配置。httpd.conf.# #&nbsp;Each&nbsp;directory&nbsp;to&nbsp;which&nbsp;Apache&nbsp;has&nbsp;access&nbsp;can&nbsp;be&nbsp;configured&nbsp;with&nbsp;respect #&nbsp;to&nbsp;which&nbsp;services&nbsp;and&nbsp;features&nbsp;are&nbsp;allowed&nbsp;and/or&nbsp;disabled&nbsp;in&nbsp;that #&nbsp;directory&nbsp;(and&nbsp;its&nbsp;subdirectories).&nbsp; # #&nbsp;First,&nbsp;we&nbsp;configure&nbsp;the&nbsp;"default"&nbsp;to&nbsp;be&nbsp;a&nbsp;very&nbsp;restrictive&nbsp;set&nbsp;of&nbsp; #&nbsp;features.&nbsp;&nbsp; # <Directory&nbsp;"/"> &nbsp;&nbsp;&nbsp;&nbsp;Options&nbsp;FollowSymLinks &nbsp;&nbsp;&nbsp;&nbsp;AllowOverride&nbsp;None &nbsp;&nbsp;&nbsp;&nbsp;Order&nbsp;deny,allow &nbsp;&nbsp;&nbsp;&nbsp;Deny&nbsp;from&nbsp;all&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;the&nbsp;cause&nbsp;of&nbsp;permission&nbsp;denied </Directory>简单改变Deny from all到Allow from all应该解决许可问题。或者,更好的方法是在虚拟主机配置上指定单独的目录权限。<VirtualHost&nbsp;*:80> &nbsp;&nbsp;&nbsp;&nbsp;.... &nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;Set&nbsp;access&nbsp;permission &nbsp;&nbsp;&nbsp;&nbsp;<Directory&nbsp;"/path/to/docroot"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Allow&nbsp;from&nbsp;all &nbsp;&nbsp;&nbsp;&nbsp;</Directory> &nbsp;&nbsp;&nbsp;&nbsp;.... </VirtualHost>截至Apache-2.4但是,访问控制是使用新模块完成的。mod_authz_host&nbsp;(从2.2升级到2.4)。因此,新的Require应该使用指令。<VirtualHost&nbsp;*:80> &nbsp;&nbsp;&nbsp;&nbsp;.... &nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;Set&nbsp;access&nbsp;permission &nbsp;&nbsp;&nbsp;&nbsp;<Directory&nbsp;"/path/to/docroot"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Require&nbsp;all&nbsp;granted &nbsp;&nbsp;&nbsp;&nbsp;</Directory> &nbsp;&nbsp;&nbsp;&nbsp;.... </VirtualHost>
随时随地看视频慕课网APP
我要回答