简体   繁体   中英

Apache Virtual Host not working

I recently upgraded to the latest version of PHP (before this everything was working) and had the following virtual host configuration file under /etc/apache2/sites-enabled/local.events

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

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

However instead of running my website located under /home/john/development when I go to http://local.event/ it runs the file located at /var/www/index.html. How do I fix this and also why is this the case after I only updated PHP using the following code:

sudo add-apt-repository ppa:ondrej/php5
sudo apt-get update
sudo apt-get upgrade
  1. Change
 <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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM