V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
MrMike
V2EX  ›  Apache

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

  •  
  •   MrMike · 2017-10-24 09:42:09 +08:00 · 2471 次点击
    这是一个创建于 2366 天前的主题,其中的信息可能已经有所发展或是发生改变。
    <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 根目录去了。同样的配置,在另外一个项目里, 只是修改了下二级域名,三级域名跳转都正常。
    请教下,还有哪些需要配置?
    第 1 条附言  ·  2017-10-24 10:19:20 +08:00
    同一个服务器下,我使用了多个二级域名指向对应的项目,每个二级域名都开启了泛域名,是不是 apache 对域名的数量有限制?主域名只有一个。。
    2 条回复    2017-10-24 10:14:15 +08:00
    logfile
        1
    logfile  
       2017-10-24 09:50:24 +08:00
    ServerName demo.example.com
    ServerAlias demo.example.com *.demo.example.com
    你别名不需要再添加 demo.example.com

    有没有 restart apache2?
    MrMike
        2
    MrMike  
    OP
       2017-10-24 10:14:15 +08:00
    @logfile 肯定重启了的,你说的,我之前也删了试过,还是不行。很是郁闷。。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5619 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 05:47 · PVG 13:47 · LAX 22:47 · JFK 01:47
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.