Apache没有重定向到正确的虚拟主机

时间:2014-08-18 12:59:28

标签: apache apache2 vps ubuntu-14.04

我已设置以下虚拟主机

  <VirtualHost *:80>

    ServerAdmin user@mysite.com
    ServerName mysite.com
    ServerAlias www.mysite.com
    DocumentRoot /var/www/homepage/public_html


    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

 </VirtualHost>

当我点击我的网址时,Apache仍会显示默认网页。不是我在给文档根目录中创建的索引。

我认为问题在于我在我的域中重定向。当我点击域时,它会重定向到服务器作为代理。

我是否仍然可以使用虚拟主机,以防我想在我的VPS上设置其他网站? 将域集成到服务器将再次花费我宝贵的钱,所以我想避免它。

我如何设置我的虚拟主机,以便apache显示正确的站点,具体取决于我重定向的域。

   apache2ctl -S:

输出:

 VirtualHost configuration:
  *:80                   is a NameVirtualHost
     default server xxxxxx.stratoserver.net (/etc/apache2/sites-enabled/000-default.conf:1)
     port 80 namevhost xxxxxxx.stratoserver.net (/etc/apache2/sites-enabled/000-default.conf:1)
     port 80 namevhost mysite.com (/etc/apache2/sites-enabled/homepage.conf:1)
             alias www.mysite.com
   ServerRoot: "/etc/apache2"
   Main DocumentRoot: "/var/www"
   Main ErrorLog: "/var/log/apache2/error.log"
   Mutex default: dir="/var/lock/apache2" mechanism=fcntl 
   Mutex mpm-accept: using_defaults
   Mutex watchdog-callback: using_defaults
   PidFile: "/var/run/apache2/apache2.pid"
   Define: DUMP_VHOSTS
   Define: DUMP_RUN_CFG
   User: name="www-data" id=33 not_used
   Group: name="www-data" id=33 not_used

0 个答案:

没有答案
相关问题