【问题标题】:Apache2 VirtualHost subdomains not working?Apache2 VirtualHost 子域不工作?
【发布时间】:2013-04-28 09:55:36
【问题描述】:

我有一个静态公共 IP,我在上面托管我的网站 (Ubuntu Server 12.04)。我需要设置一个子域,但它不起作用,即使是 www。不管用。我从 GoDaddy 购买了域名并设置了正确的 NS

我将配置文件保存在 domain.me 下的/etc/apache2/sites-available 中,然后我做了a2ensite domain.me 并重新加载并重新启动了apache2,但仍然没有运气。

这是我的配置文件

<VirtualHost *:80>
  ServerAdmin webmaster@domain.me
  ServerName  domain.me
  ServerAlias www.domain.me
  DocumentRoot /var/www
  LogLevel warn
  ErrorLog  /var/log/apache2/error.log
  CustomLog /var/log/apache2/access.log combined
</VirtualHost>

<VirtualHost *:80>
  ServerAdmin webmaster@domain.me
  ServerName  me.subdomain.me
  ServerAlias www.me.subdomain.me
  DocumentRoot /var/www/subdomain
</VirtualHost>

curl http://domain.me 输出索引文件,curl http://www.domain.me 输出curl: (6) Couldn't resolve host 'www.domain.me' 和子域相同

【问题讨论】:

    标签: apache2 subdomain


    【解决方案1】:

    我设法解决了它,对于那些遇到同样问题的人,请确保您设置了 A 记录

    【讨论】:

      猜你喜欢
      • 2016-11-19
      • 2017-01-14
      • 2021-01-24
      • 1970-01-01
      • 2016-10-26
      • 2017-04-15
      • 2016-10-22
      • 2018-07-07
      • 1970-01-01
      相关资源
      最近更新 更多