{"id":539,"date":"2025-01-24T13:11:49","date_gmt":"2025-01-24T16:11:49","guid":{"rendered":"https:\/\/difusao.tech\/blog\/?p=539"},"modified":"2025-01-24T13:11:50","modified_gmt":"2025-01-24T16:11:50","slug":"usando-vs-code-com-wsl","status":"publish","type":"post","link":"https:\/\/difusao.tech\/blog\/usando-vs-code-com-wsl\/","title":{"rendered":"Usando VS Code com WSL"},"content":{"rendered":"<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"341\" height=\"94\" src=\"https:\/\/difusao.tech\/blog\/wp-content\/uploads\/2025\/01\/image-19.png\" alt=\"\" class=\"wp-image-540\" srcset=\"https:\/\/difusao.tech\/blog\/wp-content\/uploads\/2025\/01\/image-19.png 341w, https:\/\/difusao.tech\/blog\/wp-content\/uploads\/2025\/01\/image-19-300x83.png 300w\" sizes=\"auto, (max-width: 341px) 100vw, 341px\" \/><\/figure>\n<\/div>\n\n\n<p>Antes de toda configura\u00e7\u00e3o vamos abrir a nossa distro e colocar para rodar um servidor web, vamos utilizar o Apache.<br>Se voc\u00ea n\u00e3o tem o Debian instalado, volte no artigo anterior e veja os passos para instala\u00e7\u00e3o: <\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-difus-o-tech wp-block-embed-difus-o-tech\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"VJCIh7z60c\"><a href=\"https:\/\/difusao.tech\/blog\/como-instalar-o-linux-no-windows-com-o-wsl\/\">Como instalar o Linux no Windows com o WSL<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;Como instalar o Linux no Windows com o WSL&#8221; &#8212; Difus\u00e3o Tech\" src=\"https:\/\/difusao.tech\/blog\/como-instalar-o-linux-no-windows-com-o-wsl\/embed\/#?secret=TQeZ0keK2K#?secret=VJCIh7z60c\" data-secret=\"VJCIh7z60c\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>Abra o Windows Terminal e coloque a distro para rodar com o comando:<\/p>\n\n\n\n<p><mark style=\"background-color:#abb8c3\" class=\"has-inline-color\">wsl -d Debian<\/mark><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"420\" height=\"82\" src=\"https:\/\/difusao.tech\/blog\/wp-content\/uploads\/2025\/01\/image-20.png\" alt=\"\" class=\"wp-image-541\" srcset=\"https:\/\/difusao.tech\/blog\/wp-content\/uploads\/2025\/01\/image-20.png 420w, https:\/\/difusao.tech\/blog\/wp-content\/uploads\/2025\/01\/image-20-300x59.png 300w\" sizes=\"auto, (max-width: 420px) 100vw, 420px\" \/><\/figure>\n\n\n\n<p>Agora vamos instalar o Apache, habilitar e iniciar o servidor, segue os comandos:<\/p>\n\n\n\n<p><mark style=\"background-color:#abb8c3\" class=\"has-inline-color\">sudo apt install apache2<\/mark><\/p>\n\n\n\n<p><mark style=\"background-color:#abb8c3\" class=\"has-inline-color\">sudo systemctl enable apache2<\/mark><\/p>\n\n\n\n<p><mark style=\"background-color:#abb8c3\" class=\"has-inline-color\">sudo systemctl start apache2<\/mark><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"686\" height=\"130\" src=\"https:\/\/difusao.tech\/blog\/wp-content\/uploads\/2025\/01\/image-21.png\" alt=\"\" class=\"wp-image-542\" srcset=\"https:\/\/difusao.tech\/blog\/wp-content\/uploads\/2025\/01\/image-21.png 686w, https:\/\/difusao.tech\/blog\/wp-content\/uploads\/2025\/01\/image-21-300x57.png 300w\" sizes=\"auto, (max-width: 686px) 100vw, 686px\" \/><\/figure>\n\n\n\n<p>Servidor instalado e configurado, podemos ir no navegador do nosso Windows e digitar localhost, seremos automaticamente roteados para o servidor Apache rodando em nosso Debian.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"627\" height=\"497\" src=\"https:\/\/difusao.tech\/blog\/wp-content\/uploads\/2025\/01\/image-22.png\" alt=\"\" class=\"wp-image-543\" style=\"width:532px;height:auto\" srcset=\"https:\/\/difusao.tech\/blog\/wp-content\/uploads\/2025\/01\/image-22.png 627w, https:\/\/difusao.tech\/blog\/wp-content\/uploads\/2025\/01\/image-22-300x238.png 300w\" sizes=\"auto, (max-width: 627px) 100vw, 627px\" \/><\/figure>\n\n\n\n<p>Agora abra o VS Code no seu Windows e vamos instalar a extes\u00e3o Remote Develompent.<\/p>\n\n\n\n<p>Obs.: No passo 3 da imagem vai ter um bot\u00e3o de instalar, no meu caso j\u00e1 esta instalado e o bot\u00e3o n\u00e3o aparece.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"496\" src=\"https:\/\/difusao.tech\/blog\/wp-content\/uploads\/2025\/01\/image-23-1024x496.png\" alt=\"\" class=\"wp-image-544\" srcset=\"https:\/\/difusao.tech\/blog\/wp-content\/uploads\/2025\/01\/image-23-1024x496.png 1024w, https:\/\/difusao.tech\/blog\/wp-content\/uploads\/2025\/01\/image-23-300x145.png 300w, https:\/\/difusao.tech\/blog\/wp-content\/uploads\/2025\/01\/image-23-768x372.png 768w, https:\/\/difusao.tech\/blog\/wp-content\/uploads\/2025\/01\/image-23.png 1194w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Agora no seu Debian digite o comando abaixo para abri o VS Code do Windows na pasta de arquivos do Apache:<\/p>\n\n\n\n<p><mark style=\"background-color:#abb8c3\" class=\"has-inline-color\">code \/var\/www\/html<\/mark><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"634\" height=\"112\" src=\"https:\/\/difusao.tech\/blog\/wp-content\/uploads\/2025\/01\/image-24.png\" alt=\"\" class=\"wp-image-545\" srcset=\"https:\/\/difusao.tech\/blog\/wp-content\/uploads\/2025\/01\/image-24.png 634w, https:\/\/difusao.tech\/blog\/wp-content\/uploads\/2025\/01\/image-24-300x53.png 300w\" sizes=\"auto, (max-width: 634px) 100vw, 634px\" \/><\/figure>\n\n\n\n<p>Se o comando acima n\u00e3o funcionou, voc\u00ea tem que configurar o VS Code nas vari\u00e1veis de ambiente do Windows, segue o artigo com passo a passo: <\/p>\n\n\n\n<p><a href=\"https:\/\/difusao.tech\/blog\/abrir-vs-code-pela-linha-de-comando\/\">https:\/\/difusao.tech\/blog\/abrir-vs-code-pela-linha-de-comando<\/a><\/p>\n\n\n\n<p>Agora basta criar a sua p\u00e1gina normalmente usando o VS Code e visualizar o conte\u00fado sendo fornecido pelo servidor Apache do seu Debian que esta rodando via WSL.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"549\" src=\"https:\/\/difusao.tech\/blog\/wp-content\/uploads\/2025\/01\/image-25-1024x549.png\" alt=\"\" class=\"wp-image-546\" srcset=\"https:\/\/difusao.tech\/blog\/wp-content\/uploads\/2025\/01\/image-25-1024x549.png 1024w, https:\/\/difusao.tech\/blog\/wp-content\/uploads\/2025\/01\/image-25-300x161.png 300w, https:\/\/difusao.tech\/blog\/wp-content\/uploads\/2025\/01\/image-25-768x411.png 768w, https:\/\/difusao.tech\/blog\/wp-content\/uploads\/2025\/01\/image-25.png 1090w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Chegamos ao fim, caso tenha alguma d\u00favida, sutest\u00e3o ou viu algum erro, entre em contato: <a href=\"http:\/\/instagram.com\/leonardofcosta\">instagram.com\/leonardofcosta<\/a><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Antes de toda configura\u00e7\u00e3o vamos abrir a nossa distro e colocar para rodar um servidor web, vamos utilizar<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[62],"tags":[36,37,196,256,254,255],"class_list":["post-539","post","type-post","status-publish","format-standard","hentry","category-windows","tag-vs-code","tag-vscode","tag-windows","tag-windows-terminal","tag-wsl","tag-wsl2"],"_links":{"self":[{"href":"https:\/\/difusao.tech\/blog\/wp-json\/wp\/v2\/posts\/539","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/difusao.tech\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/difusao.tech\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/difusao.tech\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/difusao.tech\/blog\/wp-json\/wp\/v2\/comments?post=539"}],"version-history":[{"count":1,"href":"https:\/\/difusao.tech\/blog\/wp-json\/wp\/v2\/posts\/539\/revisions"}],"predecessor-version":[{"id":555,"href":"https:\/\/difusao.tech\/blog\/wp-json\/wp\/v2\/posts\/539\/revisions\/555"}],"wp:attachment":[{"href":"https:\/\/difusao.tech\/blog\/wp-json\/wp\/v2\/media?parent=539"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/difusao.tech\/blog\/wp-json\/wp\/v2\/categories?post=539"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/difusao.tech\/blog\/wp-json\/wp\/v2\/tags?post=539"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}