<?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 apache2 - Remontti</title>
	<atom:link href="https://blog.remontti.com.br/tag/apache2/feed" rel="self" type="application/rss+xml" />
	<link>https://blog.remontti.com.br/tag/apache2</link>
	<description>rudimar@remontti</description>
	<lastBuildDate>Wed, 13 Nov 2024 00:43:24 +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 apache2 - Remontti</title>
	<link>https://blog.remontti.com.br/tag/apache2</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Servidor WEB Apache2 + PHP 8.2 + MariaDB +Let’s Encrypt Debian 12 Bookworm (LAMP)</title>
		<link>https://blog.remontti.com.br/7496</link>
					<comments>https://blog.remontti.com.br/7496#comments</comments>
		
		<dc:creator><![CDATA[Rudimar Remontti]]></dc:creator>
		<pubDate>Sun, 11 Jun 2023 16:40:46 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Administração de banco de dados.]]></category>
		<category><![CDATA[Ambiente de servidor]]></category>
		<category><![CDATA[apache2]]></category>
		<category><![CDATA[Autenticação de servidor]]></category>
		<category><![CDATA[bookworm]]></category>
		<category><![CDATA[Certificado SSL]]></category>
		<category><![CDATA[Configuração do Apache]]></category>
		<category><![CDATA[Configuração do servidor]]></category>
		<category><![CDATA[Debian 12]]></category>
		<category><![CDATA[Desenvolvimento web]]></category>
		<category><![CDATA[Gerenciamento de banco de dados]]></category>
		<category><![CDATA[Hospedagem web]]></category>
		<category><![CDATA[lamp]]></category>
		<category><![CDATA[Let’s Encrypt]]></category>
		<category><![CDATA[MariaDB]]></category>
		<category><![CDATA[PHP 8.2]]></category>
		<category><![CDATA[Proteção de dados]]></category>
		<category><![CDATA[Segurança na web]]></category>
		<category><![CDATA[Servidor WEB]]></category>
		<category><![CDATA[Versão do PHP]]></category>
		<guid isPermaLink="false">https://blog.remontti.com.br/?p=7496</guid>

					<description><![CDATA[<p>Distribuição utilizada: &#8211; Debian 12 Bookworm / Instalação Limpa Acesse seu bash e vire root com o comando su &#8211; para evitar comandos &#8220;que não existem&#8221;, e antes de mais nada tenha seu repositório&#46;&#46;&#46;</p>
<p>O post <a href="https://blog.remontti.com.br/7496">Servidor WEB Apache2 + PHP 8.2 + MariaDB +Let’s Encrypt Debian 12 Bookworm (LAMP)</a> apareceu primeiro em <a href="https://blog.remontti.com.br">Remontti</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><center><a href="https://blog.remontti.com.br/wp-content/uploads/2023/06/lamp_debian_12.jpg" data-rel="lightbox-gallery-qBqOsOSR" data-rl_title="" data-rl_caption="" title=""><img fetchpriority="high" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2023/06/lamp_debian_12.jpg" alt="" width="720" height="340" class="alignnone size-full wp-image-7503" srcset="https://blog.remontti.com.br/wp-content/uploads/2023/06/lamp_debian_12.jpg 720w, https://blog.remontti.com.br/wp-content/uploads/2023/06/lamp_debian_12-300x142.jpg 300w, https://blog.remontti.com.br/wp-content/uploads/2023/06/lamp_debian_12-520x245.jpg 520w" sizes="(max-width: 720px) 100vw, 720px" /></a></center></p>
<p>Distribuição utilizada:<br />
&#8211; <strong><a href="https://blog.remontti.com.br/7236" rel="noopener noreferrer" target="_blank">Debian 12 Bookworm / Instalação Limpa</a></strong></p>
<p>Acesse seu bash e vire root com o comando su &#8211; para evitar comandos &#8220;que não existem&#8221;, e antes de mais nada tenha seu repositório atualizado.</p>
<pre class="remontti-code"># su -
# apt update
# apt upgrade</pre>
<h3>:: Instalação do Apache2 ::</h3>
<pre class="remontti-code"># apt install apache2 apache2-utils -y</pre>
<p>Após a instação, habilitamos o <strong>mod_rewrite</strong> do Apache que é muito utilizado. Este é um módulo que utiliza um mecanismo baseado em regras de reescrita. (phpipa, wordpress todos usam), e o <strong>mod_headers</strong> Este módulo fornece diretivas para controlar e modificar os cabeçalhos de solicitação e resposta HTTP. Comando para habilita-lo:</p>
<pre class="remontti-code"># a2enmod rewrite ; a2enmod headers</pre>
<p>A página que vimos ao abri o ip do nosso servidor no navegador fica no diretório /var/www/html, isso está sendo informado no arquivo default do apache que fica em /etc/apache2/sites-enabled/000-default.conf, e para que nosso mod_rewrite e headers funcione corretamente será necessário adicionar alguma linhas.<br />
O HTTP Strict Transport Security ou HSTS (RFC 6797) é um novo padrão de segurança SSL aprovado recentemente pelo IETF. Ele traz diversas melhorias para o SSL como forçar a utilização do HTTPS impedindo que sites sejam acessados usando o protocolo HTTP ou que partes do código de um site que está usando HTTPS seja executado em servidores usando o HTTP entre outras.</p>
<pre class="remontti-code"># vim /etc/apache2/sites-enabled/000-default.conf</pre>
<p>Adicione abaixo de &#8220;DocumentRoot /var/www/html&#8221; o seguinte:</p>
<pre class="remontti-code">
	Header always set Strict-Transport-Security &quot;max-age=63072000; includeSubDomains&quot;

	&lt;Directory /var/www/html/&gt;
    		Options FollowSymLinks
    		AllowOverride All
	&lt;/Directory&gt;</pre>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2021/10/apache_HSTS.png" data-rel="lightbox-gallery-qBqOsOSR" data-rl_title="" data-rl_caption="" title=""><img decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2021/10/apache_HSTS-300x281.png" alt="" width="300" height="281" class="alignnone size-medium wp-image-6154" srcset="https://blog.remontti.com.br/wp-content/uploads/2021/10/apache_HSTS-300x281.png 300w, https://blog.remontti.com.br/wp-content/uploads/2021/10/apache_HSTS-768x720.png 768w, https://blog.remontti.com.br/wp-content/uploads/2021/10/apache_HSTS.png 1024w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>Para você aprender mais como o apache funciona recomendo: <strong><a href="https://blog.remontti.com.br/3464" rel="noopener" target="_blank">Como ter diversos sub/domínios no mesmo servidor</a></strong></p>
<p>Por segurança remova a assinatura do apache e reinicie o apache2 para que tenha efeito as nossas alterações.</p>
<pre class="remontti-code"># sed -i &#039;s/ServerTokens OS/ServerTokens Prod/&#039; /etc/apache2/conf-available/security.conf
# sed -i &#039;s/ServerSignature On/ServerSignature Off/&#039; /etc/apache2/conf-available/security.conf
# systemctl restart apache2</pre>
<p><strong>http://[SERVER_IP]</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2021/10/apache2.png" data-rel="lightbox-gallery-qBqOsOSR" data-rl_title="" data-rl_caption="" title=""><img decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2021/10/apache2-150x150.png" alt="" width="150" height="150" class="alignnone size-thumbnail wp-image-5897" srcset="https://blog.remontti.com.br/wp-content/uploads/2021/10/apache2-150x150.png 150w, https://blog.remontti.com.br/wp-content/uploads/2021/10/apache2-80x80.png 80w, https://blog.remontti.com.br/wp-content/uploads/2021/10/apache2-320x320.png 320w" sizes="(max-width: 150px) 100vw, 150px" /></a></p>
<h3>:: Instalação do PHP 8.2 ::</h3>
<p>Para instalação do PHP vou incluir algumas extensões que são as mais utilizada, mas seu preferir você pode optar em não instalar, as necessárias são libapache2-mod-php php php-mysql php-cli.</p>
<pre class="remontti-code"># apt install libapache2-mod-php php php-mysql php-cli php-pear php-gmp php-gd php-bcmath php-mbstring php-curl php-xml php-zip -y</pre>
<p>É necessário reiniciar o apache para que o php tenha efeito.</p>
<pre class="remontti-code"># systemctl restart apache2</pre>
<p>Consultado informações de versão:</p>
<pre class="remontti-code"># php --version</pre>
<pre class="remontti-code-plain">
PHP 8.2.7 (cli) (built: Jun  9 2023 19:37:27) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.7, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.7, Copyright (c), by Zend Technologies
</pre>
<p>Você pode criar um arquivo php com a função <a href="https://php.net/manual/pt_BR/function.phpinfo.php" rel="noopener noreferrer" target="_blank">phpinfo()</a> para mostrar todas as informações.</p>
<pre class="remontti-code"># echo &#039;&lt;?php phpinfo(); ?&gt;&#039; &gt; /var/www/html/phpinfo.php</pre>
<p><strong>http://[SERVER_IP]/phpinfo.php</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2023/06/debian12_php8.2.png" data-rel="lightbox-gallery-qBqOsOSR" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2023/06/debian12_php8.2-300x292.png" alt="" width="300" height="292" class="alignnone size-medium wp-image-7417" srcset="https://blog.remontti.com.br/wp-content/uploads/2023/06/debian12_php8.2-300x292.png 300w, https://blog.remontti.com.br/wp-content/uploads/2023/06/debian12_php8.2-768x748.png 768w, https://blog.remontti.com.br/wp-content/uploads/2023/06/debian12_php8.2.png 950w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<h3>:: Instalação do MariaDB 10.11 + phpMyAdmin 5 ::</h3>
<pre class="remontti-code"># apt install mariadb-server mariadb-client phpmyadmin</pre>
<p>Por padrão o pacote MaraiDB no Debian usa unix_socket para autenticar o login do usuário, o que basicamente significa que você pode usar o nome de usuário e a senha do sistema operacional para efetuar login no console do MariaDB. Assim, você pode logar diretamente sem fornecer a senha root do MariaDB. Mais a frente vou ensinar como definir uma senha, não farei agora pois se você alterar nesse momento ao instalar o phpMyAdmin terá um erro.</p>
<p>Selecione <strong>Apache2</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2023/06/lamp_debian_12_1.png" data-rel="lightbox-gallery-qBqOsOSR" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2023/06/lamp_debian_12_1.png" alt="" width="1256" height="408" class="alignnone size-full wp-image-7499" srcset="https://blog.remontti.com.br/wp-content/uploads/2023/06/lamp_debian_12_1.png 1256w, https://blog.remontti.com.br/wp-content/uploads/2023/06/lamp_debian_12_1-300x97.png 300w, https://blog.remontti.com.br/wp-content/uploads/2023/06/lamp_debian_12_1-1024x333.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2023/06/lamp_debian_12_1-768x249.png 768w" sizes="auto, (max-width: 1256px) 100vw, 1256px" /></a></p>
<p>Responda <strong>Sim</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2023/06/lamp_debian_12_2.png" data-rel="lightbox-gallery-qBqOsOSR" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2023/06/lamp_debian_12_2.png" alt="" width="1257" height="513" class="alignnone size-full wp-image-7500" srcset="https://blog.remontti.com.br/wp-content/uploads/2023/06/lamp_debian_12_2.png 1257w, https://blog.remontti.com.br/wp-content/uploads/2023/06/lamp_debian_12_2-300x122.png 300w, https://blog.remontti.com.br/wp-content/uploads/2023/06/lamp_debian_12_2-1024x418.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2023/06/lamp_debian_12_2-768x313.png 768w" sizes="auto, (max-width: 1257px) 100vw, 1257px" /></a></p>
<p><strong>Informe a senha</strong> para o banco de dados do phpmyadmin. <a href="http://senhasegura.remontti.com.br/" rel="noopener" target="_blank">http://senhasegura.remontti.com.br/</a><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2023/06/lamp_debian_12_3.png" data-rel="lightbox-gallery-qBqOsOSR" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2023/06/lamp_debian_12_3.png" alt="" width="1261" height="410" class="alignnone size-full wp-image-7501" srcset="https://blog.remontti.com.br/wp-content/uploads/2023/06/lamp_debian_12_3.png 1261w, https://blog.remontti.com.br/wp-content/uploads/2023/06/lamp_debian_12_3-300x98.png 300w, https://blog.remontti.com.br/wp-content/uploads/2023/06/lamp_debian_12_3-1024x333.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2023/06/lamp_debian_12_3-768x250.png 768w" sizes="auto, (max-width: 1261px) 100vw, 1261px" /></a></p>
<p>Repita a senha<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2023/06/lamp_debian_12_4.png" data-rel="lightbox-gallery-qBqOsOSR" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2023/06/lamp_debian_12_4.png" alt="" width="1264" height="437" class="alignnone size-full wp-image-7502" srcset="https://blog.remontti.com.br/wp-content/uploads/2023/06/lamp_debian_12_4.png 1264w, https://blog.remontti.com.br/wp-content/uploads/2023/06/lamp_debian_12_4-300x104.png 300w, https://blog.remontti.com.br/wp-content/uploads/2023/06/lamp_debian_12_4-1024x354.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2023/06/lamp_debian_12_4-768x266.png 768w" sizes="auto, (max-width: 1264px) 100vw, 1264px" /></a></p>
<p>Para acessar o phpmyadmin:<strong>http://[SERVER_IP]/phpmyadmin/</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2023/06/phpmyadmin_login.png" data-rel="lightbox-gallery-qBqOsOSR" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2023/06/phpmyadmin_login.png" alt="" width="1523" height="556" class="alignnone size-full wp-image-7471" srcset="https://blog.remontti.com.br/wp-content/uploads/2023/06/phpmyadmin_login.png 1523w, https://blog.remontti.com.br/wp-content/uploads/2023/06/phpmyadmin_login-300x110.png 300w, https://blog.remontti.com.br/wp-content/uploads/2023/06/phpmyadmin_login-1024x374.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2023/06/phpmyadmin_login-768x280.png 768w" sizes="auto, (max-width: 1523px) 100vw, 1523px" /></a></p>
<p>Por segurança eu sempre fecho o acesso ao phpmyadmin para os IPs da administração, assim evito que uma possível vulnerabilidade venha me afetar. Para isso edite:</p>
<pre class="remontti-code"># vim /etc/phpmyadmin/apache.conf</pre>
<p>Se deseja deixar o atalho para o phpmyadmin restrito apenas aos seus IP de gerencia faça da seguinte forma. Lembre-se de alterar os IPs 200.200.200.0/26 2001:db8:cafe:d0ce::/64 para os seus.</p>
<pre class="remontti-code"># phpMyAdmin default Apache configuration

Alias /phpmyadmin /usr/share/phpmyadmin

&lt;Directory /usr/share/phpmyadmin&gt;
    Options SymLinksIfOwnerMatch
    DirectoryIndex index.php

    # Restrito aos IPs
    AllowOverride All
    Require ip 127.0.0.1 ::1 200.200.200.0/26 2001:db8:cafe:d0ce::/64

    # limit libapache2-mod-php to files and directories necessary by pma
    &lt;IfModule mod_php7.c&gt;
        php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp
        php_admin_value open_basedir /usr/share/phpmyadmin/:/usr/share/doc/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/:/usr/share/php/:/usr/share/javascript/
    &lt;/IfModule&gt;

    # PHP 8+
    &lt;IfModule mod_php.c&gt;
        php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp
        php_admin_value open_basedir /usr/share/phpmyadmin/:/usr/share/doc/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/:/usr/share/php/:/usr/share/javascript/
    &lt;/IfModule&gt;

&lt;/Directory&gt;

# Disallow web access to directories that don&#039;t need it
&lt;Directory /usr/share/phpmyadmin/templates&gt;
    Require all denied
&lt;/Directory&gt;
&lt;Directory /usr/share/phpmyadmin/libraries&gt;
    Require all denied
&lt;/Directory&gt;</pre>
<p>Reinicie o Apache.</p>
<pre class="remontti-code"> systemctl restart apache2</pre>
<h4>:: Definindo senha para o root do mariaDB ::</h4>
<p>Para aumentar a seguraçã vamos definir uma senha para o usuário root do MariDB, não esqueça de alterar <strong>ALTERE_3ST4_SENHA</strong> pela sua senha.</p>
<pre class="remontti-code"># mariadb -u root</pre>
<pre class="remontti-code">USE mysql;
ALTER USER &#039;root&#039;@&#039;localhost&#039; IDENTIFIED BY &#039;ALTERE_3ST4_SENHA&#039;;
FLUSH PRIVILEGES;
EXIT;</pre>
<p>Apague seus rastros, em /root/.mysql_history temos um histórico com todos os comandos dado no terminal do MariaDB, então não é legal deixar lá em texto puro a senha que setamos!</p>
<pre class="remontti-code"># &gt; /root/.mysql_history</pre>
<h3>:: Let&#8217;s Encrypt ::</h3>
<p>Criando certificado grátis para seus sub/domínios.</p>
<pre class="remontti-code"># apt install certbot python3-certbot-apache</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>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-qBqOsOSR" 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><br />
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></p>
<p>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>Abraço!</p>
<p>O post <a href="https://blog.remontti.com.br/7496">Servidor WEB Apache2 + PHP 8.2 + MariaDB +Let’s Encrypt Debian 12 Bookworm (LAMP)</a> apareceu primeiro em <a href="https://blog.remontti.com.br">Remontti</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.remontti.com.br/7496/feed</wfw:commentRss>
			<slash:comments>11</slash:comments>
		
		
			</item>
		<item>
		<title>Instalando o Cachet um sistema de página de status open source</title>
		<link>https://blog.remontti.com.br/5296</link>
					<comments>https://blog.remontti.com.br/5296#comments</comments>
		
		<dc:creator><![CDATA[Rudimar Remontti]]></dc:creator>
		<pubDate>Sat, 20 Feb 2021 20:37:19 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutoriais]]></category>
		<category><![CDATA[apache2]]></category>
		<category><![CDATA[Cachet]]></category>
		<category><![CDATA[CachetHQ]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[monitoramento]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php7]]></category>
		<category><![CDATA[php7.3]]></category>
		<category><![CDATA[status]]></category>
		<guid isPermaLink="false">https://blog.remontti.com.br/?p=5296</guid>

					<description><![CDATA[<p>Cachet é uma página de status para serviços mantidos pela sua empresa/administração. Quem sabe você ja tenha acessado https://status.ix.br para verificar se o IX estava passando por alguma problema, IX.BR usa o Cachet. É&#46;&#46;&#46;</p>
<p>O post <a href="https://blog.remontti.com.br/5296">Instalando o Cachet um sistema de página de status open source</a> apareceu primeiro em <a href="https://blog.remontti.com.br">Remontti</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><a href="https://cachethq.io/" rel="noopener" target="_blank">Cachet</a> é uma página de status para serviços mantidos pela sua empresa/administração. Quem sabe você ja tenha acessado <a href="https://status.ix.br" rel="noopener" target="_blank">https://status.ix.br</a> para verificar se o IX estava passando por alguma problema, IX.BR usa o Cachet. É uma ferramenta que ira ajuda a comunicar o tempo de atividade e o tempo de inatividade de seus aplicativos/serviços e a compartilhar informações sobre quaisquer interrupções.</p>
<p><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2021/02/cachet-destaque.png" alt="" width="600" height="154" class="alignnone size-full wp-image-5315" srcset="https://blog.remontti.com.br/wp-content/uploads/2021/02/cachet-destaque.png 600w, https://blog.remontti.com.br/wp-content/uploads/2021/02/cachet-destaque-300x77.png 300w" sizes="auto, (max-width: 600px) 100vw, 600px" /></p>
<p>Ele é desenvolvido em PHP, portanto, se você já possui um servidor LAMP ou LEMP, é fácil de instalar. Ele tem uma interface limpa e é projetado para ser responsivo, de modo que pode funcionar em todos os dispositivos. </p>
<p>Cachet não monitora seus sites ou servidores quanto ao tempo de inatividade; O Cachet registra incidentes, que podem ser atualizados manualmente por meio da interface web ou com a <a href="https://docs.cachethq.io/docs/api-authentication" rel="noopener" target="_blank">API</a> do Cachet. Se você estiver procurando por soluções de monitoramento, confira o tutorial do Zabbix.</p>
<p>Neste tutorial, vou configurar uma página de status com Cachet no Debian 10.</p>
<p>Requisitos:<br />
Como base irei fazer a <a href="https://blog.remontti.com.br/2966" rel="noopener" target="_blank">instalação no Debian 10 limpa </a>(sem nenhuma instalação de pacotes)</p>
<pre class="remontti-code">$ su -
# apt upda; apt upgrade</pre>
<pre class="remontti-code"># apt install wget apache2 apache2-utils libapache2-mod-php \
php php-mysql php-cli php-pear php-gmp php-gd php-bcmath \
php-mbstring php-curl php-xml php-zip php-apcu php-fpm \
mariadb-server mariadb-client zip</pre>
<p>Como estou me baseando por umas instalação limpa, vou setar a senha do mariaDb/Mysql e em seguida já criar nosso banco para o cachet.</p>
<pre class="remontti-code"># mariadb -u root</pre>
<p>Não equeça de alterar as senhas, recomendo você criar uma senha aleatória em <a href="https://senhasegura.remontti.com.br/" rel="noopener" target="_blank">https://senhasegura.remontti.com.br/</a></p>
<pre class="remontti-code">
USE mysql;
UPDATE user SET password=PASSWORD(&#039;SENHA_ROOT&#039;) WHERE User=&#039;root&#039;;
UPDATE user SET plugin=&quot;mysql_native_password&quot;;

CREATE DATABASE cachet;
GRANT ALL ON cachet.* TO &#039;cachet&#039; IDENTIFIED BY &#039;SUA_SENHA_CACHET&#039;;
FLUSH PRIVILEGES;
EXIT;
</pre>
<p>Entre no diretório temp, onde iremos fazer o download mais recente do Composer (Não irei instala-lo via apt)</p>
<pre class="remontti-code"># cd /tmp/
# wget https://getcomposer.org/installer -O installer.php
# php installer.php</pre>
<pre class="remontti-code-plain">
All settings correct for using Composer
Downloading...

Composer (version 2.0.9) successfully installed to: /tmp/composer.phar
Use it: php composer.phar</pre>
<pre class="remontti-code"># mv composer.phar /usr/bin/composer
# composer --version</pre>
<pre class="remontti-code-plain">
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Continue as root/super user [yes]? yes
Composer version 2.0.9 2021-01-27 16:09:27
</pre>
<p>Vamos propriamente então ao projeto Cachet</p>
<pre class="remontti-code"># wget https://github.com/CachetHQ/Cachet/archive/2.4.zip
# unzip 2.4.zip -d /var/www/
# mv /var/www/Cachet-2.4/ /var/www/cachet
# cp /var/www/cachet/.env.example /var/www/cachet/.env
# vim /var/www/cachet/.env</pre>
<p>Altere as informacções de usuario e senha do mariaDB de acordo com o que você criou.</p>
<pre class="remontti-code-plain">DB_USERNAME=homestead
DB_PASSWORD=secret</pre>
<p>Para</p>
<pre class="remontti-code-plain">DB_USERNAME=cachet
DB_PASSWORD=SUA_SENHA_CACHET</pre>
<pre class="remontti-code"># cd /var/www/cachet
# composer install --no-dev -o</pre>
<pre class="remontti-code-plain">
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Continue as root/super user [yes]? yes
Installing dependencies from lock file
Verifying lock file contents can be installed on current platform.
Package operations: 97 installs, 0 updates, 0 removals
  - Downloading kylekatarnls/update-helper (1.2.1)
  - Downloading symfony/polyfill-ctype (v1.18.0)
  - Downloading vlucas/phpdotenv (v2.6.6)
  - Downloading symfony/css-selector (v4.4.11)
  - Downloading tijsverkoyen/css-to-inline-styles (2.2.3)
  - Downloading symfony/polyfill-php80 (v1.18.0)
  - Downloading symfony/polyfill-php72 (v1.18.0)
  - Downloading symfony/var-dumper (v4.4.11)
  - Downloading symfony/routing (v4.4.11)
  - Downloading symfony/process (v4.4.11)
  - Downloading symfony/polyfill-php73 (v1.18.0)
  - Downloading symfony/polyfill-php70 (v1.18.0)
  - Downloading symfony/polyfill-intl-normalizer (v1.18.0)
  - Downloading symfony/polyfill-intl-idn (v1.18.0)
  - Downloading symfony/mime (v4.4.11)
  - Downloading symfony/http-foundation (v4.4.11)
  - Downloading symfony/event-dispatcher-contracts (v1.1.9)
  - Downloading symfony/event-dispatcher (v4.4.11)
  - Downloading psr/log (1.1.3)
  - Downloading symfony/debug (v4.4.11)
  - Downloading symfony/error-handler (v4.4.11)
  - Downloading symfony/http-kernel (v4.4.11)
  - Downloading symfony/finder (v4.4.11)
  - Downloading psr/container (1.0.0)
  - Downloading symfony/service-contracts (v1.1.9)
  - Downloading symfony/console (v4.4.11)
  - Downloading symfony/polyfill-iconv (v1.18.0)
  - Downloading doctrine/lexer (1.0.2)
  - Downloading egulias/email-validator (2.1.18)
  - Downloading swiftmailer/swiftmailer (v6.2.3)
  - Downloading ramsey/uuid (3.9.3)
  - Downloading psr/simple-cache (1.0.1)
  - Downloading opis/closure (3.5.5)
  - Downloading symfony/translation-contracts (v1.1.9)
  - Downloading symfony/translation (v4.4.11)
  - Downloading nesbot/carbon (1.39.1)
  - Downloading monolog/monolog (1.25.5)
  - Downloading league/flysystem (1.0.70)
  - Downloading ralouphie/getallheaders (3.0.3)
  - Downloading psr/http-message (1.0.1)
  - Downloading guzzlehttp/psr7 (1.6.1)
  - Downloading guzzlehttp/promises (v1.3.1)
  - Downloading guzzlehttp/guzzle (6.5.5)
  - Downloading laravel/slack-notification-channel (v1.0.3)
  - Downloading php-http/promise (1.1.0)
  - Downloading php-http/httplug (v1.1.0)
  - Downloading php-http/guzzle6-adapter (v1.1.1)
  - Downloading psr/http-factory (1.0.1)
  - Downloading zendframework/zend-diactoros (2.2.1)
  - Downloading lcobucci/jwt (3.3.2)
  - Downloading nexmo/client-core (1.8.1)
  - Downloading nexmo/client (1.9.1)
  - Downloading laravel/nexmo-notification-channel (v1.0.1)
  - Downloading erusev/parsedown (1.7.4)
  - Downloading dragonmantank/cron-expression (v2.3.0)
  - Downloading doctrine/inflector (1.3.1)
  - Downloading laravel/framework (v5.7.29)
  - Downloading alt-three/badger (v5.1.0)
  - Downloading alt-three/bus (v4.5.0)
  - Downloading league/commonmark (0.18.5)
  - Downloading graham-campbell/guzzle-factory (v3.0.4)
  - Downloading alt-three/emoji (v7.0.0)
  - Downloading alt-three/twitter (v3.1.0)
  - Downloading alt-three/validator (v4.5.0)
  - Downloading mtdowling/jmespath.php (2.6.0)
  - Downloading aws/aws-sdk-php (3.147.10)
  - Downloading asm89/stack-cors (1.3.0)
  - Downloading barryvdh/laravel-cors (v0.11.4)
  - Downloading composer/ca-bundle (1.2.7)
  - Downloading bugsnag/bugsnag (v3.21.0)
  - Downloading bugsnag/bugsnag-psr-logger (v1.4.3)
  - Downloading bugsnag/bugsnag-laravel (v2.19.0)
  - Downloading chillerlan/php-traits (1.1.13)
  - Downloading chillerlan/php-qrcode (2.0.8)
  - Downloading doctrine/event-manager (1.1.0)
  - Downloading doctrine/cache (1.10.2)
  - Downloading doctrine/dbal (v2.9.3)
  - Downloading fideloper/proxy (4.4.0)
  - Downloading graham-campbell/security-core (v1.0.3)
  - Downloading graham-campbell/security (v6.2.0)
  - Downloading graham-campbell/binput (v6.2.0)
  - Downloading graham-campbell/exceptions (v11.3.0)
  - Downloading graham-campbell/markdown (v10.3.1)
  - Downloading jakub-onderka/php-console-color (v0.2)
  - Downloading jenssegers/date (v3.5.0)
  - Downloading nikic/php-parser (v4.7.0)
  - Downloading jakub-onderka/php-console-highlighter (v0.4)
  - Downloading dnoegel/php-xdg-base-dir (v0.1.1)
  - Downloading psy/psysh (v0.9.12)
  - Downloading laravel/tinker (v1.0.10)
  - Downloading mccool/laravel-auto-presenter (7.4.1)
  - Downloading symfony/polyfill-util (v1.18.0)
  - Downloading symfony/polyfill-php56 (v1.18.0)
  - Downloading paragonie/constant_time_encoding (v2.3.0)
  - Downloading pragmarx/google2fa (v5.0.0)
  - Downloading predis/predis (v1.1.1)
  - Downloading twig/twig (v2.13.0)
  - Installing kylekatarnls/update-helper (1.2.1): Extracting archive
  - Installing symfony/polyfill-ctype (v1.18.0): Extracting archive
  - Installing vlucas/phpdotenv (v2.6.6): Extracting archive
  - Installing symfony/css-selector (v4.4.11): Extracting archive
  - Installing tijsverkoyen/css-to-inline-styles (2.2.3): Extracting archive
  - Installing symfony/polyfill-php80 (v1.18.0): Extracting archive
  - Installing symfony/polyfill-php72 (v1.18.0): Extracting archive
  - Installing symfony/var-dumper (v4.4.11): Extracting archive
  - Installing symfony/routing (v4.4.11): Extracting archive
  - Installing symfony/process (v4.4.11): Extracting archive
  - Installing symfony/polyfill-php73 (v1.18.0): Extracting archive
  - Installing symfony/polyfill-php70 (v1.18.0): Extracting archive
  - Installing symfony/polyfill-intl-normalizer (v1.18.0): Extracting archive
  - Installing symfony/polyfill-intl-idn (v1.18.0): Extracting archive
  - Installing symfony/mime (v4.4.11): Extracting archive
  - Installing symfony/http-foundation (v4.4.11): Extracting archive
  - Installing symfony/event-dispatcher-contracts (v1.1.9): Extracting archive
  - Installing symfony/event-dispatcher (v4.4.11): Extracting archive
  - Installing psr/log (1.1.3): Extracting archive
  - Installing symfony/debug (v4.4.11): Extracting archive
  - Installing symfony/error-handler (v4.4.11): Extracting archive
  - Installing symfony/http-kernel (v4.4.11): Extracting archive
  - Installing symfony/finder (v4.4.11): Extracting archive
  - Installing psr/container (1.0.0): Extracting archive
  - Installing symfony/service-contracts (v1.1.9): Extracting archive
  - Installing symfony/console (v4.4.11): Extracting archive
  - Installing symfony/polyfill-iconv (v1.18.0): Extracting archive
  - Installing doctrine/lexer (1.0.2): Extracting archive
  - Installing egulias/email-validator (2.1.18): Extracting archive
  - Installing swiftmailer/swiftmailer (v6.2.3): Extracting archive
  - Installing ramsey/uuid (3.9.3): Extracting archive
  - Installing psr/simple-cache (1.0.1): Extracting archive
  - Installing opis/closure (3.5.5): Extracting archive
  - Installing symfony/translation-contracts (v1.1.9): Extracting archive
  - Installing symfony/translation (v4.4.11): Extracting archive
  - Installing nesbot/carbon (1.39.1): Extracting archive
  - Installing monolog/monolog (1.25.5): Extracting archive
  - Installing league/flysystem (1.0.70): Extracting archive
  - Installing ralouphie/getallheaders (3.0.3): Extracting archive
  - Installing psr/http-message (1.0.1): Extracting archive
  - Installing guzzlehttp/psr7 (1.6.1): Extracting archive
  - Installing guzzlehttp/promises (v1.3.1): Extracting archive
  - Installing guzzlehttp/guzzle (6.5.5): Extracting archive
  - Installing laravel/slack-notification-channel (v1.0.3): Extracting archive
  - Installing php-http/promise (1.1.0): Extracting archive
  - Installing php-http/httplug (v1.1.0): Extracting archive
  - Installing php-http/guzzle6-adapter (v1.1.1): Extracting archive
  - Installing psr/http-factory (1.0.1): Extracting archive
  - Installing zendframework/zend-diactoros (2.2.1): Extracting archive
  - Installing lcobucci/jwt (3.3.2): Extracting archive
  - Installing nexmo/client-core (1.8.1): Extracting archive
  - Installing nexmo/client (1.9.1): Extracting archive
  - Installing laravel/nexmo-notification-channel (v1.0.1): Extracting archive
  - Installing erusev/parsedown (1.7.4): Extracting archive
  - Installing dragonmantank/cron-expression (v2.3.0): Extracting archive
  - Installing doctrine/inflector (1.3.1): Extracting archive
  - Installing laravel/framework (v5.7.29): Extracting archive
  - Installing alt-three/badger (v5.1.0): Extracting archive
  - Installing alt-three/bus (v4.5.0): Extracting archive
  - Installing league/commonmark (0.18.5): Extracting archive
  - Installing graham-campbell/guzzle-factory (v3.0.4): Extracting archive
  - Installing alt-three/emoji (v7.0.0): Extracting archive
  - Installing alt-three/twitter (v3.1.0): Extracting archive
  - Installing alt-three/validator (v4.5.0): Extracting archive
  - Installing mtdowling/jmespath.php (2.6.0): Extracting archive
  - Installing aws/aws-sdk-php (3.147.10): Extracting archive
  - Installing asm89/stack-cors (1.3.0): Extracting archive
  - Installing barryvdh/laravel-cors (v0.11.4): Extracting archive
  - Installing composer/ca-bundle (1.2.7): Extracting archive
  - Installing bugsnag/bugsnag (v3.21.0): Extracting archive
  - Installing bugsnag/bugsnag-psr-logger (v1.4.3): Extracting archive
  - Installing bugsnag/bugsnag-laravel (v2.19.0): Extracting archive
  - Installing chillerlan/php-traits (1.1.13): Extracting archive
  - Installing chillerlan/php-qrcode (2.0.8): Extracting archive
  - Installing doctrine/event-manager (1.1.0): Extracting archive
  - Installing doctrine/cache (1.10.2): Extracting archive
  - Installing doctrine/dbal (v2.9.3): Extracting archive
  - Installing fideloper/proxy (4.4.0): Extracting archive
  - Installing graham-campbell/security-core (v1.0.3): Extracting archive
  - Installing graham-campbell/security (v6.2.0): Extracting archive
  - Installing graham-campbell/binput (v6.2.0): Extracting archive
  - Installing graham-campbell/exceptions (v11.3.0): Extracting archive
  - Installing graham-campbell/markdown (v10.3.1): Extracting archive
  - Installing jakub-onderka/php-console-color (v0.2): Extracting archive
  - Installing jenssegers/date (v3.5.0): Extracting archive
  - Installing nikic/php-parser (v4.7.0): Extracting archive
  - Installing jakub-onderka/php-console-highlighter (v0.4): Extracting archive
  - Installing dnoegel/php-xdg-base-dir (v0.1.1): Extracting archive
  - Installing psy/psysh (v0.9.12): Extracting archive
  - Installing laravel/tinker (v1.0.10): Extracting archive
  - Installing mccool/laravel-auto-presenter (7.4.1): Extracting archive
  - Installing symfony/polyfill-util (v1.18.0): Extracting archive
  - Installing symfony/polyfill-php56 (v1.18.0): Extracting archive
  - Installing paragonie/constant_time_encoding (v2.3.0): Extracting archive
  - Installing pragmarx/google2fa (v5.0.0): Extracting archive
  - Installing predis/predis (v1.1.1): Extracting archive
  - Installing twig/twig (v2.13.0): Extracting archive
Package alt-three/badger is abandoned, you should avoid using it. Use cachethq/badger instead.
Package alt-three/emoji is abandoned, you should avoid using it. Use cachethq/emoji instead.
Package alt-three/twitter is abandoned, you should avoid using it. Use cachethq/twitter instead.
Package jakub-onderka/php-console-color is abandoned, you should avoid using it. Use php-parallel-lint/php-console-color instead.                                                                                                           
Package jakub-onderka/php-console-highlighter is abandoned, you should avoid using it. Use php-parallel-lint/php-console-highlighter instead.                                                                                               
Package zendframework/zend-diactoros is abandoned, you should avoid using it. Use laminas/laminas-diactoros instead.
Generating optimized autoload files
Carbon 1 is deprecated, see how to migrate to Carbon 2.
https://carbon.nesbot.com/docs/#api-carbon-2
    You can run &#039;./vendor/bin/upgrade-carbon&#039; to get help in updating carbon and other frameworks and libraries that depend on it.
&gt; Illuminate\Foundation\ComposerScripts::postAutoloadDump
&gt; @php artisan package:discover
Discovered Package: alt-three/badger
Discovered Package: alt-three/emoji
Discovered Package: alt-three/twitter
Discovered Package: barryvdh/laravel-cors
Discovered Package: fideloper/proxy
Discovered Package: graham-campbell/binput
Discovered Package: graham-campbell/exceptions
Discovered Package: graham-campbell/markdown
Discovered Package: graham-campbell/security
Discovered Package: jenssegers/date
Discovered Package: laravel/nexmo-notification-channel
Discovered Package: laravel/slack-notification-channel
Discovered Package: laravel/tinker
Discovered Package: mccool/laravel-auto-presenter
Discovered Package: nesbot/carbon
Package manifest generated successfully.
38 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
</pre>
<pre class="remontti-code"># php artisan key:generate</pre>
<pre class="remontti-code-plain">
Application key set successfully.
</pre>
<pre class="remontti-code"># php artisan cachet:install</pre>
<pre class="remontti-code-plain">
 Do you want to configure Cachet before installing? (yes/no) [no]:
 &gt; no

Installing Cachet...
Clearing settings cache...
Settings cache cleared!
System was installed!
**************************************
*     Application In Production!     *
**************************************

 Do you really wish to run this command? (yes/no) [no]:
 &gt; no

Command Cancelled!
Configuration cache cleared!
Configuration cached successfully!
Route cache cleared!
Routes cached successfully!
Copied Directory [/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/views] To [/resources/views/errors]
Copied Directory [/vendor/laravel/framework/src/Illuminate/Notifications/resources/views] To [/resources/views/vendor/notifications]                                                                                                        
Copied Directory [/vendor/laravel/framework/src/Illuminate/Pagination/resources/views] To [/resources/views/vendor/pagination]                                                                                                              
Copied Directory [/vendor/laravel/framework/src/Illuminate/Mail/resources/views] To [/resources/views/vendor/mail]
Publishing complete.
Migration table created successfully.
Migrating: 2015_01_05_201324_CreateComponentGroupsTable
Migrated:  2015_01_05_201324_CreateComponentGroupsTable
Migrating: 2015_01_05_201444_CreateComponentsTable
Migrated:  2015_01_05_201444_CreateComponentsTable
Migrating: 2015_01_05_202446_CreateIncidentTemplatesTable
Migrated:  2015_01_05_202446_CreateIncidentTemplatesTable
Migrating: 2015_01_05_202609_CreateIncidentsTable
Migrated:  2015_01_05_202609_CreateIncidentsTable
Migrating: 2015_01_05_202730_CreateMetricPointsTable
Migrated:  2015_01_05_202730_CreateMetricPointsTable
Migrating: 2015_01_05_202826_CreateMetricsTable
Migrated:  2015_01_05_202826_CreateMetricsTable
Migrating: 2015_01_05_203014_CreateSettingsTable
Migrated:  2015_01_05_203014_CreateSettingsTable
Migrating: 2015_01_05_203235_CreateSubscribersTable
Migrated:  2015_01_05_203235_CreateSubscribersTable
Migrating: 2015_01_05_203341_CreateUsersTable
Migrated:  2015_01_05_203341_CreateUsersTable
Migrating: 2015_01_09_083419_AlterTableUsersAdd2FA
Migrated:  2015_01_09_083419_AlterTableUsersAdd2FA
Migrating: 2015_01_16_083825_CreateTagsTable
Migrated:  2015_01_16_083825_CreateTagsTable
Migrating: 2015_01_16_084030_CreateComponentTagTable
Migrated:  2015_01_16_084030_CreateComponentTagTable
Migrating: 2015_02_28_214642_UpdateIncidentsAddScheduledAt
Migrated:  2015_02_28_214642_UpdateIncidentsAddScheduledAt
Migrating: 2015_05_19_214534_AlterTableComponentGroupsAddOrder
Migrated:  2015_05_19_214534_AlterTableComponentGroupsAddOrder
Migrating: 2015_05_20_073041_AlterTableIncidentsAddVisibileColumn
Migrated:  2015_05_20_073041_AlterTableIncidentsAddVisibileColumn
Migrating: 2015_05_24_210939_create_jobs_table
Migrated:  2015_05_24_210939_create_jobs_table
Migrating: 2015_05_24_210948_create_failed_jobs_table
Migrated:  2015_05_24_210948_create_failed_jobs_table
Migrating: 2015_06_10_122216_AlterTableComponentsDropUserIdColumn
Migrated:  2015_06_10_122216_AlterTableComponentsDropUserIdColumn
Migrating: 2015_06_10_122229_AlterTableIncidentsDropUserIdColumn
Migrated:  2015_06_10_122229_AlterTableIncidentsDropUserIdColumn
Migrating: 2015_08_02_120436_AlterTableSubscribersRemoveDeletedAt
Migrated:  2015_08_02_120436_AlterTableSubscribersRemoveDeletedAt
Migrating: 2015_08_13_214123_AlterTableMetricsAddDecimalPlacesColumn
Migrated:  2015_08_13_214123_AlterTableMetricsAddDecimalPlacesColumn
Migrating: 2015_10_31_211944_CreateInvitesTable
Migrated:  2015_10_31_211944_CreateInvitesTable
Migrating: 2015_11_03_211049_AlterTableComponentsAddEnabledColumn
Migrated:  2015_11_03_211049_AlterTableComponentsAddEnabledColumn
Migrating: 2015_12_26_162258_AlterTableMetricsAddDefaultViewColumn
Migrated:  2015_12_26_162258_AlterTableMetricsAddDefaultViewColumn
Migrating: 2016_01_09_141852_CreateSubscriptionsTable
Migrated:  2016_01_09_141852_CreateSubscriptionsTable
Migrating: 2016_01_29_154937_AlterTableComponentGroupsAddCollapsedColumn
Migrated:  2016_01_29_154937_AlterTableComponentGroupsAddCollapsedColumn
Migrating: 2016_02_18_085210_AlterTableMetricPointsChangeValueColumn
Migrated:  2016_02_18_085210_AlterTableMetricPointsChangeValueColumn
Migrating: 2016_03_01_174858_AlterTableMetricPointsAddCounterColumn
Migrated:  2016_03_01_174858_AlterTableMetricPointsAddCounterColumn
Migrating: 2016_03_08_125729_CreateIncidentUpdatesTable
Migrated:  2016_03_08_125729_CreateIncidentUpdatesTable
Migrating: 2016_03_10_144613_AlterTableComponentGroupsMakeColumnInteger
Migrated:  2016_03_10_144613_AlterTableComponentGroupsMakeColumnInteger
Migrating: 2016_04_05_142933_create_sessions_table
Migrated:  2016_04_05_142933_create_sessions_table
Migrating: 2016_04_29_061916_AlterTableSubscribersAddGlobalColumn
Migrated:  2016_04_29_061916_AlterTableSubscribersAddGlobalColumn
Migrating: 2016_06_02_075012_AlterTableMetricsAddOrderColumn
Migrated:  2016_06_02_075012_AlterTableMetricsAddOrderColumn
Migrating: 2016_06_05_091615_create_cache_table
Migrated:  2016_06_05_091615_create_cache_table
Migrating: 2016_07_25_052444_AlterTableComponentGroupsAddVisibleColumn
Migrated:  2016_07_25_052444_AlterTableComponentGroupsAddVisibleColumn
Migrating: 2016_08_23_114610_AlterTableUsersAddWelcomedColumn
Migrated:  2016_08_23_114610_AlterTableUsersAddWelcomedColumn
Migrating: 2016_09_04_100000_AlterTableIncidentsAddStickiedColumn
Migrated:  2016_09_04_100000_AlterTableIncidentsAddStickiedColumn
Migrating: 2016_10_24_183415_AlterTableIncidentsAddOccurredAtColumn
Migrated:  2016_10_24_183415_AlterTableIncidentsAddOccurredAtColumn
Migrating: 2016_10_30_174400_CreateSchedulesTable
Migrated:  2016_10_30_174400_CreateSchedulesTable
Migrating: 2016_10_30_174410_CreateScheduleComponentsTable
Migrated:  2016_10_30_174410_CreateScheduleComponentsTable
Migrating: 2016_10_30_182324_AlterTableIncidentsRemoveScheduledColumns
Migrated:  2016_10_30_182324_AlterTableIncidentsRemoveScheduledColumns
Migrating: 2016_12_04_163502_AlterTableMetricsAddVisibleColumn
Migrated:  2016_12_04_163502_AlterTableMetricsAddVisibleColumn
Migrating: 2016_12_05_185045_AlterTableComponentsAddMetaColumn
Migrated:  2016_12_05_185045_AlterTableComponentsAddMetaColumn
Migrating: 2016_12_29_124643_AlterTableSubscribersAddPhoneNumberSlackColumns
Migrated:  2016_12_29_124643_AlterTableSubscribersAddPhoneNumberSlackColumns
Migrating: 2016_12_29_155956_AlterTableComponentsMakeLinkNullable
Migrated:  2016_12_29_155956_AlterTableComponentsMakeLinkNullable
Migrating: 2017_01_03_143916_create_notifications_table
Migrated:  2017_01_03_143916_create_notifications_table
Migrating: 2017_02_03_222218_CreateActionsTable
Migrated:  2017_02_03_222218_CreateActionsTable
Migrating: 2017_06_13_181049_CreateMetaTable
Migrated:  2017_06_13_181049_CreateMetaTable
Migrating: 2017_07_18_214718_CreateIncidentComponents
Migrated:  2017_07_18_214718_CreateIncidentComponents
Migrating: 2017_09_14_180434_AlterIncidentsAddUserId
Migrated:  2017_09_14_180434_AlterIncidentsAddUserId
Migrating: 2018_04_02_163328_CreateTaggablesTable
Migrated:  2018_04_02_163328_CreateTaggablesTable
Migrating: 2018_04_02_163658_MigrateComponentTagTable
Migrated:  2018_04_02_163658_MigrateComponentTagTable
Migrating: 2018_06_14_201440_AlterSchedulesSoftDeletes
Migrated:  2018_06_14_201440_AlterSchedulesSoftDeletes
Migrating: 2018_06_17_182507_AlterIncidentsAddNotifications
Migrated:  2018_06_17_182507_AlterIncidentsAddNotifications
Migrating: 2019_12_12_131400_AlterJobsDropReserved
Migrated:  2019_12_12_131400_AlterJobsDropReserved
Database seeding completed successfully.
Clearing cache...
Application cache cleared!
Cache cleared!
The [public/storage] directory has been linked.
Cachet is installed <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/26a1.png" alt="⚡" class="wp-smiley" style="height: 1em; max-height: 1em;" />
</pre>
<p>Acredito que esteja criando para rodalo em um <a href="https://blog.remontti.com.br/3464" rel="noopener" target="_blank">domínio virtual</a>, então segue um exemplo:</p>
<pre class="remontti-code"># vim /etc/apache2/sites-available/cachet.conf</pre>
<pre class="remontti-code">
&lt;virtualhost *:80&gt;
        ServerName status.remontti.com.br
        ServerAlias cachet.remontti.com.br
        ServerAdmin noc@remontti.com.br
 
        DocumentRoot /var/www/cachet/public
 
        &lt;directory /var/www/cachet/public/ &gt;
                Options FollowSymLinks
                AllowOverride All
        &lt;/directory&gt; 
 
        LogLevel warn 
        ErrorLog ${APACHE_LOG_DIR}/error_cachet.log
        CustomLog ${APACHE_LOG_DIR}/access_cachet.log combined
&lt;/virtualhost&gt;
</pre>
<p>Habilite as configurações</p>
<pre class="remontti-code"># a2ensite cachet</pre>
<p>Caso irá roda-lo em um IP edite as configurações default, se fez da forma acima pode pular esta parte.</p>
<pre class="remontti-code"># vim /etc/apache2/sites-available/000-default.conf</pre>
<pre class="remontti-code">
&lt;VirtualHost *:80&gt;
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/cachet/public
    &lt;directory /var/www/cachet/public/ &gt;
        Options FollowSymLinks
        AllowOverride All
    &lt;/directory&gt;
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
&lt;/VirtualHost&gt;
</pre>
<p>Ativaremos o mod de rescrita, ajustaremos as permissões do diretório para www-data e reiniciaremos o serviço apache2.</p>
<pre class="remontti-code"># a2enmod rewrite
# chown www-data. /var/www/cachet -R
# systemctl restart apache2</pre>
<p>Agora acesse &#8220;<strong>http://status.remontti.com.br/setup</strong>&#8221; para concluir a instalação</p>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2021/02/c1.png" data-rel="lightbox-gallery-gQenWZMc" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2021/02/c1.png" alt="" width="1680" height="920" class="alignnone size-full wp-image-5298" srcset="https://blog.remontti.com.br/wp-content/uploads/2021/02/c1.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2021/02/c1-300x164.png 300w, https://blog.remontti.com.br/wp-content/uploads/2021/02/c1-1024x561.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2021/02/c1-768x421.png 768w, https://blog.remontti.com.br/wp-content/uploads/2021/02/c1-1536x841.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a></p>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2021/02/c2.png" data-rel="lightbox-gallery-gQenWZMc" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2021/02/c2.png" alt="" width="1680" height="854" class="alignnone size-full wp-image-5306" srcset="https://blog.remontti.com.br/wp-content/uploads/2021/02/c2.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2021/02/c2-300x153.png 300w, https://blog.remontti.com.br/wp-content/uploads/2021/02/c2-1024x521.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2021/02/c2-768x390.png 768w, https://blog.remontti.com.br/wp-content/uploads/2021/02/c2-1536x781.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a></p>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2021/02/c3.png" data-rel="lightbox-gallery-gQenWZMc" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2021/02/c3.png" alt="" width="1680" height="854" class="alignnone size-full wp-image-5307" srcset="https://blog.remontti.com.br/wp-content/uploads/2021/02/c3.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2021/02/c3-300x153.png 300w, https://blog.remontti.com.br/wp-content/uploads/2021/02/c3-1024x521.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2021/02/c3-768x390.png 768w, https://blog.remontti.com.br/wp-content/uploads/2021/02/c3-1536x781.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a></p>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2021/02/c4.png" data-rel="lightbox-gallery-gQenWZMc" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2021/02/c4.png" alt="" width="1680" height="854" class="alignnone size-full wp-image-5308" srcset="https://blog.remontti.com.br/wp-content/uploads/2021/02/c4.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2021/02/c4-300x153.png 300w, https://blog.remontti.com.br/wp-content/uploads/2021/02/c4-1024x521.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2021/02/c4-768x390.png 768w, https://blog.remontti.com.br/wp-content/uploads/2021/02/c4-1536x781.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a></p>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2021/02/c5-1.png" data-rel="lightbox-gallery-gQenWZMc" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2021/02/c5-1.png" alt="" width="1680" height="854" class="alignnone size-full wp-image-5309" srcset="https://blog.remontti.com.br/wp-content/uploads/2021/02/c5-1.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2021/02/c5-1-300x153.png 300w, https://blog.remontti.com.br/wp-content/uploads/2021/02/c5-1-1024x521.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2021/02/c5-1-768x390.png 768w, https://blog.remontti.com.br/wp-content/uploads/2021/02/c5-1-1536x781.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a></p>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2021/02/c5-2.png" data-rel="lightbox-gallery-gQenWZMc" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2021/02/c5-2.png" alt="" width="1680" height="854" class="alignnone size-full wp-image-5310" srcset="https://blog.remontti.com.br/wp-content/uploads/2021/02/c5-2.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2021/02/c5-2-300x153.png 300w, https://blog.remontti.com.br/wp-content/uploads/2021/02/c5-2-1024x521.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2021/02/c5-2-768x390.png 768w, https://blog.remontti.com.br/wp-content/uploads/2021/02/c5-2-1536x781.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a></p>
<p>Para acessar sua Dashboard<br />
http://status.remontti.com.br/dashboard<br />
http://ou_seu_ip/dashboard</p>
<p>E em sua home você tem a página de status.<br />
http://status.remontti.com.br<br />
http://ou_seu_ip/</p>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2021/02/c7.png" data-rel="lightbox-gallery-gQenWZMc" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2021/02/c7.png" alt="" width="1680" height="1583" class="alignnone size-full wp-image-5311" srcset="https://blog.remontti.com.br/wp-content/uploads/2021/02/c7.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2021/02/c7-300x283.png 300w, https://blog.remontti.com.br/wp-content/uploads/2021/02/c7-1024x965.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2021/02/c7-768x724.png 768w, https://blog.remontti.com.br/wp-content/uploads/2021/02/c7-1536x1447.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a></p>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2021/02/c7-1.png" data-rel="lightbox-gallery-gQenWZMc" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2021/02/c7-1.png" alt="" width="1680" height="1583" class="alignnone size-full wp-image-5312" srcset="https://blog.remontti.com.br/wp-content/uploads/2021/02/c7-1.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2021/02/c7-1-300x283.png 300w, https://blog.remontti.com.br/wp-content/uploads/2021/02/c7-1-1024x965.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2021/02/c7-1-768x724.png 768w, https://blog.remontti.com.br/wp-content/uploads/2021/02/c7-1-1536x1447.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a></p>
<p>Para deixar mais profissional <a href="https://blog.remontti.com.br/3548" rel="noopener" target="_blank">instale o Let’s Encrypt</a> para assinar seu domínio.</p>
<p>Espero que tenha gostado!</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></p>
<p>Participe do canal no <a href="https://t.me/blogremontti" rel="noopener noreferrer" target="_blank">telegram</a> para ficar atualizado sempre que publicar um novo tutorial. </p>
<p>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><em>Fontes</em><br />
<a href="https://docs.cachethq.io/" rel="noopener" target="_blank">https://docs.cachethq.io/</a><br />
<a href="https://github.com/CachetHQ/Cachet" rel="noopener" target="_blank">https://github.com/CachetHQ/Cachet</a></p>
<p>O post <a href="https://blog.remontti.com.br/5296">Instalando o Cachet um sistema de página de status open source</a> apareceu primeiro em <a href="https://blog.remontti.com.br">Remontti</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.remontti.com.br/5296/feed</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
			</item>
		<item>
		<title>Crie seu próprio &#8220;SpeedTest&#8221; utilizando o projeto librespeed</title>
		<link>https://blog.remontti.com.br/4286</link>
					<comments>https://blog.remontti.com.br/4286#comments</comments>
		
		<dc:creator><![CDATA[Rudimar Remontti]]></dc:creator>
		<pubDate>Wed, 08 Apr 2020 23:54:57 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutoriais]]></category>
		<category><![CDATA[apache2]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[local test]]></category>
		<category><![CDATA[speedtest]]></category>
		<category><![CDATA[test]]></category>
		<category><![CDATA[testador]]></category>
		<category><![CDATA[teste local]]></category>
		<guid isPermaLink="false">https://blog.remontti.com.br/?p=4286</guid>

					<description><![CDATA[<p>Neste tutorial você irá aprender a criar seu próprio testador de velocidade independente. Precisaremos apenas um serviço web como Apache, PHP e MariaDB/MySQL. Para este teste usei o projeto librespeed qual fiz um fork&#46;&#46;&#46;</p>
<p>O post <a href="https://blog.remontti.com.br/4286">Crie seu próprio &#8220;SpeedTest&#8221; utilizando o projeto librespeed</a> apareceu primeiro em <a href="https://blog.remontti.com.br">Remontti</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Neste tutorial você irá aprender a criar seu próprio testador de velocidade independente. Precisaremos apenas um serviço web como Apache, PHP e MariaDB/MySQL. Para este teste usei o projeto <a href="https://github.com/librespeed/speedtest">librespeed</a> qual fiz um <a href="https://github.com/remontti/speedtest" rel="noopener noreferrer" target="_blank">fork</a> fazendo algumas modificações, principalmente no visual dele. </p>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2020/04/capa_speedtest_local.png" data-rel="lightbox-gallery-Ms1kS8h9" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/04/capa_speedtest_local.png" alt="" width="716" height="340" class="aligncenter size-full wp-image-4297" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/04/capa_speedtest_local.png 716w, https://blog.remontti.com.br/wp-content/uploads/2020/04/capa_speedtest_local-300x142.png 300w" sizes="auto, (max-width: 716px) 100vw, 716px" /></a></p>
<p>Basicamente a instalação é criar o banco e a tabela, jogar os arquivos para dentro do seu servidor web e editar o arquivo que fará a conexão com o banco.</p>
<p>Mas como sempre vamos começar do zero, e já começo com o que temos de mais recente como &#8220;requisitos&#8221;:</p>
<p><a href="https://blog.remontti.com.br/2966" rel="noopener noreferrer" target="_blank">Debian 10 Stretch / Instalação Limpa</a><br />
<a href="https://blog.remontti.com.br/3006" rel="noopener noreferrer" target="_blank">Passo-a-passo como criar um servidor WEB Apache + PHP + MariaDB + phpMyAdmin no Debian 10 Buster “LAMP”</a><br />
phpMyAdmin :: (<strong>Opcional</strong>)</p>
<p>Requisitos instalados prosseguimos!</p>
<p>No exemplo vou configurar o apache para librespeed.remontti.com.br, logo é necessário configurar seu subdomínio “librespeed” (ou nome da sua escolha) em seu <a href="https://blog.remontti.com.br/3086" rel="noopener noreferrer" target="_blank">DNS Server</a>.</p>
<pre class="remontti-code-plain">Exemplo:
...
librespeed       A       250.250.250.5
                 AAAA    2001:db8:bebe:cafe::5
...</pre>
<p>Por segurança recomendo remover a assinatura do servidor, evitando os &#8220;espertinhos&#8221;</p>
<pre class="remontti-code"># sed -i &#039;s/ServerTokens OS/ServerTokens Prod/&#039; /etc/apache2/conf-available/security.conf
# sed -i &#039;s/ServerSignature On/ServerSignature Off/&#039; /etc/apache2/conf-available/security.conf</pre>
<p>Crie o arquivo de configuração do apache para o &#8220;librespeed.remontti.com.br&#8221;</p>
<pre class="remontti-code"># vim /etc/apache2/sites-available/librespeed.conf</pre>
<pre class="remontti-code">&lt;virtualhost *:80&gt;
        ServerName librespeed.remontti.com.br
        ServerAdmin noc@remontti.com.br
        DocumentRoot /var/www/librespeed 
        &lt;directory /var/www/librespeed/ &gt;
                Options FollowSymLinks
                AllowOverride All
        &lt;/directory&gt; 
        LogLevel warn 
        ErrorLog ${APACHE_LOG_DIR}/error_librespeed.log
        CustomLog ${APACHE_LOG_DIR}/access_librespeed.log combined
&lt;/virtualhost&gt;</pre>
<p>Vamos criar nosso diretório raiz (/var/www/librespeed):</p>
<pre class="remontti-code"># mkdir /var/www/librespeed/</pre>
<p>Ativamos o arquivo librespeed.conf e restartamos o apache2</p>
<pre class="remontti-code"># a2ensite librespeed
# systemctl restart apache2</pre>
<p>Recomendo que você crie um certificado válido para acessar seu endereço com HTTPS. Veja como acessando o tutorial: <a href="https://blog.remontti.com.br/3548" rel="noopener noreferrer" target="_blank">Criando certificado grátis com Let’s Encrypt para o Apache no Debian 10</a></p>
<p>Vamos acessar o banco de dados e criar nosso banco de dados e nosso usuário para acessa-lo. </p>
<pre class="remontti-code"># mariadb -p </pre>
<p>Altere o campo <strong>SUA_SENHA</strong></p>
<pre class="remontti-code">CREATE DATABASE librespeed;
GRANT ALL PRIVILEGES ON librespeed.* TO &#039;librespeed&#039;@&#039;localhost&#039; IDENTIFIED BY &#039;SUA_SENHA&#039;;
FLUSH PRIVILEGES;
quit;</pre>
<p>Acesse novamente o banco de dados com o usuário <strong>librespeed</strong></p>
<pre class="remontti-code"># mariadb -p -u librespeed</pre>
<p>Criamos a tabela <strong>speedtest_users</strong> que irá registrar todos os testes.</p>
<pre class="remontti-code">USE librespeed;

CREATE TABLE `speedtest_users` (
  `id` int(11) NOT NULL,
  `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `ip` text NOT NULL,
  `ispinfo` text,
  `extra` text,
  `ua` text NOT NULL,
  `lang` text NOT NULL,
  `dl` text,
  `ul` text,
  `ping` text,
  `jitter` text,
  `log` longtext
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

ALTER TABLE `speedtest_users`
  ADD PRIMARY KEY (`id`);

ALTER TABLE `speedtest_users`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;COMMIT;

show tables;</pre>
<p>Vamos baixar o <a href="https://github.com/remontti/speedtest/" rel="noopener noreferrer" target="_blank">projeto que modifiquei</a>. Vale lembrar que o projeto tem outras coisas interessantes como desenvolvimento para app para <a href="https://github.com/librespeed/speedtest-android" rel="noopener noreferrer" target="_blank">android</a>, testador para múltiplos hosts.</p>
<pre class="remontti-code"># apt install unzip wget
# cd /tmp
# wget https://github.com/remontti/speedtest/archive/master.zip
# unzip /tmp/master.zip
# mv /tmp/speedtest-master/versao_remontti/* /var/www/librespeed/</pre>
<p>Edite o arquivo <strong>telemetry_settings.php</strong> para definir a senha de acesso das estatísticas (stats.php) e a senha do usuário do banco de dados. </p>
<pre class="remontti-code"># vim /var/www/librespeed/results/telemetry_settings.php</pre>
<p>Altere:</p>
<pre class="remontti-code">[...]
$stats_password=&quot;PASSWORD&quot;; // Senha para acesso do stats.php
[...]
$MySql_password=&quot;SUA_SENHA&quot;; // Senha que você definiu para o banco de dados
[...]</pre>
<p>Agora basta você acessar seu: <strong>&#8220;librespeed.dominio.com.br&#8221;</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/04/librespeed-1.png" data-rel="lightbox-gallery-Ms1kS8h9" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/04/librespeed-1.png" alt="" width="1182" height="588" class="alignnone size-full wp-image-4299" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/04/librespeed-1.png 1182w, https://blog.remontti.com.br/wp-content/uploads/2020/04/librespeed-1-300x149.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/04/librespeed-1-1024x509.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/04/librespeed-1-768x382.png 768w" sizes="auto, (max-width: 1182px) 100vw, 1182px" /></a></p>
<p>Para acessar as estatísticas dos testes realizados acesse: <strong>librespeed.dominio.com.br/results/stats.php</strong><br />
Entre com a senha que setou em stats_password:<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/04/adm.png" data-rel="lightbox-gallery-Ms1kS8h9" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/04/adm.png" alt="" width="1182" height="246" class="alignnone size-full wp-image-4293" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/04/adm.png 1182w, https://blog.remontti.com.br/wp-content/uploads/2020/04/adm-300x62.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/04/adm-1024x213.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/04/adm-768x160.png 768w" sizes="auto, (max-width: 1182px) 100vw, 1182px" /></a></p>
<p>Tenha acesso a todos os resultados feitos em seu servidor:<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/04/adm_results.png" data-rel="lightbox-gallery-Ms1kS8h9" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/04/adm_results.png" alt="" width="1161" height="598" class="alignnone size-full wp-image-4295" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/04/adm_results.png 1161w, https://blog.remontti.com.br/wp-content/uploads/2020/04/adm_results-300x155.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/04/adm_results-1024x527.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/04/adm_results-768x396.png 768w" sizes="auto, (max-width: 1161px) 100vw, 1161px" /></a></p>
<p>Para colocar seu logo basta editar o arquivo <strong>index.html</strong> e remova o comentário na linha 315 `&lt;!&#8211; &#8211;&gt;` ajuste como achar melhor.</p>
<p>Gostou? Ficou feliz com seu novo testador? </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></p>
<p>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>Abraço!</p>
<p>O post <a href="https://blog.remontti.com.br/4286">Crie seu próprio &#8220;SpeedTest&#8221; utilizando o projeto librespeed</a> apareceu primeiro em <a href="https://blog.remontti.com.br">Remontti</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.remontti.com.br/4286/feed</wfw:commentRss>
			<slash:comments>38</slash:comments>
		
		
			</item>
		<item>
		<title>Instalação do Zabbix 4.4 no Debian 10 Buster</title>
		<link>https://blog.remontti.com.br/3995</link>
					<comments>https://blog.remontti.com.br/3995#comments</comments>
		
		<dc:creator><![CDATA[Rudimar Remontti]]></dc:creator>
		<pubDate>Sat, 08 Feb 2020 18:30:27 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutoriais]]></category>
		<category><![CDATA[apache2]]></category>
		<category><![CDATA[MariaDB]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[php7.3]]></category>
		<category><![CDATA[telegram]]></category>
		<category><![CDATA[zabbix]]></category>
		<category><![CDATA[zabbix 4.4]]></category>
		<category><![CDATA[zabbix-frontend-php]]></category>
		<category><![CDATA[zabbix4]]></category>
		<guid isPermaLink="false">https://blog.remontti.com.br/?p=3995</guid>

					<description><![CDATA[<p>O Zabbix é uma solução de nível enterprise, de código aberto. O Zabbix é um software que monitora vários parâmetros da rede, dos servidores e da saúde dos serviços. Utiliza-se de um mecanismo flexível&#46;&#46;&#46;</p>
<p>O post <a href="https://blog.remontti.com.br/3995">Instalação do Zabbix 4.4 no Debian 10 Buster</a> apareceu primeiro em <a href="https://blog.remontti.com.br">Remontti</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>O Zabbix é uma solução de nível enterprise, de código aberto. O Zabbix é um software que monitora vários parâmetros da rede, dos servidores e da saúde dos serviços. Utiliza-se de um mecanismo flexível de notificação que permite configurar alertas por e-mail entre outros como Telegram, para praticamente qualquer evento. As notificações permitem que se reaja rapidamente à problemas no ambiente. O Zabbix oferece excelentes recursos de relatórios e visualização de dados armazenados. Isso faz com que o Zabbix seja a ferramenta ideal para planejamento de capacidade.</p>
<p>Requisitos:<br />
<a href="https://blog.remontti.com.br/2966" rel="noopener noreferrer" target="_blank">* Debian 10 (Buster) -> Instalação Limpa</a><br />
<a href="https://blog.remontti.com.br/3006" rel="noopener noreferrer" target="_blank">* Passo-a-passo como criar um servidor WEB Apache + PHP + MariaDB + phpMyAdmin no Debian 10 Buster &#8220;LAMP&#8221;</a></p>
<p>Para instalação do Zabbix vamos incluir o repositório do oficial do Zabbix.</p>
<pre class="remontti-code"># su -
# cd /tmp</pre>
<p>Versão 4.4</strong></p>
<pre class="remontti-code"># wget https://repo.zabbix.com/zabbix/4.4/debian/pool/main/z/zabbix-release/zabbix-release_4.4-1+buster_all.deb
# dpkg -i zabbix-release_4.4-1+buster_all.deb</pre>
<p>Atualize o repositório e realize a instalação </p>
<pre class="remontti-code"># apt update ; apt upgrade
# apt install zabbix-server-mysql zabbix-frontend-php zabbix-agent</pre>
<p>Vamos criar uma base de dados chamada <strong>zabbix</strong> e um usuário também chamado de zabbix no MariaDB.<br />
Não esqueça de alterar a senha: Use o gerador de senha: <a href="https://senhasegura.remontti.com.br/" rel="noopener noreferrer" target="_blank">https://senhasegura.remontti.com.br/</a></p>
<pre class="remontti-code"># mariadb -u root -p</pre>
<pre class="remontti-code">CREATE DATABASE zabbix CHARACTER SET utf8 collate utf8_bin;
GRANT ALL PRIVILEGES ON zabbix.* TO zabbix@localhost IDENTIFIED BY &#039;SUA_SENHA&#039;;
FLUSH PRIVILEGES;
EXIT;</pre>
<p>Importe o esquema de tabelas e dados padrões. (Demora um pouco!)</p>
<pre class="remontti-code"># zcat /usr/share/doc/zabbix-server-mysql/create.sql.gz | mysql -uzabbix -p zabbix</pre>
<p>Digite a senha de seu usuário zabbix criada no passo anterior para importar as tabelas.</p>
<p>Edite o arquivo zabbix_server.conf para informar os dados para conexão com o MySQL.</p>
<pre class="remontti-code"># vim /etc/zabbix/zabbix_server.conf</pre>
<p>Procure por <strong># DBPassword=</strong> descomente e sete sua senha.</p>
<pre class="remontti-code">#...
DBPassword=SUA_SENHA
#...</pre>
<p>Parece que na versão 4.4 esqueceram do arquivo do apache (pelo menos até hj) então será necessário cria-lo.</p>
<pre class="remontti-code"># vim /etc/zabbix/apache.conf</pre>
<p>Ajuste o <a href="https://secure.php.net/manual/pt_BR/timezones.america.php" rel="noopener noreferrer" target="_blank">timezone</a> pela sua região</a>.</p>
<pre class="remontti-code">&lt;IfModule mod_alias.c&gt;
    Alias /zabbix /usr/share/zabbix
&lt;/IfModule&gt;

&lt;Directory &quot;/usr/share/zabbix&quot;&gt;
    Options FollowSymLinks
    AllowOverride None
   # Se quiser limitar apenas o acesso a alguns ips da rede
   # AllowOverride all
   # Require ip 127.0.0.1 ::1 200.200.200.192/29 2001:db8:bebe::/48

    &lt;IfModule mod_php7.c&gt;
        php_value max_execution_time 300
        php_value memory_limit 512M
        php_value post_max_size 100M
        php_value upload_max_filesize 80M
        php_value max_input_time 300
        php_value max_input_vars 10000
        php_value always_populate_raw_post_data -1
        php_value date.timezone America/Sao_Paulo
    &lt;/IfModule&gt;
&lt;/Directory&gt;

&lt;Directory &quot;/usr/share/zabbix/conf&quot;&gt;
    Order deny,allow
    Deny from all
    &lt;files *.php&gt;
        Order deny,allow
        Deny from all
    &lt;/files&gt;
&lt;/Directory&gt;

&lt;Directory &quot;/usr/share/zabbix/app&quot;&gt;
    Order deny,allow
    Deny from all
    &lt;files *.php&gt;
        Order deny,allow
        Deny from all
    &lt;/files&gt;
&lt;/Directory&gt;

&lt;Directory &quot;/usr/share/zabbix/include&quot;&gt;
    Order deny,allow
    Deny from all
    &lt;files *.php&gt;
        Order deny,allow
        Deny from all
    &lt;/files&gt;
&lt;/Directory&gt;

&lt;Directory &quot;/usr/share/zabbix/local&quot;&gt;
    Order deny,allow
    Deny from all
    &lt;files *.php&gt;
        Order deny,allow
        Deny from all
    &lt;/files&gt;
&lt;/Directory&gt;
</pre>
<p>Por segurança recomendo remover a assinatura do servidor, evitando os &#8220;espertinhos&#8221;</p>
<pre class="remontti-code"># sed -i &#039;s/ServerTokens OS/ServerTokens Prod/&#039; /etc/apache2/conf-available/security.conf
# sed -i &#039;s/ServerSignature On/ServerSignature Off/&#039; /etc/apache2/conf-available/security.conf</pre>
<p>Lincamos as configurações e restartamos o apache.</p>
<pre class="remontti-code"># ln -s /etc/zabbix/apache.conf /etc/apache2/conf-available/zabbix.conf
# a2enconf zabbix 
# systemctl restart apache2</pre>
<p>Iniciando o Zabbix Server e Agente junto com a inicialização do sistema.</p>
<pre class="remontti-code"># systemctl enable zabbix-server zabbix-agent
# systemctl restart zabbix-server zabbix-agent</pre>
<p>Acesse em seu navegador http://seu_ip/zabbix</p>
<p>Next Step<br />
<div id="attachment_3999" style="width: 1690px" class="wp-caption alignnone"><a href="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster.png" data-rel="lightbox-gallery-ObZnmF7T" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3999" src="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster.png" alt="" width="1680" height="875" class="size-full wp-image-3999" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster-300x156.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster-1024x533.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster-768x400.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster-1536x800.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a><p id="caption-attachment-3999" class="wp-caption-text">Next Step</p></div></p>
<p>Se tudo estiver ok: Next step<br />
<div id="attachment_4000" style="width: 1690px" class="wp-caption alignnone"><a href="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check.png" data-rel="lightbox-gallery-ObZnmF7T" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4000" src="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check.png" alt="" width="1680" height="1316" class="size-full wp-image-4000" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check-300x235.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check-1024x802.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check-768x602.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check-1536x1203.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a><p id="caption-attachment-4000" class="wp-caption-text">Se tudo estiver ok: Next step</p></div></p>
<p>Informe a senha do banco de dados criada anteriormente para o zabbix, e clique em Next step.<br />
<div id="attachment_4001" style="width: 1690px" class="wp-caption alignnone"><a href="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check1.png" data-rel="lightbox-gallery-ObZnmF7T" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4001" src="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check1.png" alt="" width="1680" height="826" class="size-full wp-image-4001" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check1.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check1-300x148.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check1-1024x503.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check1-768x378.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check1-1536x755.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a><p id="caption-attachment-4001" class="wp-caption-text">Informe a senha do banco de dados criada anteriormente para o zabbix, e clique em Next step.</p></div></p>
<p>Next step<br />
<div id="attachment_4002" style="width: 1690px" class="wp-caption alignnone"><a href="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check2.png" data-rel="lightbox-gallery-ObZnmF7T" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4002" src="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check2.png" alt="" width="1680" height="826" class="size-full wp-image-4002" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check2.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check2-300x148.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check2-1024x503.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check2-768x378.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check2-1536x755.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a><p id="caption-attachment-4002" class="wp-caption-text">Next step</p></div></p>
<p>Next step<br />
<div id="attachment_4003" style="width: 1690px" class="wp-caption alignnone"><a href="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check3.png" data-rel="lightbox-gallery-ObZnmF7T" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4003" src="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check3.png" alt="" width="1680" height="826" class="size-full wp-image-4003" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check3.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check3-300x148.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check3-1024x503.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check3-768x378.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check3-1536x755.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a><p id="caption-attachment-4003" class="wp-caption-text">Next step</p></div></p>
<p>Next step<br />
<div id="attachment_4004" style="width: 1690px" class="wp-caption alignnone"><a href="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check4.png" data-rel="lightbox-gallery-ObZnmF7T" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4004" src="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check4.png" alt="" width="1680" height="826" class="size-full wp-image-4004" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check4.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check4-300x148.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check4-1024x503.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check4-768x378.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check4-1536x755.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a><p id="caption-attachment-4004" class="wp-caption-text">Next step</p></div></p>
<p>Entre com Usuário <strong>Admin</strong> e senha <strong>zabbix</strong><br />
<div id="attachmeEntrecomUsurioAdminesenhaZabbixnt_4005" style="width: 1690px" class="wp-caption alignnone"><a href="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check5.png" data-rel="lightbox-gallery-ObZnmF7T" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" aria-describedby="caption-attachmeEntrecomUsurioAdminesenhaZabbixnt-4005" src="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check5.png" alt="" width="1680" height="826" class="size-full wp-image-4005" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check5.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check5-300x148.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check5-1024x503.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check5-768x378.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check5-1536x755.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a><p id="caption-attachmeEntrecomUsurioAdminesenhaZabbixnt-4005" class="wp-caption-text">Entre com Usuário Admin e senha zabbix</p></div></p>
<p>Para trocar o idioma para português, clique no ícone no canto direito superior no &#8220;bonequinho&#8221;<br />
<div id="attachment_4007" style="width: 1690px" class="wp-caption alignnone"><a href="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check6.png" data-rel="lightbox-gallery-ObZnmF7T" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4007" src="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check6.png" alt="" width="1680" height="1199" class="size-full wp-image-4007" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check6.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check6-300x214.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check6-1024x731.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check6-768x548.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check6-1536x1096.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a><p id="caption-attachment-4007" class="wp-caption-text">Para trocar o idioma para português, clique no ícone no canto direito superior no &#8220;bonequinho&#8221;</p></div></p>
<p>Selecione Português<br />
<div id="attachment_4008" style="width: 1690px" class="wp-caption alignnone"><a href="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_portugues.png" data-rel="lightbox-gallery-ObZnmF7T" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4008" src="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_portugues.png" alt="" width="1680" height="826" class="size-full wp-image-4008" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_portugues.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_portugues-300x148.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_portugues-1024x503.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_portugues-768x378.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_portugues-1536x755.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a><p id="caption-attachment-4008" class="wp-caption-text">Selecione Português</p></div></p>
<p>Seu Zabbix agora está em PT-BR<br />
<div id="attachment_4009" style="width: 1690px" class="wp-caption alignnone"><a href="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_portugues1.png" data-rel="lightbox-gallery-ObZnmF7T" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4009" src="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_portugues1.png" alt="" width="1680" height="1241" class="size-full wp-image-4009" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_portugues1.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_portugues1-300x222.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_portugues1-1024x756.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_portugues1-768x567.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_portugues1-1536x1135.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a><p id="caption-attachment-4009" class="wp-caption-text">Seu Zabbix agora está em PT-BR</p></div></p>
<p>Você pode gostar de integra-lo com o telegram:<br />
<a href="https://blog.remontti.com.br/3053" rel="noopener noreferrer" target="_blank">Zabbix 4 + Alertas no Telegram via Bot</a><br />
<a href="https://blog.remontti.com.br/4014" rel="noopener noreferrer" target="_blank">Instalação do Grafana e integrando com Zabbix 4</a></p>
<h3>Script de Backup</h1>
<p><a href="https://github.com/remontti/zabbix-backup" rel="noopener noreferrer" target="_blank">https://github.com/remontti/zabbix-backup</a></p>
<p>Este script backup script tem suporte ao (MariadB/MySQL/PostgreSQL) e não salva o históricos, tornado um backup rápido e salvando somente o necessário. </p>
<p>Baixe o script (em um diretório de sua escolha)</p>
<pre class="remontti-code"># wget https://raw.githubusercontent.com/remontti/zabbix-backup/master/zabbix-dump</pre>
<p>De permissão de execução: </p>
<pre class="remontti-code"># chmod +x zabbix-dump</pre>
<p>Execute</p>
<pre class="remontti-code"># ./zabbix-dump</pre>
<p>Ele irá gerar um arquivo <strong>zabbix_cfg_localhost_202XXXXX-XXXX_db-mysql-4.x.x.sql.gz</strong> basta você copia-lo ou criar uma rotina que rode o script e envie para seu servidor de backup&#8230; (seja criativo) <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;" /></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></p>
<p>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>Abraço!</p>
<p>Fontes:<br />
<a href="https://www.zabbix.com/documentation/" rel="noopener noreferrer" target="_blank">https://www.zabbix.com/documentation/</a></p>
<p>O post <a href="https://blog.remontti.com.br/3995">Instalação do Zabbix 4.4 no Debian 10 Buster</a> apareceu primeiro em <a href="https://blog.remontti.com.br">Remontti</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.remontti.com.br/3995/feed</wfw:commentRss>
			<slash:comments>13</slash:comments>
		
		
			</item>
		<item>
		<title>Como ter diversos sub/domínios no mesmo servidor? (Domínios virtuais com Apache2)</title>
		<link>https://blog.remontti.com.br/3464</link>
					<comments>https://blog.remontti.com.br/3464#comments</comments>
		
		<dc:creator><![CDATA[Rudimar Remontti]]></dc:creator>
		<pubDate>Fri, 23 Aug 2019 19:47:44 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutoriais]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[apache2]]></category>
		<category><![CDATA[autenticação]]></category>
		<category><![CDATA[auth]]></category>
		<category><![CDATA[virtualhost]]></category>
		<guid isPermaLink="false">https://blog.remontti.com.br/?p=3464</guid>

					<description><![CDATA[<p>Neste tutorial você vai aprender como configurar vários domínios no mesmo servidor, bem como aplicar medidas simples de segurança. Vou utilizar a distribuição mais recente do Debian 10 como o tutorial LAMP, e claro&#46;&#46;&#46;</p>
<p>O post <a href="https://blog.remontti.com.br/3464">Como ter diversos sub/domínios no mesmo servidor? (Domínios virtuais com Apache2)</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/2019/08/capa_apache_dominios_virtuais.png" alt="" width="720" height="340" class="alignnone size-full wp-image-3490" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/08/capa_apache_dominios_virtuais.png 720w, https://blog.remontti.com.br/wp-content/uploads/2019/08/capa_apache_dominios_virtuais-300x142.png 300w, https://blog.remontti.com.br/wp-content/uploads/2019/08/capa_apache_dominios_virtuais-520x245.png 520w" sizes="auto, (max-width: 720px) 100vw, 720px" /></p>
<p>Neste tutorial você vai aprender como configurar vários domínios no mesmo servidor, bem como aplicar medidas simples de segurança.</p>
<p>Vou utilizar a distribuição mais recente do <a href="http://ftp.br.debian.org/debian-cd/current/amd64/iso-cd/" rel="noopener noreferrer" target="_blank">Debian 10</a> como o tutorial LAMP, e claro que antes de mais nada você precisa ter seu DNS configurado com seus subdomínios (hosts) apontando para o IP do seu servidor WEB. logo nossos requezitos são:<br />
&#8211; <a href="https://blog.remontti.com.br/2966" rel="noopener noreferrer" target="_blank">Instalação Debian 10 Buster LIMPA Passo-a-passo</a><br />
&#8211; <a href="https://blog.remontti.com.br/3086" rel="noopener noreferrer" target="_blank">Servidor DNS seguro com Bind9 (Recursivo, Autoritativo e Reverso) + Fail2ban + nftables no Debian 10 Buster</a><br />
&#8211; <a href="https://blog.remontti.com.br/3006" rel="noopener noreferrer" target="_blank">Passo-a-passo como criar um servidor WEB Apache + PHP + MariaDB + phpMyAdmin no Debian 10 Buster &#8220;LAMP&#8221;</a></p>
<p>No nossos exemplos vou configurar 4 subdomínios <strong>www</strong>, <strong><a href="https://blog.remontti.com.br/3218" rel="noopener noreferrer" target="_blank">teste</a></strong>, <strong><a href="https://blog.remontti.com.br/2401" rel="noopener noreferrer" target="_blank">phpipam</a></strong> e <strong>sistema</strong>. Com a ideia que seja um nosso site, um testador de banda, nosso querido phpipam onde documentamos os ips da nossa rede e sistema um subdomínio que vai ter alguma &#8220;sistema  web qualquer&#8221;. </p>
<p>Tenha então em seu arquivo da configuração DNS autoritativa ( ex /var/cache/bind/master-aut/seudominio.net.br.hosts) seus subdomínios apontados, no nosso ex os IPs seriam o 45.80.50.2 e 2804:f123:bebe:cafe::2</p>
<pre class="remontti-code">www         A       45.80.50.2
            AAAA    2804:f123:bebe:cafe::2
teste       A       45.80.50.2
            AAAA    2804:f123:bebe:cafe::2
phpipam     A       45.80.50.2
            AAAA    2804:f123:bebe:cafe::2
sistema     A       45.80.50.2
            AAAA    2804:f123:bebe:cafe::2</pre>
<p>Com seu Apache já instalado vamos algumas informações que são necessárias saber. O Apache mantém seus arquivos de configuração dentro da pasta /etc/apache2:</p>
<pre class="remontti-code">/etc/apache2
├── conf-available
│   └── *.conf
├── conf-available
│   └── *.conf
├── conf-enabled
│   └── *.conf
├── mods-available
│   └── *.load
├── mods-enabled
│   └── *.load
├── sites-available
│   └── *.conf
├── sites-enabled
│   └── *.conf
├── apache2.conf 
├── magic
├── envvars
├── ports.conf</pre>
<p>Há vários arquivos de texto simples e alguns subdiretórios de forma bem organizada e objetiva, os principais são:</p>
<p><strong>apache2.conf</strong>: Este é o arquivo de configuração principal do servidor. Quase toda a configuração pode ser feita dentro desse arquivo, embora seja recomendado usar arquivos separados e designados para simplificar. Este arquivo irá configurar os padrões e ser o ponto central de acesso para o servidor ler os detalhes da configuração.</p>
<p><strong>ports.conf</strong>: Este arquivo é usado para especificar as portas nas quais os hosts devem ouvir.</p>
<p><strong>conf-[available, enabled]</strong>/: Este diretório é usado para controlar aspectos específicos da configuração do Apache. Por exemplo, costuma ser usado para definir opções de segurança.</p>
<p><strong>sites-[available-enabled]</strong>/: este diretório contém todos os arquivos de hosts virtuais que definem cada subdmínio. Eles estabelecerão qual conteúdo será exibido para quais solicitações.</p>
<p><strong>mods-[available, enabled]</strong>/: Esses diretórios são semelhantes em função aos diretórios de sites, mas eles definem módulos que podem ser carregados opcionalmente. </p>
<p>Como você pode ver alguns diretórios encontramos available e enabled, como o próprio nome diz o que esta em available são as configurações disponíveis e em enabled as configurações ativas. As configurações do Apache não ocorre em um único arquivo mas acontece através de um design modular onde novos arquivos podem ser adicionados e modificados conforme necessário.</p>
<p>Normalmente você após instalar o apache &#8220;corre&#8221; para o navegador e digita o endereço do seu IP para ver se seu servidor esta funcionando.<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2019/08/apache-default-page.png" data-rel="lightbox-gallery-v0FOyJfs" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/08/apache-default-page-198x300.png" alt="" width="198" height="300" class="alignnone size-medium wp-image-3473" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/08/apache-default-page-198x300.png 198w, https://blog.remontti.com.br/wp-content/uploads/2019/08/apache-default-page-768x1161.png 768w, https://blog.remontti.com.br/wp-content/uploads/2019/08/apache-default-page-677x1024.png 677w, https://blog.remontti.com.br/wp-content/uploads/2019/08/apache-default-page.png 818w" sizes="auto, (max-width: 198px) 100vw, 198px" /></a><br />
Mas agora que você conhece um pouquinho mais da arquitetura do diretório apache que tal saber porque ele mostra essa pagina default ao abrir seu IP no navegador? </p>
<p>Logo se é algo que esta carregando web deve estar dentro do diretório <strong>/etc/apache2/sites-enabled/</strong> e é la que encontramos o <strong>000-default.conf</strong> abra o mesmo e veja como ele é configurado</p>
<pre class="remontti-code"># vim /etc/apache2/sites-enabled/000-default.conf</pre>
<p>Esse é seu arquivo de configuração default</p>
<pre class="remontti-code">&lt;VirtualHost *:80&gt;
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request&#039;s Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.
        #ServerName www.example.com

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with &quot;a2disconf&quot;.
        #Include conf-available/serve-cgi-bin.conf
&lt;/VirtualHost&gt;</pre>
<p><strong>VirtualHost *:80</strong> &#8211; Temos então nosso &#8220;primeiro e único&#8221; até o momento domínio virtual. Perceba q <strong>*:80</strong> quer dizer qlqr ip na porta 80, entao se você tiver diversos endereços ips no mesmo servidor ele sempre vai interpretar. Se você tá experto notou o ServerName comentado, é ele que configuramos nossos hosts, logo se o mesmo não tem nenhum ServerName configurado o apache entende que tudo que jogarem para ele na porta 80 ele carregue essa pagina default, neste momento os 4 subdomínios vão esta carregando a mesma pagina. </p>
<p><strong>ServerAdmin</strong> &#8211; E-mail do administrador </p>
<p>DocumentRoot &#8211; Diretório onde fica os arquivos. Padrão da instalação é o <strong>/var/www/html</strong> onde encontramos uma <strong>index.html</strong> que se você editar vai descobrir que é aquela página default. Vale lembrar que sempre que o arquivo se chamar index.html/php ele vai ser carregado ao acessar aquele diretório.</p>
<p><strong>ErrorLog</strong> &#8211; Local onde ele vai registrar o logs de erros.</p>
<p><strong>CustomLog</strong> &#8211; local onde guardará os logs de acesso.</p>
<p>Para cada subdomínio (host) vou criar um diretório novo dentro de /var/www/ e para ficar bem objetivo darei o nome da pasta o mesmo do host:</p>
<pre class="remontti-code">/var/www/
├── www/
│   └── *.html
│   └── *.php
│   └── *.*
├── teste
│   └── *.*
├── phpipam
│   └── *.*
├── sistema
│   └── *.*</pre>
<p>Criamos os diretórios </p>
<pre class="remontti-code"># mkdir -p /var/www/{www,teste,phpipam,sistema}</pre>
<p>Se ainda não habilitou o mod_rewrite vamos habilitar, o mesmo utiliza um mecanismo baseado em regras de reescrita, ex o wordpress e phpipam usam o mesmo.</p>
<p>Vamos ao comando para habilita-lo:</p>
<pre class="remontti-code"># a2enmod rewrite</pre>
<p>Nosso primeiro arquivo vai representar o host <strong>www</strong>, ele vai ficar em <strong>sites-available</strong> ou seja ainda não está ativo (enable) e mais uma vez para ser objetivo vai ter o mesmo nome do host, porém ele deve terminar com <strong>.conf</strong>, logo <strong>www.conf</strong></p>
<pre class="remontti-code"># vim /etc/apache2/sites-available/www.conf</pre>
<p>Agora vamos ter dois caras novos <strong>ServerName</strong> e <strong>ServerAlias</strong> qual vai esta apontando para nossos domínios. Como o ServerAlias pode ser apontado para diversos hosts.</p>
<pre class="remontti-code">&lt;virtualhost *:80&gt;
        ServerName remontti.com.br
        ServerAlias www.remontti.com.br
        ServerAdmin noc@remontti.com.br

        DocumentRoot /var/www/www 

        &lt;directory /var/www/www/ &gt;
                Options FollowSymLinks
                AllowOverride All
        &lt;/directory&gt; 

        LogLevel warn 
        ErrorLog ${APACHE_LOG_DIR}/error_www.log
        CustomLog ${APACHE_LOG_DIR}/access_www.log combined
&lt;/virtualhost&gt;</pre>
<p>Note que em ErrorLog e CustomLog eu adicionei um _www junto para que no log tenha apenas informações desse host. </p>
<p>Hora de habilitar! Usamos o comando <strong>a2ensite</strong> ele vai pegar o arquivo www.conf da pasta sites-available e criar um atalho dentro de sites-enabled</p>
<pre class="remontti-code"># a2ensite www</pre>
<p>Para que as novas configurações do apache tenham efeito é necessário restartar o apache.</p>
<pre class="remontti-code"># systemctl restart apache2</pre>
<p>Para o Host teste vai ser o mesmo procedimento, porém em Options vou colocar o valor `Indexes`, para que o mesmo me liste os diretórios sem arquivos index, é recomendado que você não utilize pois vou demonstrar a frente uma tela por isso estou deixando ele. Para um cenario real deixe apenas `Options FollowSymLinks`</p>
<pre class="remontti-code"># vim /etc/apache2/sites-available/teste.conf</pre>
<pre class="remontti-code">&lt;virtualhost *:80&gt;
        ServerName teste.remontti.com.br
        ServerAdmin noc@remontti.com.br

        DocumentRoot /var/www/teste 

        &lt;directory /var/www/teste/ &gt;
                Options Indexes FollowSymLinks
                AllowOverride All
        &lt;/directory&gt; 

        LogLevel warn 
        ErrorLog ${APACHE_LOG_DIR}/error_teste.log
        CustomLog ${APACHE_LOG_DIR}/access_teste.log combined
&lt;/virtualhost&gt;</pre>
<pre class="remontti-code"># a2ensite teste
# systemctl restart apache2</pre>
<p>Você já será capas de acessar os dois host tendo paginas diferentes.</p>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-index-of.png" data-rel="lightbox-gallery-v0FOyJfs" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-index-of-300x202.png" alt="" width="300" height="202" class="alignnone size-medium wp-image-3237" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-index-of-300x202.png 300w, https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-index-of-768x518.png 768w, https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-index-of.png 829w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>Antes de prosseguir tem um detalhe que eu particularmente não gosto de deixar quaquer um ficar sabendo o que esta rodando e versões:<br />
<em>“Apache/2.4.38 (Debian) Server at teste.remontti.com.br Port 80”.</em><br />
Por segurança recomendo remover a assinatura do servidor, para isso  edite:</p>
<pre class="remontti-code"># vim /etc/apache2/conf-enabled/security.conf</pre>
<p>Altere as variáveis:<br />
ServerTokens <strong>Prod</strong><br />
ServerSignature <strong>Off</strong></p>
<p>Restar o apache2</p>
<pre class="remontti-code"># systemctl restart apache2</pre>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-index-of-nosig.png" data-rel="lightbox-gallery-v0FOyJfs" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-index-of-nosig-300x202.png" alt="" width="300" height="202" class="alignnone size-medium wp-image-3238" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-index-of-nosig-300x202.png 300w, https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-index-of-nosig-768x518.png 768w, https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-index-of-nosig.png 829w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a><br />
Pronto ninguém precisa saber!</p>
<p>Para o <strong>phpipam</strong> vou fazer um pouco diferente, vamos focar na segurança, no exemplo vou permitir apenas &#8220;meu bloco do NOC&#8221; ter acesso (45.80.51.0/29 2804:f123:bebe:coca::/64), e diferente dos blocos permitidos vou direcionar ele para o &#8220;site da empresa&#8221;.</p>
<pre class="remontti-code"># vim /etc/apache2/sites-available/phpipam.conf</pre>
<pre class="remontti-code">&lt;virtualhost *:80&gt;
   ServerName teste.remontti.com.br
   ServerAdmin noc@remontti.com.br

   DocumentRoot /var/www/phpipam

   # Sem permissões será redirecionada para
   ErrorDocument 403 http://www.remontti.com.br

   &lt;Directory /var/www/phpipam/&gt;
      Options FollowSymLinks
      AllowOverride All
      Require all denied
      &lt;RequireAll&gt;
         &lt;RequireAny&gt;
            Require ip 45.80.51.0/29 2804:f123:bebe:coca::/64
         &lt;/RequireAny&gt;
      &lt;/RequireAll&gt;
   &lt;/Directory&gt;

   ErrorLog ${APACHE_LOG_DIR}/error_phpipam.log
   CustomLog ${APACHE_LOG_DIR}/access_phpipam.log combined

&lt;/VirtualHost&gt;</pre>
<pre class="remontti-code"># a2ensite phpipam
# systemctl restart apache2</pre>
<p>Por fim nosso host <strong>sistema</strong>, nesse vou ensinar como colocar uma senha do apache.<a href="https://blog.remontti.com.br/121" rel="noopener noreferrer" target="_blank"> No passado  já tem um tutorial como proteger diretórios do apache de duas maneira, pelo arquivo de configuração do apache que vou demonstrar aqui e através do htaccess. </a></p>
<p><a href="http://www.remontti.com.br/blog/wp-content/uploads/2009/04/apachelogin.png" data-rel="lightbox-gallery-v0FOyJfs" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" class="size-medium wp-image-1008 alignnone" src="https://www.remontti.com.br/blog/wp-content/uploads/2009/04/apachelogin-300x236.png" alt="apachelogin" width="300" height="236" srcset="https://blog.remontti.com.br/wp-content/uploads/2009/04/apachelogin-300x236.png 300w, https://blog.remontti.com.br/wp-content/uploads/2009/04/apachelogin.png 361w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>Primeiramente vamos gerar nosso arquivo de usuário/senha com <strong>htpasswd -c arquivo usuário</strong> <em>(-c criar arquivo)</em></p>
<pre class="remontti-code"># htpasswd -c /var/www/sistema/.htpasswd admin</pre>
<p>Digite sua senha para o usuário admin</p>
<pre class="remontti-code"># vim /etc/apache2/sites-available/sistema.conf</pre>
<p>Vou permanecer com a restrição por IP mas se você deseja remover basta remover o: </p>
<pre class="remontti-code">   &lt;RequireAny&gt;
        Require ip 45.80.51.0/29 2804:f123:bebe:coca::/64
   &lt;/RequireAny&gt;</pre>
<p>A novidade agora é:</p>
<pre class="remontti-code">   &lt;RequireAll&gt;
      Require valid-user
      AuthBasicProvider file
      AuthType Basic
      AuthName &quot;Login&quot;
      AuthUserFile /var/www/sistema/.htpasswd
   &lt;/RequireAll&gt;</pre>
<pre class="remontti-code">
&lt;virtualhost *:80&gt;
   ServerAdmin noc@remontti.com.br
   DocumentRoot /var/www/sistema
 
   # Sem permissões será redirecionada para
   ErrorDocument 403 http://www.remontti.com.br
 
   &lt;Directory /var/www/sistema/&gt;
      Options FollowSymLinks
      AllowOverride All
 
      Require all denied
      &lt;RequireAll&gt;
         &lt;RequireAny&gt;
            Require ip 45.80.51.0/29 2804:f123:bebe:coca::/64
         &lt;/RequireAny&gt;
         &lt;RequireAll&gt;
            Require valid-user
            AuthBasicProvider file
            AuthType Basic
            AuthName &quot;Login&quot;
            AuthUserFile /var/www/sistema/.htpasswd
         &lt;/RequireAll&gt;
      &lt;/RequireAll&gt;
 
   &lt;/Directory&gt; 

   ErrorLog ${APACHE_LOG_DIR}/error_sistema.log
   CustomLog ${APACHE_LOG_DIR}/access_sistema.log combined
&lt;/VirtualHost&gt;</pre>
<p>Por segurança recomendo remover a assinatura do servidor, evitando os "espertinhos"</p>
<pre class="remontti-code"># sed -i &#039;s/ServerTokens OS/ServerTokens Prod/&#039; /etc/apache2/conf-available/security.conf
# sed -i &#039;s/ServerSignature On/ServerSignature Off/&#039; /etc/apache2/conf-available/security.conf</pre>
<pre class="remontti-code"># a2ensite sistema
# systemctl restart apache2</pre>
<p>Que tal usar o <a href="https://blog.remontti.com.br/1832" rel="noopener noreferrer" target="_blank">letsencrypt</a> e ter certificado valido para seus hosts?<br />
Faça a instalação do letsencrypt</p>
<pre class="remontti-code"># apt install letsencrypt python-certbot-apache</pre>
<p>Antes de gerar nossa configuração pare o apache</p>
<pre class="remontti-code"># systemctl stop apache2</pre>
<p>Altere www.remontti.com.br para SEU.DOMINIO!</p>
<pre class="remontti-code"># letsencrypt --authenticator standalone --installer apache -d www.remontti.com.br</pre>
<p>Você pode rodar também o comando: </p>
<pre class="remontti-code"># letsencrypt</pre>
<p>O mesmo vai verificar todos os domínios virtuais e lheperguntar para quais você deseja gerar certificado!</p>
<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-v0FOyJfs" 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></p>
<p>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>Abraço!</p>
<p>Fonte:<br />
<a href="https://httpd.apache.org/docs/2.4/howto/" rel="noopener noreferrer" target="_blank">https://httpd.apache.org/docs/2.4/howto/</a></p>
<p>O post <a href="https://blog.remontti.com.br/3464">Como ter diversos sub/domínios no mesmo servidor? (Domínios virtuais com Apache2)</a> apareceu primeiro em <a href="https://blog.remontti.com.br">Remontti</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.remontti.com.br/3464/feed</wfw:commentRss>
			<slash:comments>24</slash:comments>
		
		
			</item>
		<item>
		<title>Instalação do SpeedTest/OoklaServer + Speedtest Custom no Debian 10 Buster</title>
		<link>https://blog.remontti.com.br/3218</link>
					<comments>https://blog.remontti.com.br/3218#comments</comments>
		
		<dc:creator><![CDATA[Rudimar Remontti]]></dc:creator>
		<pubDate>Fri, 26 Jul 2019 20:01:06 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutoriais]]></category>
		<category><![CDATA[account]]></category>
		<category><![CDATA[apache2]]></category>
		<category><![CDATA[buster]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[debian 10]]></category>
		<category><![CDATA[debian buster]]></category>
		<category><![CDATA[ookla]]></category>
		<category><![CDATA[ooklaserver]]></category>
		<category><![CDATA[php7]]></category>
		<category><![CDATA[php7.3]]></category>
		<category><![CDATA[speedtest]]></category>
		<guid isPermaLink="false">https://blog.remontti.com.br/?p=3218</guid>

					<description><![CDATA[<p>Instalação do SpeedTest (OoklaServer) no Debian 11/12 gerenciado pelo systemd 👆👆👆👆 Versão mais atualizada. Requisitos do servidor Speedtest de acordo com base nas informações: support.ookla.com Capacidade de Rede: &#8211; 1 Gbps de Up e&#46;&#46;&#46;</p>
<p>O post <a href="https://blog.remontti.com.br/3218">Instalação do SpeedTest/OoklaServer + Speedtest Custom no Debian 10 Buster</a> apareceu primeiro em <a href="https://blog.remontti.com.br">Remontti</a>.</p>
]]></description>
										<content:encoded><![CDATA[<blockquote class="wp-embedded-content" data-secret="hyQwkVUt1w"><p><a href="https://blog.remontti.com.br/6051">Instalação do SpeedTest (OoklaServer) no Debian 11/12 gerenciado pelo systemd</a></p></blockquote>
<p><iframe loading="lazy" class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  title="&#8220;Instalação do SpeedTest (OoklaServer) no Debian 11/12 gerenciado pelo systemd&#8221; &#8212; Remontti" src="https://blog.remontti.com.br/6051/embed#?secret=aru74vP5WC#?secret=hyQwkVUt1w" data-secret="hyQwkVUt1w" width="500" height="282" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe><br />
<img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f446.png" alt="👆" class="wp-smiley" style="height: 1em; max-height: 1em;" /><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f446.png" alt="👆" class="wp-smiley" style="height: 1em; max-height: 1em;" /><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f446.png" alt="👆" class="wp-smiley" style="height: 1em; max-height: 1em;" /><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f446.png" alt="👆" class="wp-smiley" style="height: 1em; max-height: 1em;" /><br />
Versão mais atualizada.</p>
<p><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-ooklaserver.png" alt="" width="720" height="340" class="alignnone size-full wp-image-3295" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-ooklaserver.png 720w, https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-ooklaserver-300x142.png 300w, https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-ooklaserver-520x245.png 520w" sizes="auto, (max-width: 720px) 100vw, 720px" /></p>
<p>Requisitos do servidor Speedtest de acordo com base nas informações: <a href="https://support.ookla.com/hc/en-us/articles/234578628-Speedtest-Server-Requirements" rel="noopener noreferrer" target="_blank">support.ookla.com</a></p>
<h4>Capacidade de Rede:</h4>
<p> &#8211; 1 Gbps de Up e Down<br />
 &#8211; Exceções raras são feitas para regiões subdesenvolvidas e carentes.</p>
<h4>Hardware</h4>
<p><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-requesitos.png" alt="" width="579" height="306" class="alignnone size-full wp-image-3220" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-requesitos.png 579w, https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-requesitos-300x159.png 300w" sizes="auto, (max-width: 579px) 100vw, 579px" /></p>
<h4>Portas:</h4>
<p> &#8211; TCP/UDP 8080 (OoklaServer)<br />
 &#8211; TCP/UDP 5060 (OoklaServer)<br />
 &#8211; TCP 80 (HTTP Legacy)<br />
Todas as portas devem estar abertas para qualquer IP público da Internet, pois os usuários se conectarão diretamente.</p>
<h4>DNS:</h4>
<p>No exemplo vou usar o domínio teste.remontti.com.br, logo é necessário configurar seu subdomínio &#8220;teste&#8221; <a href="https://blog.remontti.com.br/308" rel="noopener noreferrer" target="_blank">em seu DNS Server</a>.</p>
<pre class="remontti-code">[...]

teste       A       45.80.50.2
            AAAA    2804:f123:bebe:cafe::2

[...]</pre>
<p><strong>Distribuição utilizada:</strong> <a href="https://blog.remontti.com.br/2966" rel="noopener noreferrer" target="_blank">Debian 10 (Instalação limpa)</a><br />
Funciona também com Debian 9</p>
<p>Pacotes necessários</p>
<pre class="remontti-code"># su -
# apt install vim  wget unzip apt-transport-https</pre>
<p>Por segurança do servidor é recomendamos usar um usuário sem poderes de root para executar o servidor da ookla.<br />
Para isso vamos criar o usuário chamado speedtest.</p>
<pre class="remontti-code"># addgroup speedtest
# useradd -d /etc/speedtest -m -g speedtest -s /bin/bash speedtest</pre>
<p>Transforme-se no usuário speedtest que acabamos de criar.</p>
<pre class="remontti-code"># su - speedtest</pre>
<p>Vamos baixar nosso script de instalação em /etc/speedtest e executa-lo.</p>
<pre class="remontti-code">$ cd ~
$ wget https://install.speedtest.net/ooklaserver/ooklaserver.sh --no-check-certificate
$ chmod +x ooklaserver.sh
$ ./ooklaserver.sh install</pre>
<p><em>Please confirm (y/n) ></em> <strong>y</strong></p>
<pre class="remontti-code">Server Platform is linux64
This will install the Ookla server for linux64 to the current folder. Please confirm (y/n) &gt; y
Checking Directory Structure
Downloading Server Files
--2019-07-26 10:33:50--  https://install.speedtest.net/ooklaserver/stable/OoklaServer-linux64.tgz
Resolvendo install.speedtest.net (install.speedtest.net)... 2a04:4e42::731, 2a04:4e42:200::731, 2a04:4e42:400::731, ...
Conectando-se a install.speedtest.net (install.speedtest.net)|2a04:4e42::731|:443... conectado.
A requisição HTTP foi enviada, aguardando resposta... 200 OK
Tamanho: 6093436 (5,8M) [binary/octet-stream]
Salvando em: “OoklaServer-linux64.tgz”

OoklaServer-linux64.tgz                 100%[============================================================================&gt;]   5,81M  2,71MB/s    em 2,1s    

2019-07-26 10:33:52 (2,71 MB/s) - “OoklaServer-linux64.tgz” salvo [6093436/6093436]

Extracting Server Files
OoklaServer
OoklaServer.properties.default
Starting OoklaServer
Daemon Started (9531)
NOTE:

We strongly recommend following instructions at

   https://www.ookla.com/support/a87011938/

to ensure your daemon starts automatically when the system reboots</pre>
<p>Neste momento o servidor ookla já iniciou, acesse em seu navegado <strong>http://teste.{DOMINIO}:8080</strong> e <strong>http://teste.{DOMINIO}:5060</strong> e verifique se o mesmo esta rodando (OoklaServer &#8211; It worked!)</p>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-it-worked.png" data-rel="lightbox-gallery-ciysOYU6" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-it-worked-300x202.png" alt="" width="300" height="202" class="alignnone size-medium wp-image-3221" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-it-worked-300x202.png 300w, https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-it-worked-768x518.png 768w, https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-it-worked.png 829w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>Volte para o usuário root</p>
<pre class="remontti-code">$ exit</pre>
<p>Para que o Ooklaserver seja iniciado em segundo plano automaticamente, criaremos o arquivo /etc/rc.local como o comando já para iniciar nosso serviço.</p>
<pre class="remontti-code"># ln -s /lib/systemd/system/rc-local.service /etc/systemd/system/rc-local.service
# printf &#039;%s\n&#039; &#039;#!/bin/bash&#039; &#039;/usr/bin/su - speedtest -c &quot;/etc/speedtest/OoklaServer --daemon&quot;&#039; &#039;exit 0&#039; | tee -a /etc/rc.local</pre>
<p>De permissão para execução e ative sua inicialização</p>
<pre class="remontti-code"># chmod +x /etc/rc.local</pre>
<p>Para testarmos vamos reiniciar e verificar se o ooklaserver iniciou após reboot.</p>
<pre class="remontti-code"># reboot</pre>
<p>Acesse: <strong>http://teste.{DOMINIO}:8080</strong> para ver se o mesmo foi executado na inicialização.<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-it-worked.png" data-rel="lightbox-gallery-ciysOYU6" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-it-worked-300x202.png" alt="" width="300" height="202" class="alignnone size-medium wp-image-3221" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-it-worked-300x202.png 300w, https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-it-worked-768x518.png 768w, https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-it-worked.png 829w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<h4>Servidor Web</h4>
<p>Precisamos ter um serviço web rodando e PHP, para isso vamos instalar o Apache2 + PHP7</p>
<pre class="remontti-code"># su -
# apt install apache2 libapache2-mod-php php </pre>
<p><strong> :: Dominio Virtual :: </strong></p>
<p>Crie a configuração do domínio virtual, no meu exemplo teste.remontti.com.br, qual diretório raiz será &#8220;/var/www/teste/&#8221;</p>
<pre class="remontti-code"># vim /etc/apache2/sites-available/teste.conf</pre>
<pre class="remontti-code">&lt;virtualhost *:80&gt;
        ServerName teste.remontti.com.br
        ServerAdmin noc@remontti.com.br
        DocumentRoot /var/www/teste 
        &lt;directory /var/www/teste/ &gt;
                Options FollowSymLinks
                AllowOverride All
        &lt;/directory&gt; 
        LogLevel warn 
        ErrorLog ${APACHE_LOG_DIR}/error_teste.log
        CustomLog ${APACHE_LOG_DIR}/access_teste.log combined
&lt;/virtualhost&gt;</pre>
<p>Vamos criar nosso diretório raiz:</p>
<pre class="remontti-code"># mkdir /var/www/teste/
# echo &quot;MEU FUTURO CODIGO HTML&quot; &gt; /var/www/teste/index.php
</pre>
<p>Agora precisamos fazer o acesso web para visualizar as informações.<br />
Ajustes de segurança para o apache:</p>
<pre class="remontti-code"># sed -i &#039;s/ServerTokens OS/ServerTokens Prod/&#039; /etc/apache2/conf-available/security.conf
# sed -i &#039;s/ServerSignature On/ServerSignature Off/&#039; /etc/apache2/conf-available/security.conf</pre>
<p>Ativamos o arquivo teste.conf e restartamos o apache2</p>
<pre class="remontti-code"># a2ensite teste
# systemctl restart apache2</pre>
<p>Acesse: <strong>http://teste.{DOMINIO}</strong>, se retornar uma tela &#8220;MEU FUTURO CODIGO HTML&#8221;.</p>
<h4>Certificado Válido</h4>
<p>Usamos o letsencrypt para gerar o certificado certificado gratuitamente.</p>
<pre class="remontti-code"># apt install letsencrypt python-certbot-apache</pre>
<p>Antes de gerar nossa configuração pare o apache</p>
<pre class="remontti-code"># systemctl stop apache2</pre>
<p>Altere teste.remontti.com.br para SEU.DOMINIO!</p>
<pre class="remontti-code"># letsencrypt --authenticator standalone --installer apache -d teste.remontti.com.br</pre>
<p>Responda como abaixo:</p>
<pre class="remontti-code">Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator standalone, Installer apache
Enter email address (used for urgent renewal and security notices) (Enter &#039;c&#039; to
cancel): seu@email.com.br

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for teste.remontti.com.br
Waiting for verification...
Cleaning up challenges
Created an SSL vhost at /etc/apache2/sites-available/teste-le-ssl.conf
Enabled Apache socache_shmcb module
Enabled Apache ssl module
Deploying Certificate to VirtualHost /etc/apache2/sites-available/teste-le-ssl.conf
Enabling available site: /etc/apache2/sites-available/teste-le-ssl.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): 1

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have successfully enabled https://teste.remontti.com.br

You should test your configuration at:
https://www.ssllabs.com/ssltest/analyze.html?d=teste.remontti.com.br
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/teste.remontti.com.br/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/teste.remontti.com.br/privkey.pem
   Your cert will expire on 2019-10-24. 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 / Lets Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le</pre>
<p>Acesse seu domínio agora com https: <strong>https://teste.{DOMINIO}</strong>. Você não pode receber erro de certificado!</p>
<p>Para evitar que o certificado expire colocaremos o certbot para renovar o certificado, fazendo um script e colocando ele no cron.</p>
<pre class="remontti-code"># vim  /etc/speedtest/renovassl.sh</pre>
<p>Adicione</p>
<pre class="remontti-code">#!/bin/bash
# Para o apache 
/usr/bin/systemctl stop apache2

# Aguarda 10 seg (tempo do apache parar) 
sleep 10

# Renova o certificado
/usr/bin/certbot -q renew

# Aguarda o certificado renovar
sleep 30

# Altera as permissoes para o usuário speedtest conseguir ler os certificados
/usr/bin/chown speedtest. /etc/letsencrypt/ -R

# Aguarda 2 seg
sleep 2

# Restarta o apache 
/usr/bin/systemctl restart apache2
sleep 10
# Restarta o apache mais uma vez so por garantia (opcional)
/usr/bin/systemctl restart apache2

# Para o ooklaserver
/etc/speedtest/ooklaserver.sh stop 
sleep 120
# Inicia o ooklaserver
/usr/bin/su - speedtest -c &quot;/etc/speedtest/OoklaServer --daemon&quot;
</pre>
<pre class="remontti-code"># chmod +x /etc/speedtest/renovassl.sh
# chown speedtest. /etc/speedtest/renovassl.sh</pre>
<pre class="remontti-code"># echo &#039;00 00   1 * *   root    /etc/speedtest/renovassl.sh&#039; &gt;&gt; /etc/crontab</pre>
<p>Verifique se a última linha está nosso script.</p>
<pre class="remontti-code"># cat /etc/crontab</pre>
<pre class="remontti-code"># /etc/crontab: system-wide crontab
# Unlike any other crontab you don&#039;t have to run the `crontab&#039;
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# Example of job definition:
# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# |  |  |  |  |
# *  *  *  *  * user-name command to be executed
17 *    * * *   root    cd / &amp;&amp; run-parts --report /etc/cron.hourly
25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / &amp;&amp; run-parts --report /etc/cron.daily )
47 6    * * 7   root    test -x /usr/sbin/anacron || ( cd / &amp;&amp; run-parts --report /etc/cron.weekly )
52 6    1 * *   root    test -x /usr/sbin/anacron || ( cd / &amp;&amp; run-parts --report /etc/cron.monthly )
#
00 00   * * *   root    /etc/speedtest/renovassl.sh</pre>
<p>Restarte o cron</p>
<pre class="remontti-code"># systemctl restart cron</pre>
<p>Agora que temos nosso certificado válido e funcionando vamos utiliza-lo nas configurações do OoklaServer.</p>
<pre class="remontti-code"># vim /etc/speedtest/OoklaServer.properties</pre>
<p>Descomente a variável: <strong>OoklaServer.allowedDomains</strong> e inclua seu domínio também, em seguida procure <strong>openSSL</strong>, temos duas variáveis comentadas, descomente e aponte para o arquivo do certificado criado pelo letsencrypt.  </p>
<pre class="remontti-code"># OoklaServer.allowedDomains = *.ookla.com, *.speedtest.net
# altere ¬
OoklaServer.allowedDomains = *.ookla.com, *.speedtest.net, *.SEUDOMINIO.com.br

# ...

# openSSL.server.certificateFile = cert.pem
# openSSL.server.privateKeyFile = key.pem
# altere ¬
openSSL.server.certificateFile = /etc/letsencrypt/live/teste.SEUDOMINIO.com.br/fullchain.pem
openSSL.server.privateKeyFile = /etc/letsencrypt/live/teste.SEUDOMINIO.com.br/privkey.pem</pre>
<p>Se você tem IPv6 configurado em seu servidor, ainda no OoklaServer.properties descomente alinha &#8220;OoklaServer.useIPv6&#8221;</p>
<pre class="remontti-code"># Uncomment to bind OoklaServer to IPv6
#
OoklaServer.useIPv6 = true</pre>
<p>Vamos sobrescrevemos o arquivo default também, pois o Ooklaserver atualiza-se automaticamente e ele é o arquivo base.</p>
<pre class="remontti-code"># cp /etc/speedtest/OoklaServer.properties /etc/speedtest/OoklaServer.properties.default</pre>
<p>Também é necessário dar acesso (permissão) ao usuário speedtest a ler os arquivos do certificado em /etc/letsencrypt.</p>
<pre class="remontti-code"># chown speedtest. /etc/letsencrypt/ -R</pre>
<p>Reinicie seu servidor.</p>
<pre class="remontti-code"># reboot</pre>
<p>Agora acessamos nossa porta 8080 utilizando http: <strong>https://teste.{DOMINIO}:8080</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-https-speedtest.png" data-rel="lightbox-gallery-ciysOYU6" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-https-speedtest-300x202.png" alt="" width="300" height="202" class="alignnone size-medium wp-image-3257" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-https-speedtest-300x202.png 300w, https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-https-speedtest-768x518.png 768w, https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-https-speedtest.png 829w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>Crie uma index.php onde posteriormente iremos configurar nosso SpeedtestCustom</p>
<pre class="remontti-code"># echo &quot;IFRAME SPEEDTESTCUSTOM&quot; &gt; /var/www/teste/index.php</pre>
<pre class="remontti-code"># vim /var/www/teste/crossdomain.xml</pre>
<pre class="remontti-code">&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;cross-domain-policy&gt;
  &lt;allow-access-from domain=&quot;*.speedtest.net&quot; /&gt;
  &lt;allow-access-from domain=&quot;*.ookla.com&quot; /&gt;
  &lt;allow-access-from domain=&quot;*.SEUDOMINIO.com.br&quot; /&gt;
  &lt;allow-access-from domain=&quot;*.OUTRO_SETIVER_OU_DELETE_ESSALINHA&quot; /&gt;
&lt;/cross-domain-policy&gt;</pre>
<p>Servidor esta pronto para passar nos testes! <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;" /></p>
<h4>Testes</h4>
<p>Acesse <a href="https://www.ookla.com/pt/host-tester" rel="noopener noreferrer" target="_blank">https://www.ookla.com/pt/host-tester</a> e preencha com as informações do seu servidor:</p>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest.png" data-rel="lightbox-gallery-ciysOYU6" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest.png" alt="" width="883" height="690" class="alignnone size-full wp-image-5358" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest.png 883w, https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-300x234.png 300w, https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-768x600.png 768w" sizes="auto, (max-width: 883px) 100vw, 883px" /></a></p>
<p><strong>Submit!</strong></p>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest_result.png" data-rel="lightbox-gallery-ciysOYU6" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest_result.png" alt="" width="1008" height="750" class="alignnone size-full wp-image-5359" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest_result.png 1008w, https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest_result-300x223.png 300w, https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest_result-768x571.png 768w" sizes="auto, (max-width: 1008px) 100vw, 1008px" /></a></p>
<h4>Criando uma conta</h4>
<p>Se você passou nos testes é hora de criar sua conta no <a href="https://account.ookla.com/register/servers" rel="noopener noreferrer" target="_blank">ookla.com</a> e fazer a solicitação para virar um host! <a href="https://account.ookla.com/register/servers" rel="noopener noreferrer" target="_blank">https://account.ookla.com/register/servers</a><br />
Se você já tem conta acesse: <a href="https://account.ookla.com/servers/create" rel="noopener noreferrer" target="_blank">https://account.ookla.com/servers/create</a><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-register.png" data-rel="lightbox-gallery-ciysOYU6" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-register-150x150.png" alt="" width="150" height="150" class="alignnone size-thumbnail wp-image-3270" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-register-150x150.png 150w, https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-register-160x160.png 160w, https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-register-320x320.png 320w" sizes="auto, (max-width: 150px) 100vw, 150px" /></a> <a href="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-register2.png" data-rel="lightbox-gallery-ciysOYU6" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-register2-150x150.png" alt="" width="150" height="150" class="alignnone size-thumbnail wp-image-3271" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-register2-150x150.png 150w, https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-register2-160x160.png 160w, https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-register2-320x320.png 320w" sizes="auto, (max-width: 150px) 100vw, 150px" /></a> <a href="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-register3.png" data-rel="lightbox-gallery-ciysOYU6" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-register3-150x150.png" alt="" width="150" height="150" class="alignnone size-thumbnail wp-image-3272" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-register3-150x150.png 150w, https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-register3-160x160.png 160w, https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-register3-320x320.png 320w" sizes="auto, (max-width: 150px) 100vw, 150px" /></a></p>
<h4>Cadastro</h4>
<p>Criado sua conta responta seu e-mail de verificação e logue em sua conta: <a href="https://account.ookla.com/" rel="noopener noreferrer" target="_blank">https://account.ookla.com/</a></p>
<p>Clique em <strong>Go To Servers</strong>, e <strong>aceite os Termos</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-go-to-server.png" data-rel="lightbox-gallery-ciysOYU6" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-go-to-server-300x172.png" alt="" width="300" height="172" class="alignnone size-medium wp-image-3276" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-go-to-server-300x172.png 300w, https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-go-to-server-768x441.png 768w, https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-go-to-server-1024x588.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-go-to-server.png 1223w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>Clique em <strong>Add Server</strong> preencha com os seus dados e do servidor. </p>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-add-server-1.png" data-rel="lightbox-gallery-ciysOYU6" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-add-server-1.png" alt="" width="1234" height="1297" class="alignnone size-full wp-image-5360" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-add-server-1.png 1234w, https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-add-server-1-285x300.png 285w, https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-add-server-1-974x1024.png 974w, https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-add-server-1-768x807.png 768w" sizes="auto, (max-width: 1234px) 100vw, 1234px" /></a><br />
Agora basta aguardar alguns dias pela aprovação, você receberá um e-mail lhe avisado (se não for aprovado eles lhe dirão porque). Boa sorte!</p>
<h4>SpeedtestCustom</h4>
<p>Acesse <a href="https://account.speedtestcustom.com" rel="noopener noreferrer" target="_blank">https://account.speedtestcustom.com</a> e resgistre um &#8220;Free Plan&#8221;<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-custom-1.png" data-rel="lightbox-gallery-ciysOYU6" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-custom-1-1024x736.png" alt="" width="1024" height="736" class="alignnone size-large wp-image-3283" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-custom-1-1024x736.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-custom-1-300x216.png 300w, https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-custom-1-768x552.png 768w, https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-custom-1.png 1235w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-custom-2.png" data-rel="lightbox-gallery-ciysOYU6" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-custom-2-1024x715.png" alt="" width="1024" height="715" class="alignnone size-large wp-image-3284" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-custom-2-1024x715.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-custom-2-300x209.png 300w, https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-custom-2-768x536.png 768w, https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-custom-2.png 1265w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-custom-3.png" data-rel="lightbox-gallery-ciysOYU6" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-custom-3-1024x707.png" alt="" width="1024" height="707" class="alignnone size-large wp-image-3285" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-custom-3-1024x707.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-custom-3-300x207.png 300w, https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-custom-3-768x530.png 768w, https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-custom-3.png 1257w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>Finalizando ajustamos o arquivo index.php</p>
<pre class="remontti-code">#  vim /var/www/teste/index.php </pre>
<p>WordPress ta bugando ao ler o codigo html pegue ele aqui: <a href="https://blog.remontti.com.br/wp-content/uploads/2019/07/index.zip">index</a></p>
<pre class="remontti-code">&lt;?php
#Altere as variáveis
$titulo = &quot;Remontti - SpeedTest&quot;;
$cor_fundo = &quot;1D1D1D&quot;; //A mesma que vc anotou la do custom
$cor_texto = &quot;067980&quot;; //A mesma que vc anotou la do custom
$url_custom = &quot;https://remontti.speedtestcustom.com&quot;; // Seu link no custom
?&gt;
&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;&lt;?php echo &quot;$titulo &quot;; ?&gt;&lt;/title&gt;
&lt;meta charset=&quot;utf-8&quot;&gt;
&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;
&lt;link rel=&quot;shortcut icon&quot; href=&quot;/favicon.ico&quot; type=&quot;image/x-icon&quot;&gt;
&lt;link rel=&quot;icon&quot; href=&quot;/favicon.ico&quot; type=&quot;image/x-icon&quot;&gt;
&lt;style type=&quot;text/css&quot;&gt;
  html, body {
    font-family: Lucida Grande, sans-serif;
    color: #&lt;?php echo &quot;$cor_texto&quot;; ?&gt;;
    background: #&lt;?php echo &quot;$cor_fundo&quot;; ?&gt;;
  }
  .iframe-placeholder {
    background: url(&#039;data:image/svg+xml;charset=utf-8,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;100%&quot; height=&quot;100%&quot; viewBox=&quot;0 0 100% 100%&quot;&gt;&lt;text fill=&quot;%23&lt;?php echo &quot;$cor_texto&quot;; ?&gt;&quot; x=&quot;50%&quot; y=&quot;50%&quot; font-family=&quot;\&#039;Lucida Grande\&#039;, sans-serif&quot; font-size=&quot;38&quot; text-anchor=&quot;middle&quot;&gt;Carregando&lt;/text&gt;&lt;/svg&gt;&#039;) 0px 0px no-repeat;
  }
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;iframe class=&quot;iframe-placeholder&quot; width=&quot;100%&quot; height=&quot;600px&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; src=&quot;&lt;?php echo &quot;$url_custom&quot;; ?&gt;&quot;&gt;&lt;/iframe&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p>https://teste.DOMINIO/<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-custom-4.png" data-rel="lightbox-gallery-ciysOYU6" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-custom-4-300x212.png" alt="" width="300" height="212" class="alignnone size-medium wp-image-3291" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-custom-4-300x212.png 300w, https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-custom-4-768x542.png 768w, https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-custom-4-1024x722.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2019/07/speedtest-debian-10-buster-custom-4.png 1048w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>Parabéns! Você concluiu! Gostou?</p>
<p><center><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></center></p>
<p>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>Abraço!</p>
<p>O post <a href="https://blog.remontti.com.br/3218">Instalação do SpeedTest/OoklaServer + Speedtest Custom no Debian 10 Buster</a> apareceu primeiro em <a href="https://blog.remontti.com.br">Remontti</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.remontti.com.br/3218/feed</wfw:commentRss>
			<slash:comments>145</slash:comments>
		
		
			</item>
		<item>
		<title>Passo-a-passo como criar um servidor web Apache2, PHP 7.0, MariaDB, PHPMyAdmin &#8220;LAMP&#8221; no Debian 9 Stretch</title>
		<link>https://blog.remontti.com.br/2024</link>
					<comments>https://blog.remontti.com.br/2024#comments</comments>
		
		<dc:creator><![CDATA[Rudimar Remontti]]></dc:creator>
		<pubDate>Mon, 19 Jun 2017 18:55:38 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutoriais]]></category>
		<category><![CDATA[apache2]]></category>
		<category><![CDATA[Debian 9]]></category>
		<category><![CDATA[lamp]]></category>
		<category><![CDATA[MariaDB]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP 7.0]]></category>
		<category><![CDATA[phpMyAdmin]]></category>
		<category><![CDATA[Stretch]]></category>
		<category><![CDATA[webserver]]></category>
		<guid isPermaLink="false">http://blog.remontti.com.br/?p=2024</guid>

					<description><![CDATA[<p>Distribuição utilizada: Debian 9 Stretch / Instalação Limpa Com o lançamento do Debian 9 alguns pacotes foram substituído como: PHP5 -> PHP7.0 Mysql -> MariaDB (MariaDB é um banco de dados que surgiu como&#46;&#46;&#46;</p>
<p>O post <a href="https://blog.remontti.com.br/2024">Passo-a-passo como criar um servidor web Apache2, PHP 7.0, MariaDB, PHPMyAdmin &#8220;LAMP&#8221; no Debian 9 Stretch</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/2017/06/webdev-debian9.jpg" alt="" width="800" height="376" class="alignnone size-full wp-image-2046" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/06/webdev-debian9.jpg 800w, https://blog.remontti.com.br/wp-content/uploads/2017/06/webdev-debian9-300x141.jpg 300w, https://blog.remontti.com.br/wp-content/uploads/2017/06/webdev-debian9-768x361.jpg 768w, https://blog.remontti.com.br/wp-content/uploads/2017/06/webdev-debian9-520x245.jpg 520w" sizes="auto, (max-width: 800px) 100vw, 800px" /></p>
<p>Distribuição utilizada: Debian 9 Stretch / <a href="https://blog.remontti.com.br/1152">Instalação Limpa</a></p>
<p>Com o lançamento do Debian 9 alguns pacotes foram substituído como:<br />
<strong>PHP5 -> PHP7.0</strong><br />
<strong>Mysql -> <a href="https://pt.wikipedia.org/wiki/MariaDB" target="_blank" rel="noopener noreferrer">MariaDB</a></strong> (<em>MariaDB é um banco de dados que surgiu como fork do MySQL, criado pelo próprio fundador do projeto após sua aquisição pela Oracle.</em>)</p>
<p>Vamos a instalação</p>
<pre class="remontti-code"># apt update
# apt upgrade
# apt install apache2 libapache2-mod-php7.0 php7.0 mariadb-client mariadb-server phpmyadmin</pre>
<p>Instale todos os pacotes dependentes. (S)</p>
<p><em>OBS: Se você instalar o pacote <strong>mysql-server</strong> ele vai estar instalando o mariadb-client mariadb-server.</em></p>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_143240.png" data-rel="lightbox-gallery-SKp8d1mk" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_143240-300x199.png" alt="" width="300" height="199" class="alignnone size-medium wp-image-2028" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_143240-300x199.png 300w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_143240-768x509.png 768w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_143240-1024x679.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_143240.png 1192w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>Na próxima tela selecione a opção apache2.<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_143756.png" data-rel="lightbox-gallery-SKp8d1mk" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_143756-300x199.png" alt="" width="300" height="199" class="alignnone size-medium wp-image-2029" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_143756-300x199.png 300w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_143756-768x509.png 768w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_143756-1024x679.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_143756.png 1192w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>Configurando o banco do phpmyadmin:<br />
Responda Sim.<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_144016.png" data-rel="lightbox-gallery-SKp8d1mk" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_144016-300x199.png" alt="" width="300" height="199" class="alignnone size-medium wp-image-2030" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_144016-300x199.png 300w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_144016-768x509.png 768w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_144016-1024x679.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_144016.png 1192w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>Defina uma senha para a base do phpmyadmin:<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_144112.png" data-rel="lightbox-gallery-SKp8d1mk" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_144112-300x199.png" alt="" width="300" height="199" class="alignnone size-medium wp-image-2031" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_144112-300x199.png 300w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_144112-768x509.png 768w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_144112-1024x679.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_144112.png 1192w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>Repita a senha:<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_144154.png" data-rel="lightbox-gallery-SKp8d1mk" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_144154-300x199.png" alt="" width="300" height="199" class="alignnone size-medium wp-image-2032" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_144154-300x199.png 300w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_144154-768x509.png 768w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_144154-1024x679.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_144154.png 1192w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a><br />
Instalação concluída!<br />
Acesse <strong>http://ip-do-seu-servidor/</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150403.png" data-rel="lightbox-gallery-SKp8d1mk" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150403-300x158.png" alt="" width="300" height="158" class="alignnone size-medium wp-image-2039" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150403-300x158.png 300w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150403-768x403.png 768w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150403-1024x538.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150403.png 1680w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p><strong>Não sentiu que faltou algo nessa instalação?</strong><br />
<strong>Sim!</strong> No MySQL você definia uma senha para para o usuário root do mysql na instalação, com o MariaDB isso não acontece pois ele vem sem senha de root! Como usuário root não tem senha você não vai conseguir logar com ele no PHPMyAdmin.<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_144650.png" data-rel="lightbox-gallery-SKp8d1mk" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_144650-202x300.png" alt="" width="202" height="300" class="alignnone size-medium wp-image-2034" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_144650-202x300.png 202w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_144650.png 432w" sizes="auto, (max-width: 202px) 100vw, 202px" /></a></p>
<p>Para alterar a senha do usuário root do MariaDB faça:</p>
<pre class="remontti-code"># mariadb -u root</pre>
<pre class="remontti-code">USE mysql;
UPDATE user SET password=PASSWORD(&#039;SUA-SENHA&#039;) WHERE User=&#039;root&#039;;
UPDATE user SET plugin=&quot;mysql_native_password&quot;;
FLUSH PRIVILEGES;
quit;</pre>
<p>Mas não se assuste! MariaDB é praticamente o seu velho MySQL. Para saber mais acesse: <a href="https://mariadb.com/kb/pt-br/mariadb-versus-mysql-compatibility/" target="_blank" rel="noopener noreferrer">MariaDB versus MySQL &#8211; Compatibilidade</a>. Veja pelo lado bom, não permitindo login com root temos mais segurança!<br />
O que fazer então? Simples crie uma base de dados e um usuário para acessa-la. Eu sempre recomendei usar para cada aplicação um usuário com a sua base, assim numa falha você  não deixa exposto o que não deveria!<br />
Acesse via linha de comando nosso o mariadb (o comando mysql -p funciona também) </p>
<pre class="remontti-code"># mariadb -p</pre>
<p>Por padrão vem sem senha.</p>
<pre class="remontti-code">CREATE DATABASE minhabase;
GRANT ALL PRIVILEGES ON minhabase.* TO &#039;meuusuario&#039;@&#039;localhost&#039; IDENTIFIED BY &#039;minhasenha&#039;;
FLUSH PRIVILEGES;
quit;</pre>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_145812.png" data-rel="lightbox-gallery-SKp8d1mk" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_145812-300x106.png" alt="" width="300" height="106" class="alignnone size-medium wp-image-2035" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_145812-300x106.png 300w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_145812-768x271.png 768w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_145812-1024x362.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_145812.png 1157w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>Agora pode acessar seu PHPMyAdmin com seu seu usuário e senha. <strong>http://ip-do-seu-servidor/phpmyadmin</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150017.png" data-rel="lightbox-gallery-SKp8d1mk" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150017-300x157.png" alt="" width="300" height="157" class="alignnone size-medium wp-image-2036" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150017-300x157.png 300w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150017-768x402.png 768w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150017-1024x536.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150017.png 1680w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a><a href="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150027.png" data-rel="lightbox-gallery-SKp8d1mk" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150027-300x158.png" alt="" width="300" height="158" class="alignnone size-medium wp-image-2037" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150027-300x158.png 300w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150027-768x404.png 768w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150027-1024x539.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150027.png 1680w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>Agora vamos habilitar o <a href="http://httpd.apache.org/docs/current/mod/mod_rewrite.html">mod_rewrite</a> do Apache que é muito utilizado. Este é um módulo do Apache que utiliza um mecanismo baseado em regras de reescrita.</p>
<p>Diretório de configurações do Apache fica em <strong>/etc/apache2/</strong></p>
<p>Vamos ao comando para habilita-lo:</p>
<pre class="remontti-code"># a2enmod rewrite</pre>
<p>A página que vimos ao abri o ip do nosso servidor no navegador fica no diretório /var/www/html, isso está sendo informado no arquivo default do apache que fica em <em>/etc/apache2/sites-enabled/000-default.conf</em>, e para que nosso <a href="http://httpd.apache.org/docs/current/mod/mod_rewrite.html">mod_rewrite</a> funcione corretamente será necessário adicionar alguma linhas.</p>
<p>Edite o arquivo /etc/apache2/sites-enabled/000-default.conf (vou usar o editor vim, que não vem instalado por padrão no sistema, mas se você pode usar qualquer edito ex o nano)</p>
<pre class="remontti-code"># vim /etc/apache2/sites-enabled/000-default.conf</pre>
<p>Adicione abaixo de &#8220;<span style="color: #000080;"><strong>DocumentRoot /var/www/html</strong>&#8220;</span> o seguinte:</p>
<pre class="remontti-code">	
	&lt;Directory /var/www/html/&gt;
    		Options FollowSymLinks
    		AllowOverride All
	&lt;/Directory&gt;
</pre>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150942.png" data-rel="lightbox-gallery-SKp8d1mk" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150942-300x172.png" alt="" width="300" height="172" class="alignnone size-medium wp-image-2042" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150942-300x172.png 300w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150942-768x441.png 768w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150942-1024x588.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2017/06/Screenshot_20170619_150942.png 1192w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>Por segurança recomendo remover a assinatura do servidor, evitando os &#8220;espertinhos&#8221;</p>
<pre class="remontti-code"># sed -i &#039;s/ServerTokens OS/ServerTokens Prod/&#039; /etc/apache2/conf-available/security.conf
# sed -i &#039;s/ServerSignature On/ServerSignature Off/&#039; /etc/apache2/conf-available/security.conf</pre>
<p>Agora precisamos restartar o apache para que tenha efeito nossas alterações.</p>
<pre class="remontti-code"># /etc/init.d/apache2 restart</pre>
<p>Ou</p>
<pre class="remontti-code"># systemctl restart apache2</pre>
<p>Parabéns seu servidor está &#8220;Pronto&#8221;!</p>
<p>O post <a href="https://blog.remontti.com.br/2024">Passo-a-passo como criar um servidor web Apache2, PHP 7.0, MariaDB, PHPMyAdmin &#8220;LAMP&#8221; no Debian 9 Stretch</a> apareceu primeiro em <a href="https://blog.remontti.com.br">Remontti</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.remontti.com.br/2024/feed</wfw:commentRss>
			<slash:comments>47</slash:comments>
		
		
			</item>
	</channel>
</rss>
