「サーバー構成でクライアントが拒否されました」と「AllowOverride All」

「サーバー構成でクライアントが拒否されました」と「AllowOverride All」

仮想マシンにCentOS 6.3とApache 2.2をインストールしました。次のVirtualHostを使用してLAMPスタックを設定しようとしています。

  • localhostロードパス/var/www/html/
  • lcl.mydomain.comロードパス/var/www/html/dev_lcl/

そこに私は次のように付け加えhttpd.confました。

NameVirtualHost XXX.XXX.XXX.XXX:80

virtualhosts.confその後、ファイルを追加しました。

<VirtualHost XXX.XXX.XXX.XXX:80>
    DocumentRoot /var/www/html/
    ServerName localhost
    <Directory "/var/www/html/">
        Options Indexes FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
    ErrorLog /var/log/httpd/error_log_localhost
    CustomLog /var/log/httpd/access_log_localhost "combined"
</VirtualHost>

<VirtualHost XXX.XXX.XXX.XXX:80>
    DocumentRoot /var/www/html/dev_lcl/
    ServerName lcl.mydomain.com
    <Directory "/var/www/html/dev_lcl/">
        Options Indexes FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
    ErrorLog /var/log/httpd/error_log_dev_lcl
    CustomLog /var/log/httpd/access_log_dev_lcl "combined"
</VirtualHost>

これによりエラーが発生します。

サーバー構成によってクライアントが拒否されました

AllowOverride All両方ServerNamesの負荷を削除しましたが、mod_rewrite機能しませんが必要です。この問題をどのように解決できますか?

ベストアンサー1

解決策が見つかりました。.htaccessファイルに以下を追加しました。

order deny,allow
allow from XXX.XX.

これにより問題が発生します。一度取り出して、うまくいきました。

おすすめ記事