Files
projeto-importado/docs/dominios_fiscalnovo.md
T
2025-11-28 00:29:42 -03:00

14 KiB

Configuração: Domínios Sistemas Fiscal S-2

Cadastro no DNS

Realizar o cadastro dos domínios nos servidores de DNS, conforme abaixo:

ws-cliente      IN      A       177.11.20.19
nfse-cliente    IN      A       177.11.20.19
www.nfse-cliente        IN      A       177.11.20.19

Configuração Firewall

Edite a regra de NAT já existente, alterando para o IP do respectivo cliente: NATWEBSERVICE

Lembrar de cadastrar os dominios origens, nfse e ws no DNS Forwarder, direcionando para o IP do Apache. Conforme passos abaixo:
Vá em: Services > DNS Forwarder > Host Overrides - Add: HOSTOVERRIDES

Informe o endereço, dominio e ip do apache e clique em "save" conforme exemplo abaixo: DOMINIOS

Observação: repita esse passo para os seguintes endereços: ws-cliente, nfse-cliente e origens-cliente

Cadastro no Recaptcha

Cadastrar os domínios no Recaptcha Cliente V2 e V3: ws-cliente.atende.net, origens-cliente.atende.net e nfse-cliente.atende.net. RECAPTCHA

Configuração Apache

Insira os novos domínios no host do cliente, conforme abaixo:

# vim /etc/hosts
192.168.21.20  ws-cliente.atende.net
192.168.21.20  origens-cliente.atende.net
192.168.21.20  nfse-cliente.atende.net
192.168.21.20  www.nfse-cliente.atende.net
Obs: Altere o IP e endereço
Ex: :% s/21.20/XX.XX
    :% s/cliente/demonstracao

Alterar as configurações do arquivo php.ini para permitir uploads de arquivos com até 128MB

#vim /etc/php.ini
post_max_size = 128M
upload_max_filesize = 128M

Deve-se verificar se é necessário aumentar o recurso do cliente, por conta da implantação do sistema Fiscal S-2.
Se for necessário ampliar recursos, altere os arquivos abaixo conforme planilha de manutenção:

# vim /etc/httpd/conf.d/performance.conf
# vim /etc/httpd/conf.d/qos.conf

Após, devem ser adicionados os Virtuais Hosts.
Siga os passos abaixo:

# vim /etc/httpd/conf.d/ssl.conf
--------------------------------------------------------------
<VirtualHost *:443>

# General setup for the virtual host, inherited from global configuration
DocumentRoot "/var/www/html/cliente.atende.net"
ServerName ws-cliente.atende.net
ServerAlias ws-cliente.atende.net

# Use separate log files for the SSL virtual host; note that LogLevel
ErrorLog logs/ssl_ws-cliente.atende.net_error.log
TransferLog logs/ssl_ws-cliente.atende.net_access.log
LogLevel warn

#   SSL Engine Switch:
SSLEngine on

#   SSL Protocol support:
SSLProtocol all -SSLv2 -SSLv3

#   SSL Cipher Suite:
SSLCipherSuite "ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4"
SSLHonorCipherOrder on
SSLCompression off

#   Server Certificate:
SSLCertificateFile /usr/certificado/star_atende_net/STAR_atende_net.crt
SSLCertificateKeyFile /usr/certificado/star_atende_net/chaveprivadanova.key
SSLCACertificateFile /usr/certificado/star_atende_net/STAR_atende_net.ca-bundle
<Files ~ "\.(cgi|shtml|phtml|php3?)$">
    SSLOptions +StdEnvVars
</Files>
BrowserMatch "MSIE [2-5]" \
         nokeepalive ssl-unclean-shutdown \
         downgrade-1.0 force-response-1.0

#   Per-Server Logging:
CustomLog logs/ssl_ws-cliente.atende.net_request.log \
          "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>

<VirtualHost *:443>

# General setup for the virtual host, inherited from global configuration
DocumentRoot "/var/www/html/cliente.atende.net"
ServerName origens-cliente.atende.net
ServerAlias origens-cliente.atende.net

# Use separate log files for the SSL virtual host; note that LogLevel
ErrorLog logs/ssl_origens-cliente.atende.net_error.log
TransferLog logs/ssl_origens-cliente.atende.net_access.log
LogLevel warn

#   SSL Engine Switch:
SSLEngine on

#   SSL Protocol support:
SSLProtocol all -SSLv2 -SSLv3

#   SSL Cipher Suite:
SSLCipherSuite "ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4"
SSLHonorCipherOrder on
SSLCompression off

#   Server Certificate:
SSLCertificateFile /usr/certificado/star_atende_net/STAR_atende_net.crt
SSLCertificateKeyFile /usr/certificado/star_atende_net/chaveprivadanova.key
SSLCACertificateFile /usr/certificado/star_atende_net/STAR_atende_net.ca-bundle
<Files ~ "\.(cgi|shtml|phtml|php3?)$">
    SSLOptions +StdEnvVars
</Files>
BrowserMatch "MSIE [2-5]" \
         nokeepalive ssl-unclean-shutdown \
         downgrade-1.0 force-response-1.0

#   Per-Server Logging:
CustomLog logs/ssl_origens-cliente.atende.net_request.log \
          "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>

<VirtualHost *:443>

# General setup for the virtual host, inherited from global configuration
DocumentRoot "/var/www/html/cliente.atende.net"
ServerName nfse-cliente.atende.net
ServerAlias nfse-cliente.atende.net

# Use separate log files for the SSL virtual host; note that LogLevel
ErrorLog logs/ssl_nfse-cliente.atende.net_error.log
TransferLog logs/ssl_nfse-cliente.atende.net_access.log
LogLevel warn

#   SSL Engine Switch:
SSLEngine on

#   SSL Protocol support:
SSLProtocol all -SSLv2 -SSLv3

#   SSL Cipher Suite:
SSLCipherSuite "ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4"
SSLHonorCipherOrder on
SSLCompression off

#   Server Certificate:
SSLCertificateFile /usr/certificado/star_atende_net/STAR_atende_net.crt
SSLCertificateKeyFile /usr/certificado/star_atende_net/chaveprivadanova.key
SSLCACertificateFile /usr/certificado/star_atende_net/STAR_atende_net.ca-bundle
<Files ~ "\.(cgi|shtml|phtml|php3?)$">
    SSLOptions +StdEnvVars
</Files>
BrowserMatch "MSIE [2-5]" \
         nokeepalive ssl-unclean-shutdown \
         downgrade-1.0 force-response-1.0

#   Per-Server Logging:
CustomLog logs/ssl_nfse-cliente.atende.net_request.log \
          "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>
--------------------------------------------------------------
Obs: Lembrar de substituir o cliente. Ex: :% s/cliente/demonstracao
# vim /etc/httpd/conf/httpd.conf
--------------------------------------------------------------
<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot /var/www/html/cliente.atende.net
    ServerName nfse-cliente.atende.net
    ErrorLog logs/nfse-cliente.atende.net_error.log
    CustomLog logs/nfse-cliente.atende.net_access.log common
        <Directory />
                Options FollowSymLinks
                AllowOverride None
                SSLRequireSSL
        </Directory>
        <Directory /var/www/html/cliente.atende.net>
                Options FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>
    Redirect 301 / https://nfse-cliente.atende.net/
</VirtualHost>

<VirtualHost *:80>
    ServerName www.nfse-cliente.atende.net
    Redirect 301 / https://nfse-cliente.atende.net/
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot /var/www/html/cliente.atende.net
    ServerName origens-cliente.atende.net
    ErrorLog logs/origens-cliente.atende.net_error.log
    CustomLog logs/origens-cliente.atende.net_access.log common
        <Directory />
                Options FollowSymLinks
                AllowOverride None
                SSLRequireSSL
        </Directory>
        <Directory /var/www/html/cliente.atende.net>
                Options FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>
    Redirect 301 / https://origens-cliente.atende.net/
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot /var/www/html/cliente.atende.net
    ServerName ws-cliente.atende.net
    ErrorLog logs/ws-cliente.atende.net_error.log
    CustomLog logs/ws-cliente.atende.net_access.log common
        <Directory />
                Options FollowSymLinks
                AllowOverride None
                SSLRequireSSL
        </Directory>
        <Directory /var/www/html/cliente.atende.net>
                Options FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>
    Redirect 301 / https://ws-cliente.atende.net/
</VirtualHost>
--------------------------------------------------------------
Obs: Lembrar de substituir o cliente. Ex: :% s/cliente/demonstracao

Ajuste os arquivos awstats do cliente:

# cd /etc/awstats
# cp awstats.cliente.atende.net.conf awstats.ws-cliente.atende.net.conf
# cp awstats.cliente.atende.net.conf awstats.origens-cliente.atende.net.conf
# cp awstats.cliente.atende.net.conf awstats.nfse-cliente.atende.net.conf
Exemplo: cp awstats.demonstracao.atende.net.conf awstats.nfse-demonstracao.atende.net.conf

Em cada arquivo criado, altere o endereço:

# vim awstats.ws-cliente.atende.net.conf
:% s/cliente/ws-cliente

# vim awstats.origens-cliente.atende.net.conf
:% s/cliente/origens-cliente

# vim awstats.nfse-cliente.atende.net.conf
:% s/cliente/nfse-cliente

Confira a sintaxe do Apache:

# apachectl -t

Realizar a conferência das configurações abaixo:

# vim /etc/php.d/opcache.ini
opcache.memory_consumption=2048
opcache.interned_strings_buffer=128
opcache.max_accelerated_files=32531
opcache.consistency_checks=0
opcache.force_restart_timeout=10
# rpm -qa | grep php56w-imap
** Se estiver instalado , não precisa executar o procedimento abaixo
# cd /root/download/php56
# wget https://datacenter.atende.net/updates/libc-client-2007e-11.3.x86_64.rpm
# wget https://datacenter.atende.net/updates/php56w-imap-5.6.18-1.w7.x86_64.rpm
# rpm -Uvh libc-client-2007e-11.3.x86_64.rpm php56w-imap-5.6.18-1.w7.x86_64.rpm
# vim /etc/httpd/conf.d/deflate.conf
AddOutputFilterByType DEFLATE application/wasm

De um Graceful para que as configurações sejam aplicadas:

# apachectl -k graceful

Insira a flag abaixo no config padrão:

# vim /var/www/html/cliente.atende.net/_config.padrao.inc
$_CONFIG['versao_fiscal'] = 'S2';

Banco de Dados Atende.net

ATENÇÃO: Apenas executar o procedimento abaixo se for necessário ampliar recurso!

Altere os arquivos de configuração conforme planilha de manutenção:

# cd /etc/postgresql/16/main
# vim postgresql.prod
# vim postgresql.mig
---
max connections
shared buffers 
work mem 
maintenance_work_mem - Alterar conforme arquivo que estiver editando (prod ou mig)  
min_dynamic_shared_memory (MB)
max_locks_per_transaction - Alterar conforme arquivo que estiver editando (prod ou mig) 
max worker processes 
max parallel workers per gather 
max parallel workers 
effective cache_size   
---

Substitua pelo novo arquivo:

# cp postgresql.prod postgresql.conf
y

Altere o parâmetro huge_pages:

# vim postgresql.conf
huge_pages -> try

Reinicie a máquina apenas após o horário de expediente:

# reboot

Após o servidor reiniciar, deve-se ajustar as configurações do kernel, para isso execute o script:

# ./kernelsetup.sh

Edite o arquivo /etc/sysctl.conf e substitua as informações apresentadas pelas existentes:

# vim /etc/sysctl.conf
Ajustar conforme Retorno do script

Aplique as configurações:

# sysctl -p 

Altere o parâmetro huge_pages:

# vim postgresql.conf
huge_pages -> on

Reinicie o banco com as novas configurações. Se nenhum erro for apresentado, tudo ocorreu bem:

# systemctl restart postgresql

Configuração Stack

Acesse o Portainer do cliente e vá em Stacks. Altere o enderecoWeb de cliente.atende.net para origens-cliente.atende.net
Lembre de verificar se é necessário aumentar o recurso, conforme planilha de manutenção.

Cadastro no Atende.net

Faça login no sistema do cliente, por exempo demonstracao.atende.net e após vá em:
IPM > Gerenciamento do Sitema > Sistema > Domínios

OBS: Se for realizar o cadastro durante o dia, deixar o dominio DESATIVADO
Se for realizar o cadastro após reiniciar os serviços e fora do horário, já pode vir como ativo!

Realize o cadastro dos domínios conforme abaixo:

  • Endereço origens

Trocar o tipo para "Origens/Java Services".

ORIGENS

  • Endereço ws

WS

  • Endereço nfse

Selecionar o sistema "Nota Fiscal Eletrônica" (66) e definir o redirecionamento para o endereço abaixo, trocando apenas o nome do cliente.

https://nfse-cliente.atende.net/autoatendimento/servicos/nfse

NFSE