Magento2 Virtualhost Website not accessible Firefox / adds www
Posted by: Dutchman159753 (---.cm-4-4c.dynamic.ziggo.nl)
Date: July 04, 2018 01:44PM

Windows 10 x64
WampServer v3.1.3 64
Apache 2.4.33
PHP 7.1.16
Magento 2.2.2


So odd, I have used WAMP for years now, but last week I decided to do my half annual Windows reinstall with a brand new WAMP again.

Did the same steps except for using this time the Virtualhost option within WAMP.

But the strange thing is that with Firefox (my preferred browser) it does not load when you go to the Virtualhost via the localhost website, and if you input the URL in the address line, it adds www before the website.localhost URL.

But with Chrome it does load.

So I decided to use it with Chrome then, well, turned out that my Gulp Browsersync cannot find the website either, also not with Chrome.

Has anybody an idea what this could be?

Options: ReplyQuote
Re: Magento2 Virtualhost Website not accessible Firefox / adds www
Posted by: RiggsFolly (Moderator)
Date: July 04, 2018 02:03PM

Hi

Show us your httpd-vhosts.conf file and also your HOSTS file contents.

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: Magento2 Virtualhost Website not accessible Firefox / adds www
Posted by: Dutchman159753 (---.cm-4-4c.dynamic.ziggo.nl)
Date: July 04, 2018 02:20PM

# Virtual Hosts
#
<VirtualHost *:80>
  ServerName localhost
  ServerAlias localhost
  DocumentRoot "${INSTALL_DIR}/www"
  <Directory "${INSTALL_DIR}/www/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride All
    Require local
  </Directory>
</VirtualHost>

#
<VirtualHost *:80>
	ServerName website.localhost
	DocumentRoot "c:/dev/website.localhost"
    SetEnv MAGE_RUN_CODE "NL"
    SetEnv MAGE_RUN_TYPE "store"
	<Directory  "c:/dev/website.localhost/">
		Options +Indexes +Includes +FollowSymLinks +MultiViews
		AllowOverride All
		Require local
	</Directory>
</VirtualHost>

---


127.0.0.1 localhost

127.0.0.1	website.localhost
::1 localhost



Edited 1 time(s). Last edit at 07/04/2018 02:21PM by RiggsFolly.

Options: ReplyQuote
Re: Magento2 Virtualhost Website not accessible Firefox / adds www
Posted by: RiggsFolly (Moderator)
Date: July 04, 2018 02:25PM

Try this HOSTS file fix


127.0.0.1 localhost
::1 localhost

127.0.0.1 website.localhost
::1 website.localhost


I was also wondering if using the `.localhost` on `website.localhost` might be causing a little confusion.

I woudl also suggest using `website.local` for example. That would also require a quick amendment to the httpd-vhosts.conf file as well.

Let me know if this is any help.

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: Magento2 Virtualhost Website not accessible Firefox / adds www
Posted by: Dutchman159753 (---.cm-4-4c.dynamic.ziggo.nl)
Date: July 04, 2018 04:17PM

When I use local instead of localhost even Chrome cannot connect, it will try to search for it on google.

When I go to localhost and then click op website.local it says ERR_NAME_NOT_RESOLVED

Tried a simple HTML website to see if maybe my Magento data was not correct, but same result.

Options: ReplyQuote
Re: Magento2 Virtualhost Website not accessible Firefox / adds www
Posted by: Otomatic (Moderator)
Date: July 04, 2018 04:45PM

Hi,

> When I use local instead of localhost even Chrome cannot connect, it will try to search for it on google.

Never forget that if you modify a ServerName and, of course, the same name in the hosts file, you must restart the DNS and Apache for this modification to be taken into account by Apache and Windows.
A tool integrated to Wampserver can do this:
Ricght-Click Wampmanager tray icon -> Tools -> Restart DNS

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Magento2 Virtualhost Website not accessible Firefox / adds www
Posted by: Dutchman159753 (---.cm-4-4c.dynamic.ziggo.nl)
Date: July 07, 2018 01:51PM

Ok, I have a clue now what caused it, but not the exact reason behind it, it happened because of install of software that edits HOST file. Let's just keep it at that. But the odd thing is that changing the HOST file back does not fix the problem afterwards.

Options: ReplyQuote


Sorry, only registered users may post in this forum.