亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

錯誤消息“禁止您訪問/在此服務器上沒有權限”

錯誤消息“禁止您訪問/在此服務器上沒有權限”

躍然一笑 2019-06-19 15:16:49
錯誤消息“禁止您訪問/在此服務器上沒有權限”我自己配置了我的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>
查看完整描述

3 回答

?
大話西游666

TA貢獻1817條經驗 獲得超14個贊

我知道這個問題已經解決了,但我碰巧自己解決了這個問題。

原因

禁止您沒有訪問/在此服務器上的權限

中的apache目錄的默認配置。httpd.conf.

#
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories). 
#
# First, we configure the "default" to be a very restrictive set of 
# features.  
#
<Directory "/">
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all          # the cause of permission denied
</Directory>

簡單改變Deny from allAllow from all應該解決許可問題。

或者,更好的方法是在虛擬主機配置上指定單獨的目錄權限。

<VirtualHost *:80>
    ....

    # Set access permission
    <Directory "/path/to/docroot">
        Allow from all
    </Directory>

    ....
</VirtualHost>

截至Apache-2.4但是,訪問控制是使用新模塊完成的。mod_authz_host (從2.2升級到2.4)。因此,新的Require應該使用指令。

<VirtualHost *:80>
    ....

    # Set access permission
    <Directory "/path/to/docroot">
        Require all granted
    </Directory>

    ....
</VirtualHost>


查看完整回答
反對 回復 2019-06-19
  • 3 回答
  • 0 關注
  • 1636 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號