Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XAMPP Virtual Hosts not working

Before marking this as answered, please read the entire thing because yes there is a good amount of these questions but NONE of the answers on them have worked at all.

For the last 6 months I've looked at around 50 different form posts here and around the web to try and get my XAMPP virtual hosts working.

Hosts File

127.0.0.1       localhost
127.0.0.1       vws.localhost
127.0.0.1       instancegaming.net
127.0.0.1       vws.instancegaming.net

http-vhosts File (Updated 7/26)

 # Virtual Hosts
 #
 # Required modules: mod_log_config

 # If you want to maintain multiple domains/hostnames on your
 # machine you can setup VirtualHost containers for them. Most      configurations
 # use only name-based virtual hosts so the server doesn't need to worry    about
 # IP addresses. This is indicated by the asterisks in the directives below.
 #
 # Please see the documentation at
 # <URL:http://httpd.apache.org/docs/2.4/vhosts/>
 # for further details before you try to setup virtual hosts.
 #
 # You may use the command line option '-S' to verify your virtual host
 # configuration.

 #
 # Use name-based virtual hosting.
 #
 # NameVirtualHost *:80
 #
 # VirtualHost example:
 # Almost any Apache directive may go into a VirtualHost container.
 # The first VirtualHost section is used for all requests that do not
 # match a ##ServerName or ##ServerAlias in any <VirtualHost> block.
 #
 <VirtualHost *:80>
    ServerName localhost
    DocumentRoot "C:\xampp\htdocs"
    <Directory "C:\xampp\htdocs">
      DirectoryIndex index.php
    </Directory>
 </VirtualHost>

I'm at a loss of what to do, I've tried putting all fields to localhost then to instancegaming.net but nothing seems to work. I've read the Apache log and there's only SSL errors floating around.

When I try going to [ http:// ] vws.localhost, vws.192.168.0.47, vws.instancegaming.net all of which give the same error in chrome:

ERR_NAME_NOT_RESOLVED

Then I tried emptying chromes host cache, but that didn't help either. Sidenote: I reinstalled XAMPP 4 times trying to make this work.

like image 883
Jacob Jewett Avatar asked Jul 23 '16 06:07

Jacob Jewett


People also ask

Can I host multiple websites on XAMPP?

You can run more than one WordPress website in your XAMPP staging environment through virtual hosts. Virtual hosts allow us to use aliases to run multiple websites on the same IP address and web server.

How can we set virtual host in local machine?

Create a new virtual host This file is located at C:\MAMP\bin\apache\conf\extra\httpd-vhosts. conf . With your editor, open the configuration file and at the end of the document add the code snippet below. Apache configuration files use directives to set rules that should be followed by the server.


1 Answers

Additionally make sure that the line

Include etc/extra/httpd-vhosts.conf

is not quoted out in httpd.conf

like image 148
Tom Avatar answered Nov 16 '22 01:11

Tom