How to restore virtual host configuration on Mac OSX

1

I successfully created some virtual hosts on my machine a while ago by modifying my /etc/hosts file and my http-vhosts.conf file.

Then I found a very handy tool called virtualhost.sh (https://github.com/pgib/virtualhost.sh) to speed up this process, which I installed through homebrew.

One line -> virtualhost.sh my_virtual_host_name setups everything for me and I have a working virtualhost which points to the directory of my choice.

It worked successfully for me at first but now after adding a new host, it did not work. The host cannot be found in the browser. The original virtualhosts I manually created cannot be found now either. The default localhost virtualhost does not even work now.

I have deleted the host created with this tool by running virtualhost.sh --delete my_virtual_host_name. My manually created virtualhosts still don't work after this, including the default localhost.

Finally I deleted the tool completely through homebrew. This has not resolved the issue either.

I have obviously modified an important file through my messing around with virtualhosts.

I am completely lost with this problem, does anybody know how I can restore my settings to their original state?

Eoghan OLoughlin

Posted 2014-02-08T22:27:48.627

Reputation: 111

Did you find the solution to this as i am also having the exact same issue. Cheers – Tom Burman – 2014-09-06T12:28:21.820

Answers

0

There is /etc/hosts~orig - original hosts file. So you can just

➜  ~  sudo cp /etc/hosts\~orig /etc/hosts 

Chauskin Rodion

Posted 2014-02-08T22:27:48.627

Reputation: 101