
嘗試在我的家庭伺服器上設定 Minecraft Technic Solder 儲存庫。
這是我的 /etc/apache2/sites-available/ 中的 000-default.conf:
<VirtualHost *:80>
# Host that will server this project.
ServerName 192.168.1.19
ServerAdmin *email*
# The location of public directory.
DocumentRoot /home/evilarceus/TechnicSolder/public/
# Important options for solder public directory
<Directory /home/evilarceus/TechnicSolder/public/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>
<Directory "/home/evilarceus/TechnicSolder/public/repo/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Require all granted
</Directory>
# Useful logs for debug.
ErrorLog /home/evilarceus/TechnicSolder/logs/error.log
CustomLog /home/evilarceus/TechnicSolder/logs/access.log combined
第一個目錄(home/evilarceceus/TechnicSolder/public)工作得很好。但是,第二個目錄(我希望我的儲存庫所在的位置)顯示 403 Forbidden。
回購/權限:
drwxrwxr-x 3 evilarceus evilarceus 4096 Oct 2 19:39 repo
錯誤日誌:
[Sun Oct 02 20:39:31.034401 2016] [access_compat:error] [pid 17874] [client 192.168.1.20:50072] AH01797: client denied by server configuration: /home/evilarceus/TechnicSolder/public/repo
老實說,我現在不知道該怎麼辦。幫助將不勝感激!
答案1
在for 目錄Allow from all
之後新增一行。Order allow,deny
/home/evilarceus/TechnicSolder/public/repo/
答案2
這是一個非常使用同時具有 v2.4 auth 指令和 v2.2 指令的 apache 設定檔的常見問題。
找到所有舊指令並將其變更為帶有選項區塊Allow, Order, Satisfy and Require
的 Apache v2.4 ,然後註解掉 mod_access_compat 的載入。否則,您將繼續遇到意想不到的問題,大部分會導致.Require
<Require(Any|All|None)>
client denied by server configuration
一旦你的配置乾淨了,添加任何剩餘的錯誤。