【问题标题】:Apache Virtual Host not workingApache 虚拟主机不工作
【发布时间】:2013-08-29 11:58:43
【问题描述】:

我最近升级到最新版本的 PHP(在此之前一切正常)并在 /etc/apache2/sites-enabled/local.events 下有以下虚拟主机配置文件

<VirtualHost *:80>
    ServerName events.local
    DocumentRoot "/home/john/development"

    <Directory "/home/john/development">
            AllowOverride All
    </Directory>
</VirtualHost>

但是,当我转到 http://local.event/ 时,它没有运行位于 /home/john/development 下的网站,而是运行位于 /var/www/index.html 的文件。在我只使用以下代码更新 PHP 之后,我该如何解决这个问题以及为什么会出现这种情况:

sudo add-apt-repository ppa:ondrej/php5
sudo apt-get update
sudo apt-get upgrade

【问题讨论】:

    标签: apache ubuntu virtualhost


    【解决方案1】:
    1. 改变
    <VirtualHost *:80>
    ServerName events.local
    ServerAleas events.local
    DocumentRoot "/home/john/development"
    
    &lt;Directory "/home/john/development"&gt;
                AllowOverride All
        &lt;/Directory&gt;
    &lt;/VirtualHost&gt;
     2. Need add in /etc/hosts  line (127.0.0.1    events.local)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-04-16
      • 1970-01-01
      • 1970-01-01
      • 2016-01-22
      • 2015-04-10
      • 2016-11-06
      • 2012-11-04
      相关资源
      最近更新 更多