MacOS 上的 Apache 2.4 突然權限錯誤

MacOS 上的 Apache 2.4 突然權限錯誤

突然,我在 MacOS Yosemite 上本地安裝的 Apache 2.4 停止工作了。問題似乎與權限有關,但我找不到解決方法。

經過幾個小時並閱讀了幾篇帖子,現在的情況是:

錯誤:

[authz_core:debug] [pid 35232] mod_authz_core.c(799): [client 127.0.0.1:55992] AH01626: authorization result of Require valid-user : denied (no authenticated user yet)
[core:crit] (24)Too many open files: [client ::1:53498] AH00529: /Users/username/Sites/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/Users/username/Sites/' is executable

(我沒有這樣的 .htaccess 檔案)。無論如何,我到處殘酷地執行 777 許可:

$ chmod -R a+rwx /Users/username
$ ls -l /Users/username
drwxrwxrwx  187 username  staff      6358 Dec 13 16:05 Sites
$ ls -l /Users/
drwxrwxrwx+ 174 username  staff  5916 Dec 13 16:39 username

我在 httpd.conf 中的指令如下:

<Directory "/Users/username/Sites/">
    Options +Indexes +FollowSymLinks +ExecCGI
    AllowOverride All 
    Order allow,deny
    Allow from all
    #Require all granted - tried, doesn't matter
</Directory>

我可以擺脫允許覆蓋,但我確實需要 .htaccess 並且無論如何,我的虛擬主機中的許多圖像和資源仍然存在權限問題。

根據某人的建議,我在 httpd.conf 中更改了 apache 用戶

#User _www
#Group _www
User username
Group staff

還是一樣。

答案1

您每天的點擊次數是多少?如果它們很高,您可以嘗試更改快取設定。您可能會保持文件開啟狀態以嘗試縮短回應時間。您託管了多少個虛擬網域?您的虛擬主機的(大約)總檔案數是多少?這似乎可能是個效能調整問題...

相關內容