Instalação CMS · 7 min read · Dec 19, 2025

Como Instalar o Flatpress CMS com SSL Let's Encrypt no Ubuntu 22.04

FlatPress é um sistema de gerenciamento de conteúdo gratuito, de código aberto e o mais rápido. Ele é escrito na linguagem PHP e é uma ótima ferramenta para quem não tem acesso a banco de dados. É um mecanismo de blog leve, fácil de configurar e excelente na categoria de social e comunicações. Ele suporta múltiplas línguas, plugins, temas, widgets e muito mais.

Neste tutorial, vou explicar como instalar o FlatPress no servidor Ubuntu 22.04.

Requisitos

  • Um servidor rodando Ubuntu 22.04.
  • Um usuário não-root com privilégios sudo.

Instalar Apache e PHP

Por padrão, o PHP 8.1 é a versão padrão do PHP no Ubuntu 22.04. Mas, o FlatPress suporta apenas a versão PHP 8.0. Portanto, você precisará adicionar o repositório PHP ao seu sistema. Você pode adicioná-lo com o seguinte comando:

apt install software-properties-common -y  
add-apt-repository ppa:ondrej/php

Uma vez que o repositório é adicionado, instale o Apache, PHP e todas as extensões PHP necessárias executando o seguinte comando:

apt-get install apache2 php8.0 php8.0-mysql php8.0-curl php8.0-cgi libapache2-mod-php8.0 php8.0-mcrypt php8.0-xmlrpc php8.0-gd php8.0-mbstring php8.0 php8.0-common php8.0-xmlrpc php8.0-soap php8.0-xml php8.0-intl php8.0-cli php8.0-ldap php8.0-zip php8.0-readline php8.0-imap php8.0-tidy php8.0-sql php8.0-intl wget unzip -y

Após instalar todos os pacotes, inicie o serviço Apache e habilite-o para iniciar na inicialização com o seguinte comando:

systemctl start apache2  
systemctl enable apache2

Uma vez que você tenha terminado, pode prosseguir para a próxima etapa.

Instalar FlatPress

Primeiro, visite o repositório Git do FlatPress e baixe a versão mais recente com o seguinte comando:

wget https://github.com/flatpressblog/flatpress/archive/1.2.1.zip

Em seguida, descompacte o arquivo baixado com o seguinte comando:

unzip 1.2.1.zip

Em seguida, copie o diretório extraído para o diretório raiz do Apache e dê as permissões adequadas com o seguinte comando:

cp -r flatpress-1.2.1 /var/www/html/flatpress
chown -R www-data.www-data /var/www/html/flatpress  
chmod -R 775 /var/www/html/flatpress

Configurar Apache para FlatPress

Em seguida, você precisará criar um arquivo de host virtual do Apache para o Flatpress. Você pode criá-lo com o seguinte comando:

nano /etc/apache2/sites-available/flatpress.conf

Adicione as seguintes linhas:


     ServerAdmin [email protected]
     DocumentRoot /var/www/html/flatpress
     ServerName flatpress.example.com

     
          AllowOverride All
          Require all granted
     

     ErrorLog ${APACHE_LOG_DIR}/flatpress_error.log
     CustomLog ${APACHE_LOG_DIR}/flatpress_access.log combined

Salve e feche o arquivo. Em seguida, habilite o host virtual com o seguinte comando:

a2ensite flatpress

Em seguida, habilite o módulo de reescrita do Apache e recarregue o serviço Apache com o seguinte comando:

a2enmod rewrite  
systemctl restart apache2

Você também pode verificar o status do Apache com o seguinte comando:

systemctl status apache2

Você deve ver a seguinte saída:

? apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
     Active: active (running) since Sun 2022-11-20 11:37:30 UTC; 6s ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 100768 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
   Main PID: 100772 (apache2)
      Tasks: 6 (limit: 2242)
     Memory: 14.3M
        CPU: 85ms
     CGroup: /system.slice/apache2.service
             ??100772 /usr/sbin/apache2 -k start
             ??100773 /usr/sbin/apache2 -k start
             ??100774 /usr/sbin/apache2 -k start
             ??100775 /usr/sbin/apache2 -k start
             ??100776 /usr/sbin/apache2 -k start
             ??100777 /usr/sbin/apache2 -k start

Nov 20 11:37:30 ubuntu2204 systemd[1]: Starting The Apache HTTP Server...

Uma vez que você tenha terminado, pode prosseguir para a próxima etapa.

Proteger o FlatPress com SSL Let’s Encrypt

É uma boa ideia proteger seu site FlatPress com um certificado SSL Let’s Encrypt. Para isso, você precisará instalar o cliente Certbot em seu sistema. O Certbot é um pacote cliente que ajuda você a baixar e gerenciar certificados SSL em seu site.

Você pode instalar o Certbot com o seguinte comando:

apt-get install certbot python3-certbot-apache -y

Uma vez que o cliente Certbot tenha sido instalado com sucesso, execute o seguinte comando para instalar o SSL Let’s Encrypt para seu site:

certbot --apache -d flatpress.example.com

Você será solicitado a fornecer seu e-mail válido e aceitar os termos de serviço, conforme mostrado abaixo:

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
Enter email address (used for urgent renewal and security notices) (Enter 'c' to
cancel): [email protected]

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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's Encrypt project and the non-profit
organization that develops Certbot? We'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: Y

Obtaining a new certificate
Performing the following challenges:
http-01 challenge for flatpress.example.com
Enabled Apache rewrite module
Waiting for verification...
Cleaning up challenges
Created an SSL vhost at /etc/apache2/sites-available/flatpress-le-ssl.conf
Enabled Apache socache_shmcb module
Enabled Apache ssl module
Deploying Certificate to VirtualHost /etc/apache2/sites-available/flatpress-le-ssl.conf
Enabling available site: /etc/apache2/sites-available/flatpress-le-ssl.conf

Em seguida, selecione se deseja ou não redirecionar o tráfego HTTP para HTTPS ou configurar o Nginx para redirecionar todo o tráfego para acesso seguro HTTPS, conforme mostrado na seguinte saída:

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're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2

Digite 2 e pressione Enter para iniciar o processo. Uma vez que a instalação esteja concluída, você deve obter a seguinte saída:

Enabled Apache rewrite module
Redirecting vhost in /etc/apache2/sites-enabled/flatpress.conf to ssl vhost in /etc/apache2/sites-available/flatpress-le-ssl.conf

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have successfully enabled https://flatpress.example.com

You should test your configuration at:
https://www.ssllabs.com/ssltest/analyze.html?d=flatpress.example.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/flatpress.example.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/flatpress.example.com/privkey.pem
   Your cert will expire on 2023-02-20. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot again
   with the "certonly" option. To non-interactively renew *all* of
   your certificates, run "certbot renew"
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le

Neste ponto, seu site FlatPress está protegido com SSL Let’s Encrypt. Você agora pode acessar seu site de forma segura usando o protocolo HTTPS.

Acessar o FlatPress CMS

Agora, abra seu navegador e digite a URL https://flatpress.example.com. Você será redirecionado para a página de instalação do FlatPress:

Instalador do FlatPress CMS

Agora, clique no botão Próximo. Você deve ver a página de criação do usuário Admin:

Criar um usuário

Aqui, forneça seu nome de usuário admin, senha, e-mail e clique no botão Próximo. Você deve ver a seguinte página:

Instalação do FlatPress concluída

Clique no botão Login agora. Você deve ver a seguinte página:

Login do FlatPress

Forneça seu nome de usuário admin, senha e clique no botão Login. Você deve ver a seguinte página:

Admin do FlatPress

Conclusão

Este tutorial explicou como instalar o FlatPress com Apache e SSL Let’s Encrypt no Ubuntu 22.04. Agora você pode criar um site e blog simples e rápido usando o CMS FlatPress. Sinta-se à vontade para me perguntar se você tiver alguma dúvida.

Share: X/Twitter LinkedIn

Receba novas postagens na sua caixa de entrada

Sem spam. Cancele a assinatura a qualquer momento.