VirtualHost always returns default host with Apache on Ubuntu 14.04

前端 未结 12 621
夕颜
夕颜 2021-01-30 07:16

I try to setup a virtual host besides the default localhost. Whenever I try to call my virtual host http://test I get the default Apache2 Index file t

12条回答
  •  广开言路
    2021-01-30 07:38

    My case on Apache 2.4 the issue was solved by adding below setting to virtual host configuration:

    Listen 80
    

    so that settings are something like:

    Listen 80
    
        ServerAdmin admin@example.com
        ServerName testsite.com
        ServerAlias www.testsite.com
        DocumentRoot /var/www/testsite
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
    
    

提交回复
热议问题