Skip to content

Instantly share code, notes, and snippets.

@davidalves1
Created July 8, 2016 11:44
Show Gist options
  • Save davidalves1/ac281e9d949536f14e539e3ef5cd2a76 to your computer and use it in GitHub Desktop.
Save davidalves1/ac281e9d949536f14e539e3ef5cd2a76 to your computer and use it in GitHub Desktop.
Confirgurar VirtualHost

Configurando VirtualHost no Windows

Neste caso foi utilizado o Wamp como servidor local.

Configurando o arquivo hosts

  • Abra o arquivo c:\Windows\System32\drivers\etc\hosts com seu editor de textos.
  • Adicione a seguinte linha no final do arquivo: 127.0.0.1 seu-projeto.app www.seu-projeto.app

Configurando o Apache

  • Abra o arquivo httpd.conf, que é o arquiov de configuração do Apache. Com o Wamp ele fica na pasta C:\wamp\bin\apache\apache2.4.18\conf\httpd.conf.
  • Adicione as linhas a seguir no final do arquivo:
<VirtualHost *:80>
    DocumentRoot "c:/wamp/www/seu-projeto"
    ServerName seu-projeto.app
    ServerAlias www.seu-projeto.app
</VirtualHost>
  • Reinicie o serviço do Apache e pronto!

Enjoy! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment