1

I am trying to set up virtual hosts on my laptop (Ubuntu 19.10, Apache/2.4.41) for my convenience. I followed this tutorial, with a few modifications to folder paths but I get this error:

Unable to connect

Firefox can’t establish a connection to the server at modipis.dev.

My configuration file (modipis.conf) is:

<VirtualHost *:80>
# Admin email, Server Name (domain name) and any aliases
ServerAdmin webmaster@domain1.com
ServerName  modipis.dev
ServerAlias www.modipis.dev

# Index file and Document Root (where the public files are located)
DirectoryIndex index.php
DocumentRoot /var/www/html/modip/modipIS/public/
<Directory  /var/www/html/modip/modipIS/public/>
    Require all granted
    AllowOverride All
    Options Indexes
</Directory>

# Custom log file locations
LogLevel warn
ErrorLog /var/www/html/modip/modipIS/various/logs/modipIS.dev-error_log
CustomLog /var/www/html/modip/modipIS/various/logs/modipIS.dev-access_log combined

</VirtualHost>

and my /etc/hosts

127.0.0.1       localhost
127.0.1.1       laptop
127.0.0.1       modipis.dev

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback

Any idea why this fails?

I also noticed the following:

  1. when I type modipis.dev, the browser redirects to https://modipis.dev. Is this normal?
  2. if I type 127.0.0.1 in the browser, it redirects to the modipis site.
NickP
  • 11
  • 1
  • 1
    Does this answer your question? [Virtual Host not working as expected when I'm using .dev domain extension](https://askubuntu.com/questions/1024957/virtual-host-not-working-as-expected-when-im-using-dev-domain-extension) You should use a domain extension different from `.dev`. – pa4080 Jan 30 '20 at 09:33
  • Thanks, that's exactly what I was looking for! – NickP Jan 30 '20 at 18:05

0 Answers0