Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delete a wamp virtual site?

With the new WAMP, you have to create a virtual host site to see it in localhost development. Which I did, and it worked.
However, I just moved that website to a Live server, and I cannot, for the life of me, see the website in my browser. I get a message:

This site can’t be reached

My friends see it, but it cannot be seen by the development computer.

I tried :

  • Deleting the definition in httpd-vhosts
  • Rebooting
  • Flushing Windows 10 DNS cache

All to no avail. And I cannot find information about deleting a website from WAMP!!! Any hint appreciated.

like image 466
Mylene Bruneau Avatar asked Jul 06 '16 18:07

Mylene Bruneau


3 Answers

It may be due to the hostname duplicate. Edit the virtual host to fix this.

For windows users, edit your virtual host from

C:\windows\system32\drivers\etc\hosts

and

C:\wamp\bin\apache\apache2.4.23\conf\extra

To edit these files you need to run as administrator. To do this, try the following steps:

  1. Press the Windows key.
  2. Type Notepad in the search field.
  3. In the search results, right-click Notepad and select Run as administrator.
  4. From Notepad, open the following file: c:\Windows\System32\Drivers\etc\hosts.
  5. Make the necessary changes to the file.
  6. Click File > Save to save your changes.

Finally restart the server.

like image 76
Babitha Avatar answered Oct 14 '22 02:10

Babitha


I am assuming that you use a local domain name that is the same as your live sites domain name i.e. mysite.com rather than mysite.dev

So you will have added a line to your HOSTS file like this

127.0.0.1 mysite.com
::1  mysite.com

So from your PC you have told windows your site lives locally on this PC.

All you need to do is remove those 2 lines from your C:\windows\system32\drivers\etc\hosts file and then either reboot or run (from an admin acoount)

net stop dnscache
net start dnscache

Now Windows does not know where yoursite.com lives and it will ask a DNS Server for the LIVE sites IP Address, and find your live site.

like image 25
RiggsFolly Avatar answered Oct 14 '22 02:10

RiggsFolly


Babitha's post is correct but I had to make these changes:

For both you need to edit them as administrator
C:\windows\system32\drivers\etc\hosts
C:\wamp64\bin\apache\apache2.4.46\conf\extra\httpd-vhosts.conf
Don't just come paste your apache version can be diffrent and your wamp location in another place.

Edit virtual host that you need.

like image 45
Alexandru Avatar answered Oct 14 '22 02:10

Alexandru