2017-08-31 160 views
0

我安裝了Debian 7.11 64位。我試了很長時間纔得到這臺服務器的工作。我可以在我的服務器上完美地訪問網頁,但是我的朋友和我的手機無法訪問其設備上的網頁。我試圖改變apache2的「默認」配置文件,但沒有運氣。有什麼建議麼?您沒有權限訪問/在此服務器上!錯誤

**<VirtualHost *:80> 
ServerAdmin [email protected] 

DocumentRoot /var/www 
<Directory /> 
    #Options FollowSymLinks 
    Options Indexes FollowSymLinks Includes ExecCGI 
    AllowOverride all 
    Order deny,allow 
    allow from all 
    Require all granted 
</Directory> 
<Directory /var/www/> 
    #Options FollowSymLinks 
    Options Indexes FollowSymLinks Includes ExecCGI 
    AllowOverride all 
    Order allow,deny 
    allow from all 
    Require all granted 
</Directory> 

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ 
<Directory "/usr/lib/cgi-bin"> 
    AllowOverride none 
    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch 
    Order allow,deny 
    Allow from all 
    Require all granted 
</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 

**

如果你需要更多信息,我可以提供。

編輯:

<VirtualHost *:80> 
ServerAdmin [email protected] 

DocumentRoot /var/www 
<Directory var/www/> 
    #Options FollowSymLinks 
    Options Indexes FollowSymLinks Includes ExecCGI 
    AllowOverride All 
    Require all granted 
</Directory> 
<Directory /var/www> 
    #Options FollowSymLinks 
    Options Indexes FollowSymLinks Includes ExecCGI 
    AllowOverride All 
    Require all granted 
</Directory> 

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ 
<Directory "/usr/lib/cgi-bin"> 
    AllowOverride None 
    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch 
    Require all granted 
</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 

現在我有我的代碼改變這一點,但仍然是不工作...

+0

我不是專家,但不指的是你的系統的根?你真的想提供該訪問?關於你的問題,你必須使用本地主機訪問,其餘的嘗試訪問? – Juan

回答

0

我通過設置選項指令固定同樣的問題要麼在httpd.conf的全局目錄設置中,要麼在的特定目錄塊中httpd-vhosts.conf

Options Indexes FollowSymLinks Includes ExecCGI 

默認情況下,全局目錄設置爲(httpd.conf line ~188)

<Directory /> 
    Options FollowSymLinks 
    AllowOverride All 
    Order deny,allow 
    Allow from all 
</Directory> 

設置選項: Options Indexes FollowSymLinks Includes ExecCGI

最後,應該是這樣的:

<Directory /> 
    #Options FollowSymLinks 
    Options Indexes FollowSymLinks Includes ExecCGI 
    AllowOverride All 
    Order deny,allow 
    Allow from all 
</Directory> 

而且嘗試更改Order deny,allowAllow from allRequire all granted

+0

另外,看看https://stackoverflow.com/questions/10873295/error-message-forbidden-you-dont-have-permission-to-access-on-this-server –

+0

首先,我沒有httpd。 conf文件,一直在搜索我的目錄,無法找到它,如果我有它...我也試圖改變線路要求所有授予,沒有任何幸運... – TheNeedingMan

相關問題