VirtualHost always returns default host with Apache on Ubuntu 14.04

前端 未结 12 833
夕颜
夕颜 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:44

    tl;dr: Call it with sudo: sudo service apache2 reload


    Looks like the behaviour of service apache2 reload fooled me. See the following log:

    user@Laptop:/etc/apache2/sites-available$ sudo a2ensite test.conf 
    Enabling site test.
    To activate the new configuration, you need to run:
      service apache2 reload
    user@Laptop:/etc/apache2/sites-available$ service apache2 reload
     * Reloading web server apache2                                                  * 
    user@Laptop:/etc/apache2/sites-available$
    

    Try to reach http://test: NOT working

    user@Laptop:/etc/apache2/sites-available$ sudo service apache2 reload
     * Reloading web server apache2                                                  * 
    user@Laptop:/etc/apache2/sites-available$
    

    Try to reach http://test: WORKING

    So, find the difference! The point is that I thought it would've reloaded correctly in the first place. There are no entries in the log files either. Calling it with sudo helped. Is this a bug?

提交回复
热议问题