{"id":518,"date":"2021-04-09T14:12:02","date_gmt":"2021-04-09T17:12:02","guid":{"rendered":"https:\/\/www.xkeysti.com.br\/wiki\/?p=518"},"modified":"2021-04-09T15:09:31","modified_gmt":"2021-04-09T18:09:31","slug":"centos-7-configuracao-do-servidor","status":"publish","type":"post","link":"https:\/\/www.xkeysti.com.br\/wiki\/centos-7-configuracao-do-servidor\/","title":{"rendered":"CentOS 7 &#8211; Configura\u00e7\u00e3o do Servidor"},"content":{"rendered":"<p><span style=\"font-weight: 400;\">CONFIGURA\u00c7\u00d5ES B\u00c1SICAS<\/span><\/p>\n<p><span style=\"font-weight: 400;\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">## Dados da empresa<\/span><\/p>\n<p><span style=\"font-weight: 400;\">chfn<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">## Configura\u00e7\u00e3o de Rede &#8211; <\/span><a href=\"https:\/\/pplware.sapo.pt\/linux\/endereco-ip-no-centos-7\/\"><span style=\"font-weight: 400;\">https:\/\/pplware.sapo.pt\/linux\/endereco-ip-no-centos-7\/<\/span><\/a><span style=\"font-weight: 400;\">\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">nmtui<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">## Atualiza\u00e7\u00e3o dos pacotes<\/span><\/p>\n<p><span style=\"font-weight: 400;\">yum update<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">## Instala\u00e7\u00e3o do EPEL<\/span><\/p>\n<p><span style=\"font-weight: 400;\">yum install epel-release<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">INSTALA\u00c7\u00c3O DO MYSQL<\/span><\/p>\n<p><span style=\"font-weight: 400;\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">## Remove MariaBD<\/span><\/p>\n<p><span style=\"font-weight: 400;\">systemctl stop mariadb<\/span><\/p>\n<p><span style=\"font-weight: 400;\">yum remove mariadb-server mariadb mariadb-libs<\/span><\/p>\n<p><span style=\"font-weight: 400;\">yum clean all<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">## Add MySQL Repository\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">rpm -Uvh http:\/\/dev.mysql.com\/get\/mysql-community-release-el7-5.noarch.rpm<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">## Install MySQL Packages\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">yum install -y mysql-server<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">## Enable on Boot and Start MySQL Server\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">systemctl enable mysqld<\/span><\/p>\n<p><span style=\"font-weight: 400;\">systemctl start mysqld<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">## Definir a senha do usu\u00e1rio root do MySQL<\/span><\/p>\n<p><span style=\"font-weight: 400;\">mysql_secure_installation<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">## Criar usu\u00e1rio Xkey<\/span><\/p>\n<p><span style=\"font-weight: 400;\">CREATE USER &#8216;xkey&#8217;@&#8217;localhost&#8217; IDENTIFIED BY &#8216;xkey@123&#8217;;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">GRANT ALL PRIVILEGES ON * . * TO &#8216;xkey&#8217;@&#8217;localhost&#8217;;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">GRANT ALL PRIVILEGES ON<\/span> *.* TO &#8220;xkey&#8221;@&#8221;%&#8221; identified by &#8220;xkey@123&#8221;;<\/p>\n<p>**** Executar as duas linhas para dar permiss\u00e3o de acesso do localhost e externamente ****<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">FLUSH PRIVILEGES;<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">## Firewall rule allowing access to the MySQL server on port 3306\/tcp\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">firewall-cmd &#8211;permanent &#8211;zone=trusted &#8211;add-port=3306\/tcp<\/span><\/p>\n<p><span style=\"font-weight: 400;\">firewall-cmd &#8211;permanent &#8211;add-service=mysql<\/span><\/p>\n<p><span style=\"font-weight: 400;\">firewall-cmd &#8211;reload<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">## Instala\u00e7\u00e3o do Samba<\/span><\/p>\n<p><span style=\"font-weight: 400;\">yum install samba samba-client samba-common<\/span><\/p>\n<p><span style=\"font-weight: 400;\">mv \/etc\/samba\/smb.conf \/etc\/samba\/smb.conf.bak<\/span><\/p>\n<p><span style=\"font-weight: 400;\">mkdir -p \/dados\/xkey\/sax<\/span><\/p>\n<p><span style=\"font-weight: 400;\">vim \/etc\/samba\/smb.conf<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">################################################################################<\/span><\/p>\n<p><span style=\"font-weight: 400;\">## Arquivo smb.conf<\/span><\/p>\n<p><span style=\"font-weight: 400;\">[global]<\/span><\/p>\n<p><span style=\"font-weight: 400;\">workgroup = WORKGROUP<\/span><\/p>\n<p><span style=\"font-weight: 400;\">server string = Samba Server %v<\/span><\/p>\n<p><span style=\"font-weight: 400;\">netbios name = xkey<\/span><\/p>\n<p><span style=\"font-weight: 400;\">security = user<\/span><\/p>\n<p><span style=\"font-weight: 400;\">map to guest = bad user<\/span><\/p>\n<p><span style=\"font-weight: 400;\">dns proxy = no<\/span><\/p>\n<p><span style=\"font-weight: 400;\">#============================ Share Definitions ==============================\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">[SAX-Xkey]<\/span><\/p>\n<p><span style=\"font-weight: 400;\">path = \/dados\/xkey\/sax<\/span><\/p>\n<p><span style=\"font-weight: 400;\">browsable =yes<\/span><\/p>\n<p><span style=\"font-weight: 400;\">writable = yes<\/span><\/p>\n<p><span style=\"font-weight: 400;\">guest ok = yes<\/span><\/p>\n<p><span style=\"font-weight: 400;\">read only = no<\/span><\/p>\n<p><span style=\"font-weight: 400;\">################################################################################<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">systemctl enable smb.service<\/span><\/p>\n<p><span style=\"font-weight: 400;\">systemctl enable nmb.service<\/span><\/p>\n<p><span style=\"font-weight: 400;\">systemctl restart smb.service<\/span><\/p>\n<p><span style=\"font-weight: 400;\">systemctl restart nmb.service<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">firewall-cmd &#8211;permanent &#8211;zone=public &#8211;add-service=samba<\/span><\/p>\n<p><span style=\"font-weight: 400;\">firewall-cmd &#8211;reload<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">chmod 755 \/dados\/xkey\/sax\/<\/span><\/p>\n<p><span style=\"font-weight: 400;\">chown -R nobody:nobody \/dados\/xkey\/sax\/<\/span><\/p>\n<p><span style=\"font-weight: 400;\">chcon -t samba_share_t \/dados\/xkey\/sax<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"http:\/\/www.tecdicas.com\/servidor-centos-7-instalando-o-mysql-server\/\"><span style=\"font-weight: 400;\">http:\/\/www.tecdicas.com\/servidor-centos-7-instalando-o-mysql-server\/<\/span><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>CONFIGURA\u00c7\u00d5ES B\u00c1SICAS &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; ## Dados da empresa chfn &nbsp; ## Configura\u00e7\u00e3o de Rede &#8211; https:\/\/pplware.sapo.pt\/linux\/endereco-ip-no-centos-7\/\u00a0 nmtui &nbsp; ## Atualiza\u00e7\u00e3o dos pacotes yum update &nbsp; ## Instala\u00e7\u00e3o do EPEL yum install epel-release &nbsp; INSTALA\u00c7\u00c3O DO MYSQL &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; ## Remove MariaBD systemctl stop mariadb yum remove mariadb-server mariadb mariadb-libs yum clean all &nbsp; ## Add MySQL Repository\u00a0&hellip;<\/p>\n","protected":false},"author":12,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-518","post","type-post","status-publish","format-standard","hentry","category-parametros-e-configuracoes"],"_links":{"self":[{"href":"https:\/\/www.xkeysti.com.br\/wiki\/wp-json\/wp\/v2\/posts\/518","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xkeysti.com.br\/wiki\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xkeysti.com.br\/wiki\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xkeysti.com.br\/wiki\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xkeysti.com.br\/wiki\/wp-json\/wp\/v2\/comments?post=518"}],"version-history":[{"count":3,"href":"https:\/\/www.xkeysti.com.br\/wiki\/wp-json\/wp\/v2\/posts\/518\/revisions"}],"predecessor-version":[{"id":521,"href":"https:\/\/www.xkeysti.com.br\/wiki\/wp-json\/wp\/v2\/posts\/518\/revisions\/521"}],"wp:attachment":[{"href":"https:\/\/www.xkeysti.com.br\/wiki\/wp-json\/wp\/v2\/media?parent=518"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xkeysti.com.br\/wiki\/wp-json\/wp\/v2\/categories?post=518"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xkeysti.com.br\/wiki\/wp-json\/wp\/v2\/tags?post=518"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}