{"id":15457,"date":"2019-04-15T12:32:53","date_gmt":"2019-04-15T15:32:53","guid":{"rendered":"https:\/\/blog.hostinger.io\/br-tutoriais\/?p=15457"},"modified":"2024-08-30T20:58:51","modified_gmt":"2024-08-30T23:58:51","slug":"nginx-vs-apache","status":"publish","type":"post","link":"\/br\/tutoriais\/nginx-vs-apache","title":{"rendered":"NGINX vs Apache: qual servidor web usar na minha VPS?"},"content":{"rendered":"<p><span style=\"font-weight: 400\">Para garantir que o seu usu&aacute;rio tenha uma boa experi&ecirc;ncia, voc&ecirc; precisa se certificar que seus servidores s&atilde;o r&aacute;pidos. <\/span><\/p><p><span style=\"font-weight: 400\">Para isso, h&aacute; muitos programas que voc&ecirc; pode usar. Os mais populares s&atilde;o o Nginx e o Apache. <\/span><\/p><p><span style=\"font-weight: 400\">Nesse artigo, voc&ecirc; ir&aacute; encontrar uma compara&ccedil;&atilde;o detalhada entre os dois, que vai ajudar voc&ecirc; a escolher qual se encaixa melhor na sua VPS!<\/span><\/p><figure class=\"wp-block-image size-large\"><a href=\"https:\/\/assets.hostinger.com\/content\/tutorials\/pdf\/Linux-Commands-Cheatsheet-BR.pdf\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" width=\"1024\" height=\"283\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/53\/2022\/12\/Linux-cheat-sheet-BR.png\/public\" alt=\"\" class=\"wp-image-30351\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/53\/2022\/12\/Linux-cheat-sheet-BR.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/53\/2022\/12\/Linux-cheat-sheet-BR.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/53\/2022\/12\/Linux-cheat-sheet-BR.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/53\/2022\/12\/Linux-cheat-sheet-BR.png\/w=768,fit=scale-down 768w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/53\/2022\/12\/Linux-cheat-sheet-BR.png\/w=1536,fit=scale-down 1536w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><h2 class=\"wp-block-heading\" id=\"h-nginx\"><b>Nginx<\/b><\/h2><p><span style=\"font-weight: 400\">O <\/span><a href=\"https:\/\/www.hostinger.com\/br\/tutoriais\/o-que-e-nginx\/\"><span style=\"font-weight: 400\">Nginx<\/span><\/a><span style=\"font-weight: 400\"> &eacute; um servidor web leve e de alta performance. Ele &eacute; de c&oacute;digo aberto; logo, &eacute; de f&aacute;cil customiza&ccedil;&atilde;o. &Eacute; muito popular e, junto com o Apache, eles governam praticamente todo o mercado de servidores web.<\/span><\/p><p><span style=\"font-weight: 400\">O desenvolvimento do Nginx come&ccedil;ou em 2002, quando surgiu a necessidade de incrementar o n&uacute;mero de simula&ccedil;&otilde;es solicitadas por servidor.<\/span><\/p><p><span style=\"font-weight: 400\">No n&iacute;vel t&eacute;cnico, o servidor Nginx usa uma arquitetura de subprocessos ass&iacute;ncrona. Isso<\/span> <span style=\"font-weight: 400\">significa que, quando uma solicita&ccedil;&atilde;o &eacute; gerada, um novo processo n&atilde;o &eacute; criado no processador do servidor. Isso faz com que o desempenho dele aumente. <\/span><\/p><p><span style=\"font-weight: 400\">Al&eacute;m disso, o Nginx &eacute; o servidor web que mais tem crescido nos &uacute;ltimos anos. Existem mais de 375 milh&otilde;es de sites que est&atilde;o rodando gra&ccedil;as a ele. Ele est&aacute; dispon&iacute;vel nas principais distribui&ccedil;&otilde;es do Linux, como o CentOS.<\/span><\/p><h2 class=\"wp-block-heading\" id=\"h-apache\"><b>Apache<\/b><\/h2><p><span style=\"font-weight: 400\">O <\/span><a href=\"https:\/\/www.hostinger.com\/br\/tutoriais\/o-que-e-apache\"><span style=\"font-weight: 400\">Apache<\/span><\/a><span style=\"font-weight: 400\"> j&aacute; &eacute; um servidor web veterano. Ele foi criado em 1995 e, hoje em dia, &eacute; o mais popular do mundo. Ele tamb&eacute;m &eacute; de c&oacute;digo aberto. Ent&atilde;o, voc&ecirc; pode examinar, melhorar e adaptar o c&oacute;digo dele para as suas necessidades. <\/span><\/p><p><span style=\"font-weight: 400\">Como o Nginx, o Apache est&aacute; dispon&iacute;vel para quase todas as distribui&ccedil;&otilde;es do Linux, incluindo o Ubuntu e <\/span><a href=\"https:\/\/www.hostinger.com\/br\/tutoriais\/como-instalar-linux-apache-mysql-php-lamp\/\"><span style=\"font-weight: 400\">CentOS<\/span><\/a><span style=\"font-weight: 400\">.<\/span><\/p><p><span style=\"font-weight: 400\">O objetivo principal do servidor Apache &eacute; dar seguran&ccedil;a, estabilidade e flexibilidade Por exemplo,<\/span> <span style=\"font-weight: 400\">o Apache gerencia m&oacute;dulos de m&uacute;ltiplos processos para manter a mesma conex&atilde;o de maneiras diferentes<\/span><span style=\"font-weight: 400\">. <\/span><\/p><p><span style=\"font-weight: 400\">Essa &eacute; a principal vantagem, pois os administradores podem aplicar crit&eacute;rios para cada conex&atilde;o. Entretanto, com seu pr&oacute;prio consumo, ele requer mais recursos. <\/span><\/p><p>\n\n\n<div class=\"protip\">\n                    <h4 class=\"title\">Leitura Sugerida<\/h4>\n                    <p><a href=\"\/br\/tutoriais\/o-que-e-vps-como-escolher-um-servidor-vps\">O Que &Eacute; VPS?<\/a><\/p>\n                <\/div>\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-nginx-vs-apache-vale-a-pena-comparar\"><b>Nginx vs Apache: Vale a Pena Comparar?<\/b><\/h2><p><span style=\"font-weight: 400\">De forma simples, sim.<\/span> <span style=\"font-weight: 400\">Enquanto ambos fazem suas fun&ccedil;&otilde;es perfeitamente, eles ainda tem uma leve diferen&ccedil;a.<\/span> <span style=\"font-weight: 400\">Portanto, &eacute; interessante voc&ecirc; saber em quais &aacute;reas da sua VPS cada um se adequa melhor.<\/span><\/p><h3 class=\"wp-block-heading\" id=\"h-1-nginx-vs-apache-popularidade\"><b>1. Nginx vs Apache &ndash; Popularidade<\/b><\/h3><p><span style=\"font-weight: 400\">Popularidade n&atilde;o &eacute; um fator t&eacute;cnico a ser considerado. Mas ele <\/span><span style=\"font-weight: 400\">influencia no n&iacute;vel de suporte que a comunidade de cada um tem<\/span><span style=\"font-weight: 400\">.<\/span> <span style=\"font-weight: 400\">Nginx e Apache s&atilde;o muito populares nesse caso. Ent&atilde;o, voc&ecirc; pode quase dizer que eles est&atilde;o empatados.<\/span><\/p><p><span style=\"font-weight: 400\">Contudo, o Apache tem um maior suporte da comunidade de c&oacute;digo aberto, o que faz com que seja ideal para projetos pessoais e educacionais.<\/span><\/p><p><span style=\"font-weight: 400\">Al&eacute;m disso, o servidor web Apache ainda &eacute; o mais popular no mundo, apesar da diferen&ccedil;a entre ele o Nginx n&atilde;o ser tanta.<\/span><\/p><h3 class=\"wp-block-heading\" id=\"h-2-nginx-vs-apache-seguranca\"><b>2. Nginx vs Apache &ndash; Seguran&ccedil;a<\/b><\/h3><p><span style=\"font-weight: 400\">Nessa quest&atilde;o, ambos tem &oacute;timas pol&iacute;ticas de seguran&ccedil;a. Frequentemente, ambos desenvolvem atualiza&ccedil;&otilde;es de seguran&ccedil;a<\/span> <span style=\"font-weight: 400\">para prevenir ataque DDos. <\/span><\/p><p><span style=\"font-weight: 400\">Acrescentando ao t&oacute;pico, eles t&ecirc;m desenvolvedores ativos e atualiza&ccedil;&otilde;es constantes.<\/span><\/p><p>\n\n\n<div class=\"protip\">\n                    <h4 class=\"title\">Dica<\/h4>\n                    <p>Na Hostinger voc&ecirc; pode <a href=\"\/br\/servidor-vps\">comprar VPS<\/a> com &oacute;timos pre&ccedil;os. &Eacute; a sua chance de ter um servidor robusto e com servidores brasileiros!<\/p>\n                <\/div>\n\n\n\n<\/p><h3 class=\"wp-block-heading\" id=\"h-3-nginx-vs-apache-desempenho\"><b>3. Nginx vs Apache &ndash; Desempenho<\/b><\/h3><p><span style=\"font-weight: 400\">Se voc&ecirc; tem um site, o ideal &eacute; que seu servidor seja o mais r&aacute;pido poss&iacute;vel. Se n&atilde;o for, isso pode causar colapsos no servidor, ou pior ainda, a perda de visitantes.<\/span><\/p><p><span style=\"font-weight: 400\">Nesse sentido, Gra&ccedil;as ao gerenciamento de sub-processos que o Nginx tem, ele responde melhor aos requerimentos do usu&aacute;rio. <\/span><\/p><p><span style=\"font-weight: 400\">Al&eacute;m do mais, como &eacute; baseado em eventos, apenas o servidor responde com solicita&ccedil;&otilde;es, fazendo com que ele n&atilde;o gaste mem&oacute;ria desnecessariamente.<\/span><\/p><p><span style=\"font-weight: 400\">Fora isso, o <\/span><span style=\"font-weight: 400\">Nginx faz um consumo mais eficiente dos recursos do computador. Ou seja, ele consome menos RAM.<\/span><\/p><p><span style=\"font-weight: 400\">Outra c<\/span><span style=\"font-weight: 400\">oisa que devemos terem mente &eacute; que o Nginx processa m&uacute;ltiplas solicita&ccedil;&otilde;es de uma forma melhor. Isso po<\/span><span style=\"font-weight: 400\">rque, quando nosso servidor &eacute; acessado por muitos clientes ao mesmo tempo, o Nginx &eacute; superior ao Apache.<\/span><\/p><h3 class=\"wp-block-heading\" id=\"h-4-nginx-vs-apache-flexibilidade\"><b>4. Nginx vs Apache &ndash; Flexibilidade<\/b><\/h3><p><span style=\"font-weight: 400\">O Sysadmin tem que saber como lidar com v&aacute;rias situa&ccedil;&otilde;es diferentes. Nesse caso, aplica&ccedil;&otilde;es devem ser flex&iacute;veis o suficiente para se adaptarem ao o que &eacute; necess&aacute;rio.<\/span><\/p><p><span style=\"font-weight: 400\">O Apache &eacute; um servidor muito flex&iacute;vel. Ele tem suporte a mais de 60 m&oacute;dulos diferentes que estendem ainda mais suas funcionalidades. <\/span><\/p><p><span style=\"font-weight: 400\">Al&eacute;m disso, o Apache suporta a personaliza&ccedil;&atilde;o de conex&otilde;es atrav&eacute;s da ferramenta <\/span><a href=\"https:\/\/www.hostinger.com\/br\/tutoriais\/como-localizar-ou-criar-um-arquivo-htaccess\/\"><span style=\"font-weight: 400\">.htaccess<\/span><\/a><span style=\"font-weight: 400\">, enquanto o Nginx n&atilde;o.<\/span><\/p><p><span style=\"font-weight: 400\">Como resultado, Apache &eacute; muito mais flex&iacute;vel e customiz&aacute;vel.<\/span><\/p><figure class=\"wp-block-image size-large\"><a href=\"\/br\/servidor-vps\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" width=\"1024\" height=\"300\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/53\/2023\/02\/BR-VPS-hosting_in-text-banner-1.png\/public\" alt=\"\" class=\"wp-image-32923\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/53\/2023\/02\/BR-VPS-hosting_in-text-banner-1.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/53\/2023\/02\/BR-VPS-hosting_in-text-banner-1.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/53\/2023\/02\/BR-VPS-hosting_in-text-banner-1.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/53\/2023\/02\/BR-VPS-hosting_in-text-banner-1.png\/w=768,fit=scale-down 768w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/53\/2023\/02\/BR-VPS-hosting_in-text-banner-1.png\/w=1536,fit=scale-down 1536w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><h2 class=\"wp-block-heading\" id=\"h-apache-vs-nginx-qual-devo-usar\"><b>Apache vs Nginx &ndash; Qual Devo Usar?<\/b><\/h2><p><span style=\"font-weight: 400\">Por fim, tudo depende do que voc&ecirc; precisa. De modo geral, o Apache &eacute; ideal se voc&ecirc; precisa customizar muitas conex&otilde;es. Tamb&eacute;m &eacute; uma boa ideia us&aacute;-lo se voc&ecirc; precisa de bastante documenta&ccedil;&atilde;o. Isso porque o Apache tem mais suporte da comunidade.<\/span><\/p><p><span style=\"font-weight: 400\">De outra forma, se sua VPS receber bastante tr&aacute;fego, &eacute; melhor que voc&ecirc; use o Nginx porque ele se comporta melhor nessa &aacute;rea.<\/span><\/p><p><span style=\"font-weight: 400\">Finalmente, &eacute; poss&iacute;vel usar ambos no mesmo servidor. Essa pr&aacute;tica, embora n&atilde;o t&atilde;o frequente como se pode pensar, &eacute; destinada a diferentes sites. <\/span><\/p><p><span style=\"font-weight: 400\">Alguns requerem mais customiza&ccedil;&atilde;o e usam o Apache. Outros que s&atilde;o acessados por mais visitantes, usam o<\/span> <span style=\"font-weight: 400\">Nginx.<\/span><\/p><p><span style=\"font-weight: 400\">A considera&ccedil;&atilde;o final &eacute; voc&ecirc; precisa colocar na balan&ccedil;a<\/span> <span style=\"font-weight: 400\">o que &eacute; melhor para voc&ecirc; e fazer a escolha certa.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Para garantir que o seu usu&aacute;rio tenha uma boa experi&ecirc;ncia, voc&ecirc; precisa se certificar que seus servidores s&atilde;o r&aacute;pidos. Para isso, h&aacute; muitos programas que voc&ecirc; pode usar. Os mais populares s&atilde;o o Nginx e o Apache. Nesse artigo, voc&ecirc; ir&aacute; encontrar uma compara&ccedil;&atilde;o detalhada entre os dois, que vai ajudar voc&ecirc; a escolher qual [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/br\/tutoriais\/nginx-vs-apache\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":92,"featured_media":15459,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"rank_math_title":"Nginx vs Apache - Qual Servidor Web Usar na Minha VPS?","rank_math_description":"Um comparativo Nginx vs Apache para voc\u00ea aprender qual servidor web \u00e9 mais recomendado para a sua VPS. Saiba tudo!","rank_math_focus_keyword":"nginx vs apache","footnotes":""},"categories":[4915],"tags":[4864,5820,6479,6480],"class_list":["post-15457","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-vps","tag-apache","tag-nginx","tag-nginx-vs-apache","tag-servidores-web"],"hreflangs":[{"locale":"pt-BR","link":"https:\/\/www.hostinger.com\/br\/tutoriais\/nginx-vs-apache","default":1},{"locale":"pt-PT","link":"https:\/\/www.hostinger.com\/pt\/tutoriais\/nginx-vs-apache","default":0}],"acf":[],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/br\/tutoriais\/wp-json\/wp\/v2\/posts\/15457","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/br\/tutoriais\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/br\/tutoriais\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/br\/tutoriais\/wp-json\/wp\/v2\/users\/92"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/br\/tutoriais\/wp-json\/wp\/v2\/comments?post=15457"}],"version-history":[{"count":9,"href":"https:\/\/www.hostinger.com\/br\/tutoriais\/wp-json\/wp\/v2\/posts\/15457\/revisions"}],"predecessor-version":[{"id":45632,"href":"https:\/\/www.hostinger.com\/br\/tutoriais\/wp-json\/wp\/v2\/posts\/15457\/revisions\/45632"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/br\/tutoriais\/wp-json\/wp\/v2\/media\/15459"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/br\/tutoriais\/wp-json\/wp\/v2\/media?parent=15457"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/br\/tutoriais\/wp-json\/wp\/v2\/categories?post=15457"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/br\/tutoriais\/wp-json\/wp\/v2\/tags?post=15457"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}