[linux]$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv … · 2019. 1. 28. · [linux]$...

10
apt [linux]$ sudo touch /etc/apt/sources.list.d/pgdg.list [linux]$ echo "deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list [linux]$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv ACCC4CF8 [linux]$ sudo apt-get install language-pack-gnome-pt language-pack-pt-base myspell-pt myspell-pt-br wbrazilian wportuguese [linux]$ sudo nano /usr/share/i18n/locales/pt_BR LC_COLLATE END LC_COLLATE reorder-after <U00A0> <U0020><CAP>;<CAP>;<CAP>;<U0020> reorder-end [linux]$ sudo localedef -i pt_BR -c -f ISO-8859-1 -A /usr/share/locale/locale.alias pt_BR [linux]$ sudo locale-gen pt_BR [linux]$ sudo dpkg-reconfigure locales

Transcript of [linux]$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv … · 2019. 1. 28. · [linux]$...

Page 1: [linux]$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv … · 2019. 1. 28. · [linux]$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv ACCC4CF8 [linux]$ sudo

apt

[linux]$sudotouch/etc/apt/sources.list.d/pgdg.list[linux]$echo"debhttp://apt.postgresql.org/pub/repos/apt/bionic-pgdgmain"|sudotee/etc/apt/sources.list.d/pgdg.list

[linux]$sudoapt-keyadv--keyserverkeyserver.ubuntu.com--recvACCC4CF8

[linux]$sudoapt-getinstalllanguage-pack-gnome-ptlanguage-pack-pt-basemyspell-ptmyspell-pt-brwbrazilianwportuguese

[linux]$sudonano/usr/share/i18n/locales/pt_BR

LC_COLLATE ENDLC_COLLATE

reorder-after<U00A0><U0020><CAP>;<CAP>;<CAP>;<U0020>reorder-end

[linux]$sudolocaledef-ipt_BR-c-fISO-8859-1-A/usr/share/locale/locale.aliaspt_BR[linux]$sudolocale-genpt_BR[linux]$sudodpkg-reconfigurelocales

Page 2: [linux]$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv … · 2019. 1. 28. · [linux]$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv ACCC4CF8 [linux]$ sudo

[linux]$sudoapt-getupdate[linux]$sudoapt-getinstallpostgresql-9.5postgresql-client-9.5postgresql-contrib-9.5

[linux]$sudopg_dropcluster--stop9.5main

[linux]$sudopg_createcluster-upostgres-gpostgres-eLATIN1--locale="pt_BR.ISO-8859-1"--lc-collate="pt_BR.ISO-8859-1"9.5ecidade

/etc/postgresql/9.2/ecidade/pg_hba.conf

[linux]$sudonano/etc/postgresql/9.5/ecidade/pg_hba.conf

# trust

[linux]$sudonano/etc/postgresql/9.5/ecidade/postgresql.conf

#

listen_addresses='*'max_connections=20bytea_output='escape'max_locks_per_transaction=256default_with_oids=onescape_string_warning=offstandard_conforming_strings=off

[linux]$sudo/etc/init.d/postgresqlstart

[linux]$psql-Upostgres-hlocalhost-l

Nome|Dono|Codificação|Collate|Ctype|Privilégiosdeacesso-----------+----------+-------------+------------------+------------------+-----------------------postgres|postgres|LATIN1|pt_BR.ISO-8859-1|pt_BR.ISO-8859-1|template0|postgres|LATIN1|pt_BR.ISO-8859-1|pt_BR.ISO-8859-1|=c/postgres+|||||postgres=CTc/postgrestemplate1|postgres|LATIN1|pt_BR.ISO-8859-1|pt_BR.ISO-8859-1|=c/postgres+|||||postgres=CTc/postgres

psql-Upostgres-c"CREATEROLEecidadeWITHSUPERUSERLOGINPASSWORD'ecidade';"psql-Upostgres-c"CREATEROLEdbsellerWITHLOGINPASSWORD'dbseller';"psql-Upostgres-c"CREATEROLEpluginWITHLOGINPASSWORD'plugin';"

Page 3: [linux]$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv … · 2019. 1. 28. · [linux]$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv ACCC4CF8 [linux]$ sudo

psql-Upostgres-c"CREATEDATABASEecidadeOWNERecidade;"

[linux]$psql-Upostgres-hlocalhost-l

Nome|Dono|Codificação|Collate|Ctype|Privilégiosdeacesso-----------+----------+-------------+------------------+------------------+-----------------------ecidade|ecidade|LATIN1|pt_BR.ISO-8859-1|pt_BR.ISO-8859-1|postgres|postgres|LATIN1|pt_BR.ISO-8859-1|pt_BR.ISO-8859-1|template0|postgres|LATIN1|pt_BR.ISO-8859-1|pt_BR.ISO-8859-1|=c/postgres+|||||postgres=CTc/postgrestemplate1|postgres|LATIN1|pt_BR.ISO-8859-1|pt_BR.ISO-8859-1|=c/postgres+|||||postgres=CTc/postgres

[linux]$sudoapt-getinstallapache2

[linux]$sudocp/etc/apache2/sites-available/000-default.conf/etc/apache2/sites-available/000-default.conf.dist

VirtualHost

[linux]$sudonano/etc/apache2/sites-available/000-default.conf

VirtualHost

<VirtualHost*:80>...AddDefaultCharsetISO-8859-1LimitRequestLine16382LimitRequestFieldSize16382Timeout12000<Directory/var/www/html>Options-Indexes+FollowSymLinks+MultiViewsAllowOverrideAll</Directory>...</VirtualHost>

[linux]$sudoa2enmodrewrite

[linux]$sudo/etc/init.d/apache2restart

[linux]$sudoadd-apt-repository-yppa:ondrej/php[linux]$sudoapt-getupdate

Page 4: [linux]$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv … · 2019. 1. 28. · [linux]$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv ACCC4CF8 [linux]$ sudo

[linux]$sudoapt-getinstallphp5.6php5.6-bcmathphp5.6-bz2php5.6-cliphp5.6-commonphp5.6-curlphp5.6-gdphp5.6-interbasephp5.6-jsonphp5.6-mbstringphp5.6-mcrypt[linux]$sudoapt-getinstallphp5.6-pgsqlphp5.6-soapphp5.6-sqlite3php5.6-xmlphp5.6-xmlrpcphp5.6-zipunzipzipphp5.6-commonphp5.6-interbaselibapache2-mod-php5.6

[linux]$sudomkdir/var/www/html/tmp[linux]$sudochown-Rwww-data./var/www/html/tmp[linux]$sudochmod-R777/var/www/html/tmp[linux]$sudomkdir/var/www/tmp[linux]$sudochown-Rwww-data./var/www/tmp[linux]$sudochmod-R777/var/www/tmp

[linux]$sudonano/etc/php/5.6/apache2/php.ini

;

error_reporting=E_ALL&~E_NOTICE&~E_DEPRECATEDregister_argc_argv=Onpost_max_size=200Mupload_max_filesize=200Mdefault_socket_timeout=60000max_execution_time=60000max_input_time=60000memory_limit=512Mdisplay_errors=Offlog_errors=Onerror_log=/var/log/apache2/php_errors.logsession.gc_maxlifetime=7200ignore_repeated_errors=Onshort_open_tag=Ondate.timezone="America/Sao_Paulo"

[linux]$sudotouch/var/log/apache2/php_errors.log[linux]$sudochmod777/var/log/apache2/php_errors.log

[linux]$sudo/etc/init.d/apache2restart

[linux]$sudoapt-getinstalllibreoffice-writerpython3-unoopenjdk-8-jrettf-mscorefonts-installer

[linux]$sudonano/etc/init.d/e-cidade_libreoffice-server

#!/bin/bash###BEGININITINFO#libreoffice.orgheadlessserverscript#Provides:DBSeller([email protected])#Required-Start:#Required-Stop:#Default-Start:2345#Default-Stop:016#X-Interactive:true#Short-Description:start/stop/restartlibreoffice.orgheadlessserverscript###ENDINITINFOOOo_HOME=/usr/binSOFFICE_PATH=$OOo_HOME/sofficePIDFILE=/var/run/e-cidade_libreoffice-server/libreoffice-server.pidset-e[-d/var/run/e-cidade_libreoffice-server]||mkdir-p/var/run/e-cidade_libreoffice-servercase"$1"instart)if[-e$PIDFILE];thenecho"LibreOfficeheadlesfoiiniciado."sleep2exit

Page 5: [linux]$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv … · 2019. 1. 28. · [linux]$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv ACCC4CF8 [linux]$ sudo

fiecho"IniciandoLibreOfficeheadless"$SOFFICE_PATH--headless--nologo--nofirststartwizard--accept="socket,host=127.0.0.1,port=8100;urp"&>/dev/null2>&1touch$PIDFILE;;stop)if[-e$PIDFILE];thenecho"ParandoLibreOfficeheadless."if[["$(psaux|grep-vgrep|grepsoffice.bin|awk'{print$2}')"!=""]];thenkill-9$(psaux|grep-vgrep|grepsoffice.bin|awk'{print$2}')firm-rf$PIDFILEexitfiecho"OLibreOfficeheadlessnãoestáexecutando."exit;;restart)/etc/init.d/e-cidade_libreoffice-serverstop/etc/init.d/e-cidade_libreoffice-serverstartexit;;*)echo"Usage:$0{start|stop|restart}"exit1;;esacexit0

[linux]$sudochmod+x/etc/init.d/e-cidade_libreoffice-server[linux]$sudoupdate-rc.de-cidade_libreoffice-serverdefaults

[linux]$sudo/etc/init.d/e-cidade_libreoffice-serverstart

completo e-cidade-

xxxx-x-linux.completo.tar.bz2

dbseller

[linux]$sudouseradd-d/home/dbseller-gwww-data-Gsudo,adm,cdrom,dip,plugdev-k/etc/skel-m-s/bin/bashdbseller

[linux]$sudopasswddbseller

[linux]$sudonano/etc/login.defs

#

UMASK002

[linux]$sudonano/etc/apache2/envvars

umask002

Page 6: [linux]$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv … · 2019. 1. 28. · [linux]$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv ACCC4CF8 [linux]$ sudo

[linux]$tarxjfe-cidade-xxxx-x-linux.completo.tar.bz2

[linux]$sudocp-re-cidade-xxxx-x-linux.completo/e-cidade/var/www/html

[linux]$sudocp/var/www/html/e-cidade/libs/db_conn.php.dist/var/www/html/e-cidade/libs/db_conn.php

[linux]$sudonano/var/www/html/e-cidade/libs/db_conn.php

$DB_USUARIO='ecidade';$DB_SENHA='ecidade';$DB_SERVIDOR='localhost';$DB_PORTA='5432';$DB_PORTA_ALT='5432';$DB_BASE='ecidade';

[linux]$sudocp/var/www/html/e-cidade/config/plugins.json.dist/var/www/html/e-cidade/config/plugins.json

[linux]$sudonano/var/www/html/e-cidade/config/plugins.json

{"AcessoBase":{"usuario":"plugin","senha":"plugin"}}

[linux]$sudocp/var/www/html/e-cidade/libs/config.mail.php.dist/var/www/html/e-cidade/libs/config.mail.php[linux]$sudonano/var/www/html/e-cidade/libs/config.mail.php

$sClass=3;$sSslt='';//qualotipodesslqserautilizados(ex:tls),porpadraoévazio$bAuth=true;//autenticacaohabilitada$sUser='[email protected]';$sPass='senhaexemplo';$sHost='smtp.exemplo.com.br';$sPort='25';

[linux]$sudocp/var/www/html/e-cidade/config/require_extensions.xml.dist/var/www/html/e-cidade/config/require_extensions.xml

schema

[linux]$psql-Uecidade-decidade-fe-cidade-xxxx-x-linux.completo/sql/e-cidade-xxxx-x.sql2>/tmp/erros.txt

[linux]$psql-Uecidade-decidade-c"VACUUMANALYZEVERBOSE;"

[linux]$sudochown-Rwww-data./var/www/html/e-cidade[linux]$sudochmod-R775/var/www/html/e-cidade[linux]$sudochmod-R777/var/www/html/e-cidade/tmp

Page 7: [linux]$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv … · 2019. 1. 28. · [linux]$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv ACCC4CF8 [linux]$ sudo

[linux]$sudomkdir/var/www/html/e-cidade/integracao_externa/auditoria/log[linux]$sudochmod-R777/var/www/html/e-cidade/integracao_externa/auditoria/log

dbseller

[linux]$crontab-e

#DBSeller-Agendamentodoscriptparamigracaodoacountparanovaestrutura"db_auditoria"*/30****cd/var/www/html/e-cidade/integracao_externa/auditoria;./auditoria_migracao.sh0101>log/auditoria_migracao.log2>&1*/10****cd/var/www/html/e-cidade/integracao_externa/auditoria;php-qauditoria_adiciona_fila.php>log/auditoria_adiciona_fila.log2>&1

[linux]$sudomkdir-p/opt/dbseller/scripts[linux]$sudonano/opt/dbseller/scripts/ativadorGerenciadorTarefasEcidade.sh

#!/bin/bashsDiretorioEcidade="/var/www/html/e-cidade"if[!-d$sDiretorioEcidade];thenecho"Diretorio$sDiretorioEcidadenaoexiste"exit1;fisTarefa=$(psaux|grep"con4_gerenciadortarefas002.php"|grep-v"grep");if["$sTarefa"==""];thenecho"Agendadordetarefasparou!ZBX:ERRO:AGENDADOR-PARADO">$sDiretorioEcidade/ativadorGerenciadorTarefasEcidade.logcd$sDiretorioEcidade;/usr/bin/php-qFrontIntegracaoExterna.php--executablecon4_gerenciadortarefas002.php>tmp/log_gerenciador_tarefas.log2>tmp/erros_gerenciador_tarefas.log&sleep10sTarefa=$(psaux|grep"con4_gerenciadortarefas002.php"|grep-v"grep");if["$sTarefa"!=""];thenecho"Agendadordetarefasiniciado!ZBX:AGENDADOR-INICIADO">$sDiretorioEcidade/ativadorGerenciadorTarefasEcidade.logfifi

[linux]$sudochmod+x/opt/dbseller/scripts/ativadorGerenciadorTarefasEcidade.sh

root

[linux]$sudocrontab-e

#DBSeller-Agendamentodoscriptdeverificacaodogerenciadordetarefas*/15****cd/opt/dbseller/scripts&&su-s/bin/bashwww-data-c"bashativadorGerenciadorTarefasEcidade.sh"

dbseller

[linux]$sudocp-re-cidade-xxxx-x-linux.completo/e-cidadeonline/var/www/html

[linux]$sudocp/var/www/html/e-cidadeonline/libs/db_conn.php.dist/var/www/html/e-cidadeonline/libs/db_conn.php

Page 8: [linux]$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv … · 2019. 1. 28. · [linux]$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv ACCC4CF8 [linux]$ sudo

[linux]$sudonano/var/www/html/e-cidadeonline/libs/db_conn.php

$DB_INSTITUICAO=1;$DB_SERVIDOR='localhost';$DB_BASEDADOS='ecidade';$DB_USUARIO='ecidade';$DB_SENHA='ecidade';$DB_PORTA='5432';

[linux]$sudocp/var/www/html/e-cidadeonline/libs/config.mail.php.dist/var/www/html/e-cidadeonline/libs/config.mail.php[linux]$sudonano/var/www/html/e-cidadeonline/libs/config.mail.php

$sClass=3;$sSslt='';//qualotipodesslqserautilizados(ex:tls),porpadraoévazio$bAuth=true;//autenticacaohabilitada$sUser='[email protected]';$sPass='senhaexemplo';$sHost='smtp.exemplo.com.br';$sPort='25';

[linux]$sudochown-Rwww-data./var/www/html/e-cidadeonline[linux]$sudochmod-R775/var/www/html/e-cidadeonline[linux]$sudochmod-R777/var/www/html/e-cidadeonline/tmp

dbseller

[linux]$sudocp-a/var/www/html/e-cidade/libs/db_cubo_bi_config.php.dist/var/www/html/e-cidade/libs/db_cubo_bi_config.php

[linux]$sudonano/var/www/html/e-cidade/libs/db_cubo_bi_config.php

$configCuboBi['ftp']['server']="endereco.ip.do.servidor";$configCuboBi['ftp']['usuario']="nome-usuario-ftp";$configCuboBi['ftp']['senha']="senha-do-usuario-ftp";$configCuboBi['ftp']['diretorio']="diretorio-de-destino";$configCuboBi['ftp']['passive_mode']=true;

[linux]$sudocp-a/var/www/html/e-cidade/libs/db_config_horus.php.dist/var/www/html/e-cidade/libs/db_config_horus.php

[linux]$sudonano/var/www/html/e-cidade/libs/db_config_horus.php

//Homologação$sUrlWebService="http://189.28.128.37/horus-ws-basico/RecebeDadosWS?wsdl";$sLogin="nome-usuario-horus";$sSenha="senha-do-usuario-horus";

Page 9: [linux]$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv … · 2019. 1. 28. · [linux]$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv ACCC4CF8 [linux]$ sudo

dbseller

[linux]$crontab-e

#DBSeller-AgendamentodoscriptparalimpezadecadastroduplosCGM022***cd/var/www/html/e-cidade/;/usr/bin/phpFrontIntegracaoExterna.php--executableduplos.php>duplos.log2>&1

dbseller

[linux]$crontab-e

#DBSeller-AgendamentodoscriptparalimpezadecadastroduplosCGS022***cd/var/www/html/e-cidade/;/usr/bin/phpFrontIntegracaoExterna.php--executableduploscgs.php>duploscgs.log2>&1

1

.../iss4_gissonline002.php1>/dev/null2>&1

2

.../iss4_gissonline002.php2>/dev/null2>&1

dbseller

[linux]$crontab-e

#DBSeller-AgendamentodoscriptparaexecuçãodaintegraçãoGISS022***cd/var/www/html/e-cidade/;/usr/bin/phpFrontIntegracaoExterna.php--dirintegracao_externa/gissonline--executableintegracao_externa/gissonline/iss4_gissonline002.php>/dev/null2>&1

dbseller

[linux]$crontab-e

#DBSeller-AgendamentodoscriptparaexecuçãodaintegraçãoSIGCORP022***cd/var/www/e-cidade/;/usr/bin/phpFrontIntegracaoExterna.php--dirintegracao_externa/sigcorp--executableintegracao_externa/sigcorp/iss4_sigcorp001.php>/dev/null2>&1

dbseller

[linux]$crontab-e

#DBSeller-AgendamentodoscriptparaexecuçãodaintegraçãoWEBISS022***cd/var/www/html/e-cidade/;/usr/bin/phpFrontIntegracaoExterna.php--executableintegracao_externa/webiss/iss4_webiss001.php>/dev/null2>&1

dbseller

[linux]$crontab-e

Page 10: [linux]$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv … · 2019. 1. 28. · [linux]$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv ACCC4CF8 [linux]$ sudo

#DBSeller-Agendamentodoscriptparageraçãodastabelasdébitos020***cd/var/www/html/e-cidade/integracao_externa/debitos;./debitos.sh&>/dev/null

[linux]$cd/var/www/html/e-cidade/integracao_externa/debitos/lib[linux]$cp-adebitos.conf.distdebitos.conf

[linux]$nanodebitos.conf

#Permitedefiniraperiodicidadecomqueamanutencaodatabeladebitos#seraexecutada.Ovalorespermitidossao:-1=desativa,0=todosoudiadasemana(1=segunda,2=terca...7=domingo).##Exemplo:#DEBITOS_PERIODO="7"#DEBITOS_PERIODO=""

#Permitedefinironumerodediasnopassadoparamanterosregistrosnadebitos.##Exemplo:#DEBITOS_DIAS_MANTER="14"#DEBITOS_DIAS_MANTER=""

#Permitedefinirocodigoda(s)instituicao(oes)quedeve(em)sergeradadebitos.Sehouver#maisdeumainstituicao,osseuscodigosdevemserseparadosporespa�o.##Exemplo:#DEBITOS_INSTITUICOES="1"#DEBITOS_INSTITUICOES="13"#DEBITOS_INSTITUICOES=""