Apacheが間違ったディレクトリに入りました。

Apacheが間違ったディレクトリに入りました。

複数のWebサイトを持つRHELサーバーがあります。この特定のサイトには、アクセスできる3つのドメイン/サブドメインがあります。 2つは機能しますが、1つはエラーが発生します。これは私のconfファイルです。

<VirtualHost *:80>
        DocumentRoot /var/www/html/yln/web
        ServerName portal.yln.info
        ServerAlias www.yln.info
        ServerAlias yln.info
        Redirect "/" "https://portal.yln.info/"
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/html/yln>
                Options +FollowSymLinks +ExecCGI
                RewriteEngine On
                AllowOverride All
                Require all granted
        </Directory>

        ScriptAlias /cgi-bin/ /var/www/cgi-bin/
        <Directory "/var/www/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Require all granted
        </Directory>

        ErrorLog /var/log/httpd/yln_error_log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /var/log/httpd/yln_access_log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>
</VirtualHost>
<VirtualHost *:443>
        DocumentRoot /var/www/html/yln/web
        ServerName portal.yln.info
        ServerAlias www.yln.info
        ServerAlias yln.info

        SSLEngine on
        SSLCertificateFile /etc/pki/tls/certs/1d40117d24e9b169.crt
        SSLCertificateKeyFile /etc/pki/tls/private/yln.key
        SSLCertificateChainFile /etc/pki/tls/certs/gd_bundle-g2-g1.crt

        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/html/yln>
                Options +FollowSymLinks +ExecCGI
                RewriteEngine On
                AllowOverride All
                Require all granted
        </Directory>

        ScriptAlias /cgi-bin/ /var/www/cgi-bin/
        <Directory "/var/www/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Require all granted
        </Directory>

        ErrorLog /var/log/httpd/yln_error_log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn
        CustomLog /var/log/httpd/yln_access_log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>
</VirtualHost>

portal.yln.infowww.yln.info動作しhttp://yln.infoますがhttps://yln.info("s" 注) 403 Forbidden エラーを返します。

ログは次のとおりです。 [Fri Oct 21 06:48:05.284438 2022] [autoindex:error] [pid 16786:tid 140094660904704] [client 63.226.23.69:26860] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive

Apacheがドキュメントルートに設定していないディレクトリにインデックスファイルを提供しようとしているのはなぜですか?なぜこのようなことをするのでしょうかhttps://yln.info

修正する:私が示したconfファイルでは、Portal.yln.infoとPortal.yln.infoをキャプチャして正しい場所(同じドメイン、SSLコンテキスト)に送信します。私が言ったように、ブラウザは403 Forbiddenエラーを返し、ログに表示される内容を一覧表示しました。 yln.infoを除いて、httpとhttpsのすべてのバリエーションが機能します。

SSL証明書は* .yln.infoのワイルドカードです。また、このサーバーの以前のサイトでは、yln.infoをうまく使用したことに注意してください。 (新しいconfファイルをインストールするときに、confファイル名を古いファイルに変更しました。)

ベストアンサー1

おすすめ記事