<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Arquivos lnpp - Remontti</title>
	<atom:link href="https://blog.remontti.com.br/tag/lnpp/feed" rel="self" type="application/rss+xml" />
	<link>https://blog.remontti.com.br/tag/lnpp</link>
	<description>rudimar@remontti</description>
	<lastBuildDate>Mon, 29 Aug 2022 15:17:04 +0000</lastBuildDate>
	<language>pt-BR</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://blog.remontti.com.br/wp-content/uploads/2024/09/icone-rr-80x80.png</url>
	<title>Arquivos lnpp - Remontti</title>
	<link>https://blog.remontti.com.br/tag/lnpp</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Servidor WEB NGINX + PHP + PostgreSQL + phpPgAdmin + Letsencrypt no Debian 11 Bullseye (LNPP)</title>
		<link>https://blog.remontti.com.br/5915</link>
					<comments>https://blog.remontti.com.br/5915#comments</comments>
		
		<dc:creator><![CDATA[Rudimar Remontti]]></dc:creator>
		<pubDate>Wed, 20 Oct 2021 18:45:33 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutoriais]]></category>
		<category><![CDATA[7.4]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[Bullseye]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[debian 11]]></category>
		<category><![CDATA[lnpp]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php7]]></category>
		<category><![CDATA[postgresql]]></category>
		<guid isPermaLink="false">https://blog.remontti.com.br/?p=5915</guid>

					<description><![CDATA[<p>Neste tutorial vamos configurar um servidor web com NGINX (lê-se “engine x”), o concorrente do Apache. NGINX é um servidor web (HTTP e IMAP/POP3/Proxy) rápido, leve e com inúmeras possibilidades de configuração para melhor&#46;&#46;&#46;</p>
<p>O post <a href="https://blog.remontti.com.br/5915">Servidor WEB NGINX + PHP + PostgreSQL + phpPgAdmin + Letsencrypt no Debian 11 Bullseye (LNPP)</a> apareceu primeiro em <a href="https://blog.remontti.com.br">Remontti</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><img fetchpriority="high" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2021/10/NGINX-LNNP_DEB_11.png" alt="" width="720" height="340" class="alignnone size-full wp-image-5927" srcset="https://blog.remontti.com.br/wp-content/uploads/2021/10/NGINX-LNNP_DEB_11.png 720w, https://blog.remontti.com.br/wp-content/uploads/2021/10/NGINX-LNNP_DEB_11-300x142.png 300w, https://blog.remontti.com.br/wp-content/uploads/2021/10/NGINX-LNNP_DEB_11-520x245.png 520w" sizes="(max-width: 720px) 100vw, 720px" /><br />
Neste tutorial vamos configurar um servidor web com NGINX (lê-se “engine x”), o concorrente do Apache. NGINX é um servidor web (HTTP e IMAP/POP3/Proxy) rápido, leve e com inúmeras possibilidades de configuração para melhor performance. O Apache, sem dúvidas, é o servidor web mais popular. No entanto, o NGINX a cada ano ganha mais popularidade e está sendo a preferência dos novos projetos. Também estarei instalando o banco de dados PostgreSQL e phpPgAdmin como gerenciador web. </p>
<p>Distribuição utilizada: <strong><a href="https://blog.remontti.com.br/5792" rel="noopener noreferrer" target="_blank">Debian 11 Bullseye / Instalação Limpa</a></strong></p>
<h3>NGINX 1.18</h3>
<p><a href="https://www.nginx.com" rel="noopener" target="_blank">https://www.nginx.com</a></p>
<pre class="remontti-code"># apt install nginx</pre>
<p>Acesse agora em seu navegador http://IP-SERVIDOR/<br />
<img decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2021/04/nginx1.png" alt="" width="1100" height="310" class="alignnone size-full wp-image-5467" srcset="https://blog.remontti.com.br/wp-content/uploads/2021/04/nginx1.png 1100w, https://blog.remontti.com.br/wp-content/uploads/2021/04/nginx1-300x85.png 300w, https://blog.remontti.com.br/wp-content/uploads/2021/04/nginx1-1024x289.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2021/04/nginx1-768x216.png 768w" sizes="(max-width: 1100px) 100vw, 1100px" /><br />
Se você acessar um diretório que não existe um erro dizendo que não existe, e junto informações que não é legal aparecer.<br />
<img decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2021/04/nginx2.png" alt="" width="1036" height="296" class="alignnone size-full wp-image-5468" srcset="https://blog.remontti.com.br/wp-content/uploads/2021/04/nginx2.png 1036w, https://blog.remontti.com.br/wp-content/uploads/2021/04/nginx2-300x86.png 300w, https://blog.remontti.com.br/wp-content/uploads/2021/04/nginx2-1024x293.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2021/04/nginx2-768x219.png 768w" sizes="(max-width: 1036px) 100vw, 1036px" /><br />
Vamos remover assinatura do nginx onde ele exibe a versão do mesmo. Ninguém precisa saber! Correto?</p>
<pre class="remontti-code"># sed -i &#039;s/# server_tokens/server_tokens/&#039; /etc/nginx/nginx.conf
# systemctl restart nginx</pre>
<p><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2021/04/nginx3.png" alt="" width="712" height="157" class="alignnone size-full wp-image-5469" srcset="https://blog.remontti.com.br/wp-content/uploads/2021/04/nginx3.png 712w, https://blog.remontti.com.br/wp-content/uploads/2021/04/nginx3-300x66.png 300w" sizes="auto, (max-width: 712px) 100vw, 712px" /></p>
<p>Pronto nosso NGINX está rodando! </p>
<h3>PostgreSQL</h3>
<pre class="remontti-code"># apt install postgresql postgresql-contrib</pre>
<p>Torne-se o usuário postgres, para poder criar o banco de dados.</p>
<pre class="remontti-code"># su - postgres</pre>
<p>Execute para entrar no terminal de comandos do banco.</p>
<pre class="remontti-code">$ psql</pre>
<p>Para definir a senha do usuário postgres e instalar o adminpack.</p>
<pre class="remontti-code">postgres=# \password postgres
Digite nova senha para postgres: 
Digite-a novamente:
postgres=# CREATE EXTENSION adminpack;
CREATE EXTENSION
postgres=# \q 
$ exit</pre>
<p>Ajustes no pg_hba.conf, assim toda alteração será necessaria validação do postgres com a senha que acabou de definir.</p>
<pre class="remontti-code"># vim /etc/postgresql/13/main/pg_hba.conf</pre>
<p>Altere as seguintes linhas: </p>
<pre class="remontti-code">local   all             postgres                                peer
local   all             all                                     peer</pre>
<p>Para:</p>
<pre class="remontti-code">local   all             postgres                                md5
local   all             all                                     md5</pre>
<p><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2021/04/postgres.png" alt="" width="1010" height="268" class="alignnone size-full wp-image-5501" srcset="https://blog.remontti.com.br/wp-content/uploads/2021/04/postgres.png 1010w, https://blog.remontti.com.br/wp-content/uploads/2021/04/postgres-300x80.png 300w, https://blog.remontti.com.br/wp-content/uploads/2021/04/postgres-768x204.png 768w" sizes="auto, (max-width: 1010px) 100vw, 1010px" /><br />
Reinicie o postgres</p>
<pre class="remontti-code"># systemctl restart postgresql</pre>
<p>Volte para o postgres</p>
<pre class="remontti-code"># su - postgres</pre>
<p>Agora para toda ação será necessário autenticar.</p>
<pre class="remontti-code">$ psql 
Senha para usuário postgres: !!SUA_SENHA!!
psql (13.4 (Debian 13.4-0+deb11u1))
Type &quot;help&quot; for help.
postgres-# \q</pre>
<p>Para demonstração irei criar um banco/usuário teste, não esqueça de alterar a senha.</p>
<pre class="remontti-code">$ createuser --pwprompt teste
Digite a senha para a nova role: &lt;&lt; NOVA SENHA PARA O USUÁRIO TESTE
Digite-a novamente: &lt;&lt; REPITA
Senha: &lt;&lt; SENHA DO QUE SETOU ANTES  NO COMANDO &quot;\password postgres&quot;</pre>
<p>Agora crie o  banco e vincule ao usuário.</p>
<pre class="remontti-code">$ createdb -O teste meubd
Senha: &lt;&lt;&lt; SENHA DO POSTGRES </pre>
<p>Verifique se o mesmo foi criado.</p>
<pre class="remontti-code">$ psql -l 
Senha para usuário postgres: 
                               Lista dos bancos de dados
   Nome    |   Dono   | Codificação |   Collate   |    Ctype    | Privilégios de acesso 
-----------+----------+-------------+-------------+-------------+-----------------------
 meubd     | teste    | UTF8        | pt_BR.UTF-8 | pt_BR.UTF-8 | 
....
....</pre>
<p>Acessamos agora o bd teste.</p>
<pre class="remontti-code">$ psql -U teste -d meubd
Senha para usuário postgres: 
psql (11.11 (Debian 11.11-0+deb10u1))
Digite &quot;help&quot; para ajuda.

meubd=&gt;</pre>
<p>Vamos fazer uma "brincadeira" só para testar, criaremos uma tabela e inseriremos dados nela.</p>
<pre class="remontti-code">meubd=&gt; CREATE TABLE doacao ( id int,nome text, valor text );
meubd=&gt; INSERT INTO doacao (id,nome,valor) values (1,&#039;Rudimar Remontti&#039;,&#039;R$ 5,00&#039;); 
meubd=&gt; SELECT * FROM doacao;

 id |       nome       |  valor  
----+------------------+---------
  1 | Rudimar Remontti | R$ 5,00

meubd=&gt; \q</pre>
<p>Se deseja remover o banco/usuário teste.</p>
<pre class="remontti-code">$ dropdb meubd
Senha: &lt;&lt; SENHA DO POSTGRES
$ dropuser teste
Senha: &lt;&lt; SENHA DO POSTGRES</pre>
<p>Volte para root</p>
<pre class="remontti-code">$ exit</pre>
<h3>PHP 7.4</h3>
<p>Incluirei algumas extensões do PHP que são normalmente utilizada também na instalação.</p>
<pre class="remontti-code"># apt install php php-{fpm,cli,mysql,pear,gd,gmp,bcmath,mbstring,curl,xml,zip,json,pgsql}</pre>
<p>Agora vamos fazer a "integração" do PHP com o NGINX. Moveremos o arquivo defaul.</p>
<pre class="remontti-code"># mv /etc/nginx/sites-available/default /etc/nginx/sites-available/default.original</pre>
<p>Crie um novo:</p>
<pre class="remontti-code"># vim /etc/nginx/sites-available/default</pre>
<p>Ajuste:</p>
<pre class="remontti-code">server {
    listen 80;
    listen [::]:80;

    root /var/www/html;
    index index.php index.html index.htm;

    server_name _;

    location / {
        try_files $uri $uri/ =404;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
    }
}</pre>
<p>Teste a configuração se não tem nada errado e restart os serviços:</p>
<pre class="remontti-code"># nginx -t
# systemctl restart nginx php7.4-fpm</pre>
<p>Vamos criar um arquivo em PHP para testa se nosso NGINX está interpretando o PHP.</p>
<pre class="remontti-code"># echo &#039;&lt;?php phpinfo();&#039; &gt;&gt; /var/www/html/teste.php</pre>
<p>Acesse em seu navegador <strong>http://IP-SERVIDOR/teste.php</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2021/10/php7.4_nginx.png" data-rel="lightbox-gallery-2a71KAZW" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2021/10/php7.4_nginx-300x279.png" alt="" width="300" height="279" class="alignnone size-medium wp-image-5921" srcset="https://blog.remontti.com.br/wp-content/uploads/2021/10/php7.4_nginx-300x279.png 300w, https://blog.remontti.com.br/wp-content/uploads/2021/10/php7.4_nginx-768x713.png 768w, https://blog.remontti.com.br/wp-content/uploads/2021/10/php7.4_nginx.png 958w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a><br />
<img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Nosso servidor WEB com PHP está funcionando! </p>
<p>Exemplo para multiplos domínios/subdomínios </p>
<pre class="remontti-code"># vim /etc/nginx/sites-available/sub1.conf</pre>
<p>Neste ex: vou representar o <em>sub1.remontti.com.br</em></p>
<pre class="remontti-code">server {
    listen 80;
    listen [::]:80;

    root /var/www/sub1;
    index index.php index.html index.htm;

    add_header Strict-Transport-Security &quot;max-age=31536000; includeSubDomains&quot; always;

    server_name sub1.remontti.com.br;

    location / {
        try_files $uri $uri/ =404;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
    }
}</pre>
<pre class="remontti-code"># vim /etc/nginx/sites-available/sub2e3.conf</pre>
<p>Neste ex: vou representar o <em>sub2.remontti.com.br</em> e <em>sub3.remontti.com.br</em></p>
<pre class="remontti-code">server {
    listen 80;
    listen [::]:80;

    root /var/www/sub2e3;
    index index.php index.html index.htm;

    server_name sub2.remontti.com.br sub3.remontti.com.br;

    add_header Strict-Transport-Security &quot;max-age=31536000; includeSubDomains&quot; always;

    location / {
        try_files $uri $uri/ =404;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
    }
}</pre>
<p>Link os arquivos no diretório "/etc/nginx/sites-available"  que será carregado as novas configurações </p>
<pre class="remontti-code"># ln -s /etc/nginx/sites-available/sub1.conf /etc/nginx/sites-enabled/
# ln -s /etc/nginx/sites-available/sub2e3.conf /etc/nginx/sites-enabled/</pre>
<p>Crie os diretórios referente a cada <strong>server_name</strong>.</p>
<pre class="remontti-code"># mkdir /var/www/sub1
# mkdir /var/www/sub2e3
# echo &#039;&lt;?php echo &quot;Olá mundo do sub1!&quot;; ?&gt;&#039; &gt;&gt; /var/www/sub1/index.php
# echo &#039;&lt;?php echo &quot;Olá mundo do sub2e3!&quot;; ?&gt;&#039; &gt;&gt; /var/www/sub2e3/index.php
</pre>
<p>Verifique se não tem nenhum erro e reinicie o serviço:</p>
<pre class="remontti-code"># nginx -t
# systemctl restart nginx</pre>
<h3>phpPgAdmin</h3>
<p>O phppgadmin finalmente foiu atualizado para uma versão recente no repositório então iremos insta-lo via apt.</p>
<pre class="remontti-code"># apt install phppgadmin </pre>
<p>Ajustes no config.inc.php</p>
<pre class="remontti-code"># vim /usr/share/phppgadmin/conf/config.inc.php</pre>
<p>Localize as linhas e ajuste:</p>
<pre class="remontti-code">$conf[&#039;extra_login_security&#039;] = false;
$conf[&#039;owned_only&#039;] = true;</pre>
<p>Para torna-lo acessível altere o arquivo de configuração do seu NGINX, no exemplo vou colocar no arquivo default, mas você poderia estar configurando em seus domínios. </p>
<pre class="remontti-code"># vim /etc/nginx/sites-available/default</pre>
<p>Adicione as linhas destacadas:</p>
<pre class="remontti-code">server {
    listen 80;
    listen [::]:80;

    root /var/www/html;
    index index.php index.html index.htm;

    add_header Strict-Transport-Security &quot;max-age=31536000; includeSubDomains&quot; always;

    server_name _;

    location / {
        try_files $uri $uri/ =404;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
    }

    location ^~ /phppgadmin {
        root /usr/share;
        try_files $uri $uri/ =404;

        #allow  192.168.87.0/24;
        #allow  2001:0db8::/32;
        #deny   all;
        #error_page  403   http://www.remontti.com.br;

        location ~ .php$ {
            include snippets/fastcgi-php.conf;
            fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
        }

    }

}</pre>
<p>Se deseja tonar o phppgadmin acessível apenas de alguns endereços IPs (RECOMENDO) basta descomentar as linhas, e incluir seus prefixos. O error_page é para que quando a o acessante levar um proibido seja direcionado para um site.</p>
<pre class="remontti-code">allow  192.168.87.0/24;
allow  2001:0db8::/32;
deny   all;
error_page  403   http://www.remontti.com.br;</pre>
<p>Verifique se não tem nenhum erro e reinicie o serviço:</p>
<pre class="remontti-code"># nginx -t
# systemctl restart nginx</pre>
<p>Basta acessar <strong>http://IP-SERVIDOR/phppgadmin</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2021/10/phppgadmin.png" data-rel="lightbox-gallery-2a71KAZW" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2021/10/phppgadmin-300x144.png" alt="" width="300" height="144" class="alignnone size-medium wp-image-5925" srcset="https://blog.remontti.com.br/wp-content/uploads/2021/10/phppgadmin-300x144.png 300w, https://blog.remontti.com.br/wp-content/uploads/2021/10/phppgadmin-768x369.png 768w, https://blog.remontti.com.br/wp-content/uploads/2021/10/phppgadmin.png 955w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<h3>:: Let's Encrypt ::</h3>
<p>Criando certificado grátis para seus sub/domínios.</p>
<pre class="remontti-code"># apt install certbot python3-certbot-nginx</pre>
<p>Para gerar o certificado use o comando:</p>
<pre class="remontti-code"># certbot</pre>
<p>Não esqueça de colocar no seu cron para ele renovar o certificado, pois a cada 90 ele expira. Neste exemplo todo dia primeiro tento renovar.</p>
<pre class="remontti-code"># certbot -q renew</pre>
<p>Dica, se desejar desativar o TLS1.0 e TLS1.1 após criar um certificado um arquivo é criado /etc/letsencrypt/options-ssl-apache.conf, então edite e inclua no SSLProtocol TLSv1 -TLSv1.1</p>
<pre class="remontti-code"># vim /etc/letsencrypt/options-ssl-nginx.conf</pre>
<p>Ficando</p>
<pre class="remontti-code">#ssl_protocols            all -SSLv2 -SSLv3
ssl_protocols             all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1</pre>
<p>Reinicie o Neginx:</p>
<pre class="remontti-code"># systemctl restart nginx</pre>
<p>Para testar acesse: <a href="https://www.cdn77.com/tls-test/" rel="noopener" target="_blank">https://www.cdn77.com/tls-test/</a><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2021/10/tls_teste.png" data-rel="lightbox-gallery-2a71KAZW" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2021/10/tls_teste-300x182.png" alt="" width="300" height="182" class="alignnone size-medium wp-image-6158" srcset="https://blog.remontti.com.br/wp-content/uploads/2021/10/tls_teste-300x182.png 300w, https://blog.remontti.com.br/wp-content/uploads/2021/10/tls_teste-1024x620.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2021/10/tls_teste-768x465.png 768w, https://blog.remontti.com.br/wp-content/uploads/2021/10/tls_teste.png 1099w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>Gostou?</p>
<p><strong>Se quiser fazer uma doação para o café ficarei muito feliz pelo seu reconhecimento!</strong><br />
<a href="https://blog.remontti.com.br/doar"><img decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/quero-doar-remontti.png" /></a><br />
Se não puder doar pode deixar seu agradecimento nos comentário também ficarei feliz em saber que ajudei. Se tiver qualquer pergunta deixe-a também. Se preferir entrar em Contato <a href="https://blog.remontti.com.br/meucontato" rel="noopener noreferrer" target="_blank">clique aqui.</a></p>
<p><strong>Fontes:</strong> <a href="https://docs.nginx.com/" rel="noopener" target="_blank">https://docs.nginx.com/</a><br />
<a href="https://docs.nginx.com/nginx/admin-guide/web-server/web-server/" rel="noopener" target="_blank">https://docs.nginx.com/nginx/admin-guide/web-server/web-server/</a></p>
<p>O post <a href="https://blog.remontti.com.br/5915">Servidor WEB NGINX + PHP + PostgreSQL + phpPgAdmin + Letsencrypt no Debian 11 Bullseye (LNPP)</a> apareceu primeiro em <a href="https://blog.remontti.com.br">Remontti</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.remontti.com.br/5915/feed</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
			</item>
		<item>
		<title>Servidor WEB NGINX + PHP + PostgreSQL + phpPgAdmin + Letsencrypt no Debian 10 Buster (LNPP)</title>
		<link>https://blog.remontti.com.br/5487</link>
					<comments>https://blog.remontti.com.br/5487#comments</comments>
		
		<dc:creator><![CDATA[Rudimar Remontti]]></dc:creator>
		<pubDate>Wed, 07 Apr 2021 20:56:22 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutoriais]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[buster]]></category>
		<category><![CDATA[certificado]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[debian 10]]></category>
		<category><![CDATA[lamp]]></category>
		<category><![CDATA[letsencrypt]]></category>
		<category><![CDATA[LNMP]]></category>
		<category><![CDATA[lnpp]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[pgadmin]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php-fpm]]></category>
		<category><![CDATA[phpMyAdmin]]></category>
		<category><![CDATA[phppgadmin]]></category>
		<category><![CDATA[postgres]]></category>
		<category><![CDATA[postgresql]]></category>
		<guid isPermaLink="false">https://blog.remontti.com.br/?p=5487</guid>

					<description><![CDATA[<p>Neste tutorial vamos configurar um servidor web com NGINX (lê-se “engine x”), o concorrente do Apache. NGINX é um servidor web (HTTP e IMAP/POP3/Proxy) rápido, leve e com inúmeras possibilidades de configuração para melhor&#46;&#46;&#46;</p>
<p>O post <a href="https://blog.remontti.com.br/5487">Servidor WEB NGINX + PHP + PostgreSQL + phpPgAdmin + Letsencrypt no Debian 10 Buster (LNPP)</a> apareceu primeiro em <a href="https://blog.remontti.com.br">Remontti</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2021/04/NGINX-LNNP.png" alt="" width="720" height="340" class="alignnone size-full wp-image-5514" srcset="https://blog.remontti.com.br/wp-content/uploads/2021/04/NGINX-LNNP.png 720w, https://blog.remontti.com.br/wp-content/uploads/2021/04/NGINX-LNNP-300x142.png 300w, https://blog.remontti.com.br/wp-content/uploads/2021/04/NGINX-LNNP-520x245.png 520w" sizes="auto, (max-width: 720px) 100vw, 720px" /><br />
Neste tutorial vamos configurar um servidor web com NGINX (lê-se “engine x”), o concorrente do Apache. NGINX é um servidor web (HTTP e IMAP/POP3/Proxy) rápido, leve e com inúmeras possibilidades de configuração para melhor performance. O Apache, sem dúvidas, é o servidor web mais popular. No entanto, o NGINX a cada ano ganha mais popularidade e está sendo a preferência dos novos projetos. Também estarei instalando o banco de dados PostgreSQL e phpPgAdmin como gerenciador web. </p>
<p>Distribuição utilizada: <strong><a href="https://blog.remontti.com.br/2966" rel="noopener noreferrer" target="_blank">Debian 10 Stretch / Instalação Limpa</a></strong></p>
<h3>NGINX</h3>
<p><a href="https://www.nginx.com" rel="noopener" target="_blank">https://www.nginx.com</a></p>
<pre class="remontti-code"># apt install nginx</pre>
<p>Acesse agora em seu navegador http://IP-SERVIDOR/<br />
<img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2021/04/nginx1.png" alt="" width="1100" height="310" class="alignnone size-full wp-image-5467" srcset="https://blog.remontti.com.br/wp-content/uploads/2021/04/nginx1.png 1100w, https://blog.remontti.com.br/wp-content/uploads/2021/04/nginx1-300x85.png 300w, https://blog.remontti.com.br/wp-content/uploads/2021/04/nginx1-1024x289.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2021/04/nginx1-768x216.png 768w" sizes="auto, (max-width: 1100px) 100vw, 1100px" /><br />
Se você acessar um diretório que não existe um erro dizendo que não existe, e junto informações que não é legal aparecer.<br />
<img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2021/04/nginx2.png" alt="" width="1036" height="296" class="alignnone size-full wp-image-5468" srcset="https://blog.remontti.com.br/wp-content/uploads/2021/04/nginx2.png 1036w, https://blog.remontti.com.br/wp-content/uploads/2021/04/nginx2-300x86.png 300w, https://blog.remontti.com.br/wp-content/uploads/2021/04/nginx2-1024x293.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2021/04/nginx2-768x219.png 768w" sizes="auto, (max-width: 1036px) 100vw, 1036px" /><br />
Vamos remover assinatura do nginx onde ele exibe a versão do mesmo. Ninguém precisa saber! Correto?</p>
<pre class="remontti-code"># sed -i &#039;s/# server_tokens/server_tokens/&#039; /etc/nginx/nginx.conf
# systemctl restart nginx</pre>
<p><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2021/04/nginx3.png" alt="" width="712" height="157" class="alignnone size-full wp-image-5469" srcset="https://blog.remontti.com.br/wp-content/uploads/2021/04/nginx3.png 712w, https://blog.remontti.com.br/wp-content/uploads/2021/04/nginx3-300x66.png 300w" sizes="auto, (max-width: 712px) 100vw, 712px" /></p>
<p>Pronto nosso NGINX está rodando! </p>
<h3>PostgreSQL</h3>
<pre class="remontti-code"># apt install postgresql postgresql-contrib</pre>
<p>Torne-se o usuário postgres, para poder criar o banco de dados.</p>
<pre class="remontti-code"># su - postgres</pre>
<p>Execute para entrar no terminal de comandos do banco.</p>
<pre class="remontti-code">$ psql</pre>
<p>Para definir a senha do usuário postgres e instalar o adminpack.</p>
<pre class="remontti-code">postgres=# \password postgres
Digite nova senha para postgres: 
Digite-a novamente:
postgres=# CREATE EXTENSION adminpack;
CREATE EXTENSION
postgres=# \q 
$ exit</pre>
<p>Ajustes no pg_hba.conf, assim toda alteração será necessaria validação do postgres com a senha que acabou de definir.</p>
<pre class="remontti-code"># vim /etc/postgresql/11/main/pg_hba.conf</pre>
<p>Altere as seguintes linhas: </p>
<pre class="remontti-code">local   all             postgres                                peer
local   all             all                                     peer</pre>
<p>Para:</p>
<pre class="remontti-code">local   all             postgres                                md5
local   all             all                                     md5</pre>
<p><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2021/04/postgres.png" alt="" width="1010" height="268" class="alignnone size-full wp-image-5501" srcset="https://blog.remontti.com.br/wp-content/uploads/2021/04/postgres.png 1010w, https://blog.remontti.com.br/wp-content/uploads/2021/04/postgres-300x80.png 300w, https://blog.remontti.com.br/wp-content/uploads/2021/04/postgres-768x204.png 768w" sizes="auto, (max-width: 1010px) 100vw, 1010px" /><br />
Reinicie o postgres</p>
<pre class="remontti-code"># systemctl restart postgresql</pre>
<p>Volte para o postgres</p>
<pre class="remontti-code"># su - postgres</pre>
<p>Agora para toda ação será necessário autenticar.</p>
<pre class="remontti-code">$ psql 
Senha para usuário postgres: !!SUA_SENHA!!
psql (11.11 (Debian 11.11-0+deb10u1))
Digite &quot;help&quot; para ajuda.
postgres-# \q</pre>
<p>Para demonstração irei criar um banco/usuário teste, não esqueça de alterar a senha.</p>
<pre class="remontti-code">$ createuser --pwprompt teste
Digite a senha para a nova role: &lt;&lt; NOVA SENHA PARA O USUÁRIO TESTE
Digite-a novamente: &lt;&lt; REPITA
Senha: &lt;&lt; SENHA DO QUE SETOU ANTES  NO COMANDO &quot;\password postgres&quot;</pre>
<p>Agora crie o  banco e vincule ao usuário.</p>
<pre class="remontti-code">$ createdb -O teste meubd
Senha: &lt;&lt;&lt; SENHA DO POSTGRES </pre>
<p>Verifique se o mesmo foi criado.</p>
<pre class="remontti-code">$ psql -l 
Senha para usuário postgres: 
                               Lista dos bancos de dados
   Nome    |   Dono   | Codificação |   Collate   |    Ctype    | Privilégios de acesso 
-----------+----------+-------------+-------------+-------------+-----------------------
 meubd     | teste    | UTF8        | pt_BR.UTF-8 | pt_BR.UTF-8 | 
....
....</pre>
<p>Acessamos agora o bd teste.</p>
<pre class="remontti-code">$ psql -U teste -d meubd
Senha para usuário postgres: 
psql (11.11 (Debian 11.11-0+deb10u1))
Digite &quot;help&quot; para ajuda.

meubd=&gt;</pre>
<p>Vamos fazer uma "brincadeira" só para testar, criaremos uma tabela e inseriremos dados nela.</p>
<pre class="remontti-code">meubd=&gt; CREATE TABLE doacao ( id int,nome text, valor text );
meubd=&gt; INSERT INTO doacao (id,nome,valor) values (1,&#039;Rudimar Remontti&#039;,&#039;R$ 5,00&#039;); 
meubd=&gt; SELECT * FROM doacao;

 id |       nome       |  valor  
----+------------------+---------
  1 | Rudimar Remontti | R$ 5,00

meubd=&gt; \q</pre>
<p>Se deseja remover o banco/usuário teste.</p>
<pre class="remontti-code">$ dropdb meubd
$ dropuser teste</pre>
<p>Volte para root</p>
<pre class="remontti-code">$ exit</pre>
<h3>PHP7</h3>
<p>Incluirei algumas extensões do PHP que são normalmente utilizada também na instalação.</p>
<pre class="remontti-code"># apt install php php-{fpm,cli,mysql,pear,gd,gmp,bcmath,mbstring,curl,xml,zip,json,pgsql}</pre>
<p>Agora vamos fazer a "integração" do PHP com o NGINX. Moveremos o arquivo defaul.</p>
<pre class="remontti-code"># mv /etc/nginx/sites-available/default /etc/nginx/sites-available/default.original</pre>
<p>Crie um novo:</p>
<pre class="remontti-code"># vim /etc/nginx/sites-available/default</pre>
<p>Ajuste:</p>
<pre class="remontti-code">server {
    listen 80;
    listen [::]:80;

    root /var/www/html;
    index index.php index.html index.htm;

    server_name _;

    location / {
        try_files $uri $uri/ =404;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
    }
}</pre>
<p>Teste a configuração se não tem nada errado e restart os serviços:</p>
<pre class="remontti-code"># nginx -t
# systemctl restart nginx php7.3-fpm</pre>
<p>Vamos criar um arquivo em PHP para testa se nosso NGINX está interpretando o PHP.</p>
<pre class="remontti-code"># echo &#039;&lt;?php phpinfo();&#039; &gt;&gt; /var/www/html/teste.php</pre>
<p>Acesse em seu navegador http://IP-SERVIDOR/teste.php<br />
<img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2021/04/nginx-php7.png" alt="" width="1173" height="899" class="alignnone size-full wp-image-5473" srcset="https://blog.remontti.com.br/wp-content/uploads/2021/04/nginx-php7.png 1173w, https://blog.remontti.com.br/wp-content/uploads/2021/04/nginx-php7-300x230.png 300w, https://blog.remontti.com.br/wp-content/uploads/2021/04/nginx-php7-1024x785.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2021/04/nginx-php7-768x589.png 768w" sizes="auto, (max-width: 1173px) 100vw, 1173px" /><br />
<img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Nosso servidor WEB com PHP está funcionando! </p>
<p>Exemplo para multiplos domínios/subdomínios </p>
<pre class="remontti-code"># vim /etc/nginx/sites-available/sub1.conf</pre>
<p>Neste ex: vou representar o <em>sub1.remontti.com.br</em></p>
<pre class="remontti-code">server {
    listen 80;
    listen [::]:80;

    root /var/www/sub1;
    index index.php index.html index.htm;

    server_name sub1.remontti.com.br;

    location / {
        try_files $uri $uri/ =404;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
    }
}</pre>
<pre class="remontti-code"># vim /etc/nginx/sites-available/sub2e3.conf</pre>
<p>Neste ex: vou representar o <em>sub2.remontti.com.br</em> e <em>sub3.remontti.com.br</em></p>
<pre class="remontti-code">server {
    listen 80;
    listen [::]:80;

    root /var/www/sub2e3;
    index index.php index.html index.htm;

    server_name sub2.remontti.com.br sub3.remontti.com.br;

    location / {
        try_files $uri $uri/ =404;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
    }
}</pre>
<p>Link os arquivos no diretório "/etc/nginx/sites-available"  que será carregado as novas configurações </p>
<pre class="remontti-code"># ln -s /etc/nginx/sites-available/sub1.conf /etc/nginx/sites-enabled/
# ln -s /etc/nginx/sites-available/sub2e3.conf /etc/nginx/sites-enabled/</pre>
<p>Crie os diretórios referente a cada <strong>server_name</strong>.</p>
<pre class="remontti-code"># mkdir /var/www/sub1
# mkdir /var/www/sub2e3
# echo &#039;&lt;?php echo &quot;Olá mundo do sub1!&quot;; ?&gt;&#039; &gt;&gt; /var/www/sub1/index.php
# echo &#039;&lt;?php echo &quot;Olá mundo do sub2e3!&quot;; ?&gt;&#039; &gt;&gt; /var/www/sub2e3/index.php
</pre>
<p>Verifique se não tem nenhum erro e reinicie o serviço:</p>
<pre class="remontti-code"># nginx -t
# systemctl restart nginx</pre>
<h3>phpPgAdmin</h3>
<p>O phppgadmin até pode ser instalado via apt, porém seu empacotamento esta na versão 5, vou baixar a versão mais recente direta do <a href="https://github.com/phppgadmin/phppgadmin/releases" rel="noopener" target="_blank">https://github.com/phppgadmin/phppgadmin/releases</a> hoje (abril 2021) na versão 7.13.0</p>
<pre class="remontti-code"># apt install wget 
# cd /tmp/
# wget https://github.com/phppgadmin/phppgadmin/releases/download/REL_7-13-0/phpPgAdmin-7.13.0.tar.gz
# tar vxf phpPgAdmin-7.13.0.tar.gz
# mv /tmp/phpPgAdmin-7.13.0 /usr/share/phppgadmin</pre>
<p>Ajustes no config.inc.php</p>
<pre class="remontti-code"># vim /usr/share/phppgadmin/conf/config.inc.php</pre>
<p>Localize as linhas e ajuste:</p>
<pre class="remontti-code">$conf[&#039;servers&#039;][0][&#039;host&#039;] = &#039;localhost&#039;;
$conf[&#039;extra_login_security&#039;] = false;
$conf[&#039;owned_only&#039;] = true;</pre>
<p>Para torna-lo acessível altere o arquivo de configuração do seu NGINX, no exemplo vou colocar no arquivo default, mas você poderia estar configurando em seus domínios. </p>
<pre class="remontti-code"># vim /etc/nginx/sites-available/default</pre>
<p>Adicione as linhas destacadas:</p>
<pre class="remontti-code">server {
    listen 80;
    listen [::]:80;

    root /var/www/html;
    index index.php index.html index.htm;

    server_name _;

    location / {
        try_files $uri $uri/ =404;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
    }

    location ^~ /phppgadmin {
        root /usr/share;
        try_files $uri $uri/ =404;

        #allow  192.168.87.0/24;
        #allow  2001:0db8::/32;
        #deny   all;
        #error_page  403   http://www.remontti.com.br;

        location ~ .php$ {
            include snippets/fastcgi-php.conf;
            fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
        }

    }

}</pre>
<p>Se deseja tonar o phppgadmin acessível apenas de alguns endereços IPs (RECOMENDO) basta descomentar as linhas, e incluir seus prefixos. O error_page é para que quando a o acessante levar um proibido seja direcionado para um site.</p>
<pre class="remontti-code">allow  192.168.87.0/24;
allow  2001:0db8::/32;
deny   all;
error_page  403   http://www.remontti.com.br;</pre>
<p>Verifique se não tem nenhum erro e reinicie o serviço:</p>
<pre class="remontti-code"># nginx -t
# systemctl restart nginx</pre>
<p>Basta acessar http://IP-SERVIDOR/phppgadmin<br />
<img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2021/04/phppgadmin7.png" alt="" width="1033" height="340" class="alignnone size-full wp-image-5495" srcset="https://blog.remontti.com.br/wp-content/uploads/2021/04/phppgadmin7.png 1033w, https://blog.remontti.com.br/wp-content/uploads/2021/04/phppgadmin7-300x99.png 300w, https://blog.remontti.com.br/wp-content/uploads/2021/04/phppgadmin7-1024x337.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2021/04/phppgadmin7-768x253.png 768w" sizes="auto, (max-width: 1033px) 100vw, 1033px" /><br />
<img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2021/04/postgres2.png" alt="" width="1401" height="576" class="alignnone size-full wp-image-5511" srcset="https://blog.remontti.com.br/wp-content/uploads/2021/04/postgres2.png 1401w, https://blog.remontti.com.br/wp-content/uploads/2021/04/postgres2-300x123.png 300w, https://blog.remontti.com.br/wp-content/uploads/2021/04/postgres2-1024x421.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2021/04/postgres2-768x316.png 768w" sizes="auto, (max-width: 1401px) 100vw, 1401px" /></p>
<h3>LETSENCRYPT</h3>
<p>Criando certificado valido para nossos domínios.</p>
<pre class="remontti-code"># apt install letsencrypt python-certbot-nginx</pre>
<p>Tenha seu(s) domínio(s) configurado em /etc/nginx/sites-enabled/</p>
<pre class="remontti-code"># letsencrypt</pre>
<p>Retorno do questionário:</p>
<pre class="remontti-code">Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator nginx, Installer nginx
Enter email address (used for urgent renewal and security notices) (Enter &#039;c&#039; to
cancel): dev@null.com

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree in order to register with the ACME server at
https://acme-v02.api.letsencrypt.org/directory
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(A)gree/(C)ancel: A

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing to share your email address with the Electronic Frontier
Foundation, a founding partner of the Let&#039;s Encrypt project and the non-profit
organization that develops Certbot? We&#039;d like to send you email about our work
encrypting the web, EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: N

Which names would you like to activate HTTPS for?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: sub1.remontti.com.br
2: sub2.remontti.com.br   &lt;&lt; CASO VOCÊ TENHA MAIS DE UM SUB CONFIGURADO
3: sub3.remontti.com.br    &lt;&lt; IRÁ APARECER AQUI 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter &#039;c&#039; to cancel): 1 &lt;&lt; ESCOLHA QUAIS VC DESEJA
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for sub1.remontti.com.br
Waiting for verification...
Cleaning up challenges
Deploying Certificate to VirtualHost /etc/nginx/sites-enabled/sub1.conf

Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you&#039;re confident your site works on HTTPS. You can undo this
change by editing your web server&#039;s configuration.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press &#039;c&#039; to cancel): 2 &lt;&lt; SE QUISER FORCAR SEMPRE HTTPS
Redirecting all traffic on port 80 to ssl in /etc/nginx/sites-enabled/sub1.conf

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have successfully enabled
https://sub1.remontti.com.br

You should test your configuration at:
https://www.ssllabs.com/ssltest/analyze.html?d=sub1.remontti.com.br
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/sub1.remontti.com.br/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/sub1.remontti.com.br/privkey.pem
   Your cert will expire on 2021-07-05. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot again
   with the &quot;certonly&quot; option. To non-interactively renew *all* of
   your certificates, run &quot;certbot renew&quot;
 - Your account credentials have been saved in your Certbot
   configuration directory at /etc/letsencrypt. You should make a
   secure backup of this folder now. This configuration directory will
   also contain certificates and private keys obtained by Certbot so
   making regular backups of this folder is ideal.
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let&#039;s Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le
</pre>
<p>Você pode também criar o certificado diretamente para um domínio. </p>
<pre class="remontti-code"># letsencrypt --authenticator standalone --installer nginx -d sub1.remontti.com.br</pre>
<p>Dica, se desejar desativar o TLS1.0 e TLS1.1 após criar um certificado um arquivo é criado /etc/letsencrypt/options-ssl-apache.conf, então edite e inclua no SSLProtocol TLSv1 -TLSv1.1</p>
<pre class="remontti-code"># vim /etc/letsencrypt/options-ssl-apache.conf</pre>
<p>Ficando</p>
<pre class="remontti-code">#SSLProtocol            all -SSLv2 -SSLv3
SSLProtocol             all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1</pre>
<p>Reinicie o Apache:</p>
<pre class="remontti-code"># systemctl restart apache2</pre>
<p>Para testar acesse: <a href="https://www.cdn77.com/tls-test/" rel="noopener" target="_blank">https://www.cdn77.com/tls-test/</a><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2021/10/tls_teste.png" data-rel="lightbox-gallery-XneyNnyp" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2021/10/tls_teste-300x182.png" alt="" width="300" height="182" class="alignnone size-medium wp-image-6158" srcset="https://blog.remontti.com.br/wp-content/uploads/2021/10/tls_teste-300x182.png 300w, https://blog.remontti.com.br/wp-content/uploads/2021/10/tls_teste-1024x620.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2021/10/tls_teste-768x465.png 768w, https://blog.remontti.com.br/wp-content/uploads/2021/10/tls_teste.png 1099w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>Não esqueça de colocar no seu cron para ele renovar o certificado, pois a cada 90 ele expira. Neste exemplo todo dia primeiro tento renovar.</p>
<pre class="remontti-code"># echo &#039;00 00   1 * *   root    /usr/bin/certbot -q renew&#039; &gt;&gt; /etc/crontab
# systemctl restart cron</pre>
<p>Caso não renovar apenas rode o comando letsencrypt novamente. </p>
<p>Gostou?</p>
<p><strong>Se quiser fazer uma doação para o café ficarei muito feliz pelo seu reconhecimento!</strong><br />
<a href="https://blog.remontti.com.br/doar"><img decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/quero-doar-remontti.png" /></a><br />
Se não puder doar pode deixar seu agradecimento nos comentário também ficarei feliz em saber que ajudei. Se tiver qualquer pergunta deixe-a também. Se preferir entrar em Contato <a href="https://blog.remontti.com.br/meucontato" rel="noopener noreferrer" target="_blank">clique aqui.</a></p>
<p><strong>Fontes:</strong> <a href="https://docs.nginx.com/" rel="noopener" target="_blank">https://docs.nginx.com/</a><br />
<a href="https://docs.nginx.com/nginx/admin-guide/web-server/web-server/" rel="noopener" target="_blank">https://docs.nginx.com/nginx/admin-guide/web-server/web-server/</a></p>
<p>O post <a href="https://blog.remontti.com.br/5487">Servidor WEB NGINX + PHP + PostgreSQL + phpPgAdmin + Letsencrypt no Debian 10 Buster (LNPP)</a> apareceu primeiro em <a href="https://blog.remontti.com.br">Remontti</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.remontti.com.br/5487/feed</wfw:commentRss>
			<slash:comments>5</slash:comments>
		
		
			</item>
	</channel>
</rss>
