標籤:host 名稱 lin hive 配置 code service 注意事項 common
在一個Window Server 2008R2系統上使用Apache架設了一個PHP的網站項目在配置Apache的過程中出現了以下問題 根據上面的提示說是沒有相應的許可權,那就在虛擬機器主機裡進行了配置,httpd-vhosts.conf 中的配置如下
<VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "D:/test.com" ServerName test.com ServerAlias www.test.com ErrorLog "logs/test.com-error.log" CustomLog "logs/test.com-access_log" common <Directory "D:/test.com"> #也可以在http.conf裡統一設定,但因為各個虛擬機器主機的設定不同,因此建議單獨進行設定 AllowOverride All Order allow,deny Allow from all Require all granted </Directory></VirtualHost>
但配置完成又出現了以下問題
The Apache service named reported the following error:
>>> Invalid command ‘Allow‘, perhaps misspelled or defined by a module not included in the server configuration . 後經過查詢才知道相應的模組沒有啟用,在http.conf中的配置,需要啟用以下模組即可
LoadModule access_compat_module modules/mod_access_compat.so #基於主機的組授權(名稱或IP地址) httpd 2.x相容的模組,LoadModule proxy_module modules/mod_proxy.so #apache的代理模組LoadModule proxy_http_module modules/mod_proxy_http.so #代理http和https請求LoadModule vhost_alias_module modules/mod_vhost_alias.so #虛擬機器主機動態配置LoadModule authz_host_module modules/mod_authz_host.so #基於主機的組授權Include conf/extra/httpd-vhosts.conf#啟用虛擬機器主機配置
重新啟動Apach服務即可 參考:解決問題 “You don‘t have permission to access /index.html on this server.”Apache HTTD 2.4: Invalid command ‘Order’, perhaps misspelled or defined by a module not included in the server configurationInvalid command ‘Order’, perhaps misspelled or defined by a module not included in the server configuration failedApache配置httpd-vhosts虛擬機器主機總結及注意事項 解決方案:虛擬機器主機是設定在httpd-vhosts.conf還是vhosts.conf還是httpd.conf?Apache下的設定檔httpd.conf、httpd-vhosts.conf(windows)Apache Module mod_authz_host
From WizNote
Apache Error: Invalid command ‘Allow’, perhaps misspelled or defined by a module not included in the server configuration