I'm doing a Laravel project and I need to set up a virtual host example.dev in my system. For that I've created a copy of 000-default.conf and named it as example.dev.conf and placed in /etc/apache2/sites-available. The contents of the file is given below (comments removed):
<VirtualHost *:80>
<Directory /var/www/html/example/public/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
ServerName example.dev
ServerAlias www.example.dev
ServerAdmin admin@example.dev
DocumentRoot /var/www/html/example/public
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Then I've enabled the site using a2ensite command and disabled 000-default.conf using a2dissite command. Then it will open my project when I try localhost (/var/www/html) in my browser and not example.dev. The virtual host example.dev always produce "The site can't be reached" error in browsers.
Any suggestions?