MrMike
V2EX  ›  Apache

请教一个 apache 虚拟主机配置的问题

  •  
  •   MrMike · Oct 24, 2017 · 3076 views
    This topic created in 3133 days ago, the information mentioned may be changed or developed.
    <VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot /mnt/www/example
    ServerName demo.example.com
    ServerAlias demo.example.com *.demo.example.com
    ErrorLog logs/demo-example-error_log
    CustomLog logs/demo-example-access_log common
    <Directory "/mnt/www/example">
    Options Indexes FollowSymLinks MultiViews ExecCGI
    AllowOverride All
    Require all granted
    </Directory>
    </VirtualHost>

    这是一个项目的域名配置,但是访问 login.demo.example.com 这样三级域名时,全部跳转到了 apche 根目录去了。同样的配置,在另外一个项目里, 只是修改了下二级域名,三级域名跳转都正常。
    请教下,还有哪些需要配置?
    Supplement 1  ·  Oct 24, 2017
    同一个服务器下,我使用了多个二级域名指向对应的项目,每个二级域名都开启了泛域名,是不是 apache 对域名的数量有限制?主域名只有一个。。
    2 replies    2017-10-24 10:14:15 +08:00
    logfile
        1
    logfile  
       Oct 24, 2017
    ServerName demo.example.com
    ServerAlias demo.example.com *.demo.example.com
    你别名不需要再添加 demo.example.com

    有没有 restart apache2?
    MrMike
        2
    MrMike  
    OP
       Oct 24, 2017
    @logfile 肯定重启了的,你说的,我之前也删了试过,还是不行。很是郁闷。。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2634 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 49ms · UTC 11:08 · PVG 19:08 · LAX 04:08 · JFK 07:08
    ♥ Do have faith in what you're doing.