複数の仮想ホストの作成(Linux Mint 18.2)

複数の仮想ホストの作成(Linux Mint 18.2)

私の仮想ホストの構成は次のとおりです(localhost 構成ファイル)ファイル(開発中のアプリが機能するには、次のようにする必要があります。なぜ設定しなかったのか尋ねないでください。):

<VirtualHost *:80>
    ServerAdmin [email protected]
    ServerName localhost
    #ServerAlias www.wp.dev
    DocumentRoot /home/sasha/Documents/Scopic/STS/project/timesheetapprovalsgit/timesheet_ui/web

    <Directory /home/sasha/Documents/Scopic/STS/project/timesheetapprovalsgit/timesheet_ui>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride all
        Order allow,deny
        allow from all
        require all granted
    </Directory>
</VirtualHost>

新しい仮想ホストを追加しようとしています(prst設定ファイル):

<VirtualHost *:80>
    ServerAdmin [email protected]
    ServerName prst.app
    ServerAlias www.prst.app
    DocumentRoot /home/sasha/Documents/Scopic/PerformanceReview/project/performance-review-status-tracking/public

    <Directory /home/sasha/Documents/Scopic/PerformanceReview/project/performance-review-status-tracking>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride all
        Order allow,deny
        allow from all
        require all granted
    </Directory>
</VirtualHost>

私のホストファイル:

127.0.0.1   localhost
127.0.0.1   www.prst.app

現在私が経験している最大の問題は、私が行くたびにwww.prst.app、localhostにリダイレクトされます。私がここで何を間違っているのか知っている人はいますか?

ベストアンサー1

お客様のサーバー名は次のように定義されます。

  ServerName prst.app

/etc/hostsしたがって、www.prst.appの代わりにprst.appで定義してください。

127.0.0.1   prst.app

www.prst.appにアクセスするには、次の場所で新しい仮想ホストと新しいレコードを作成します。/etc/hosts

おすすめ記事