가상 호스트를 올바르게 설정하는 방법

가상 호스트를 올바르게 설정하는 방법

내가 갈 때www.example.fr올바른 DocumentRoot( )를 얻었 /var/www/example/web지만example.fr, 기본 DocumentRoot( )를 제공합니다 /var/www/.

나는 이미 많은 것을 시도했지만 아무것도 효과가 없었습니다.

/etc/hosts : 
51.254.122.31   example.fr


/etc/apache2/sites-enabled/example.fr.conf :

<VirtualHost *:80>
        ServerAdmin [email protected]
        ServerName example.fr
        ServerAlias www.example.fr
        DocumentRoot /var/www/example/web/
        DirectoryIndex app.php
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log

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

        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

내가 뭘 잘못했는지 아세요?

답변1

아마도 지시사항을 잊어버렸을 겁니다 NameVirtualHost. 를 사용하여 구성된 가상 호스트를 확인할 수도 있습니다 apachectl -S.

관련 정보