skip to Main Content

I’m trying to configure my apache so that I can use myprojectname.dev for all my projects dynamically. However, no matter what I try, I keep getting errors. Unable to connect is what firefox says, however I have no idea what is wrong. I have followed several tutorials on how to do this and all result in the same thing.

I have added the domain I want to use to my hosts file pointing to 127.0.0.1

Using the latest version of Apache and Ubuntu 18.04LTS. Sites file is enabled, vhosts mod is enabled. My browser also keeps redirecting to https for some reason. Pinging the domain confirms that it points to localhost. Any help would be appreciated.

Here is my config file

NameVirtualHost *:80

<Directory "/var/www">
    Options ExecCGI Indexes MultiViews FollowSymLinks Includes
    AllowOverride All
    Order allow,deny
    Allow from all

    DirectoryIndex index.php
    UseCanonicalName off
</Directory>

<VirtualHost *:80>
    ServerName local.dev
    ServerAlias *.dev
    VirtualDocumentRoot /var/www/%-2+/Web
</VirtualHost>

2

Answers


  1. Chosen as BEST ANSWER

    So I found the answer. Apparently Google owns the .dev tld and Chrome does not even check your configuration, just sends you straight to google.


  2. Is there any firewall rule set on the machine (iptables, firewalld)? Moreover, you may need to disable SElinux.
    So you may need to disable both firewall and SELinux on your machine.

    You say that your machine listens Port 80. Please try telnet to your local machine for Port 80 (both from machine itself, and also if possible from a machine shares the same network)

    telnet 127.0.0.1 80
    telnet <whatever_ip> 80
    

    I think you will telnet successfuly from local. In that case please also try to get your website content from machine itself (by using machine’s mozilla or commands like curl, wget by using 127.0.0.1 IP)

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search