Mudanças entre as edições de "Setup Inicial"

De Gigafull
Ir para navegação Ir para pesquisar
Linha 43: Linha 43:
 
== Configurações Banco de Dados ==
 
== Configurações Banco de Dados ==
 
  '''Alterar usuário root'''
 
  '''Alterar usuário root'''
  Mysql
+
  mysql
  ALTER USER 'root'@'localhost' IDENTIFIED BY 'senhanova';
+
  ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password by 'senha';
 
  exit;
 
  exit;
 
  mysql_secure_installation
 
  mysql_secure_installation
 +
VALIDATE PASSWORD COMPONENT = n
 +
Change the password for root = n
 +
Remove anonymous users?  = y
 +
Disallow root login remotely? = n
 +
Remove test database and access to it? = y
 +
Reload privilege tables now? = y
 +
 +
'''Criando database'''
 +
mysql -u root -p
 +
create database dbsistem character set utf8 collate utf8_bin;
 +
create user 'dbsistem'@'%' identified by 'senha';
 +
grant all privileges on *.* to 'dbsistem'@'%';
 +
FLUSH PRIVILEGES;
 +
quit;
  
 
  '''Liberação acesso remoto ao banco de dados'''
 
  '''Liberação acesso remoto ao banco de dados'''
 
  vi /etc/mysql/mysql.conf.d/mysqld.cnf
 
  vi /etc/mysql/mysql.conf.d/mysqld.cnf
 
  Alterar o campo bind-address 127.0.0.1 para 0.0.0.0
 
  Alterar o campo bind-address 127.0.0.1 para 0.0.0.0
  mysql -u root -p
+
  systemctl restart mysql
  GRANT ALL ON *.* TO 'root'@'%.%.%.%' IDENTIFIED BY 'KR6G2TV0bThHdtZq';
+
 
  GRANT USAGE ON *.* TO 'root'@'%.%.%.%' WITH GRANT OPTION;
+
  '''Liberação root'''
  FLUSH PRIVILEGES;
+
  Acessar o mysql via Workbench
 +
Ir em Users and Privileges
 +
  Alterar Limit Hosts Matching para %

Edição das 13h51min de 16 de dezembro de 2022

Requisitos SO

Sistema Operacional: Ubuntu Server 22.04.1 LTS

Memória: 2Gb
Disco: 200Gb
CPU: 2vCPU

Orientações Instalação

Idioma: Português
Tipo Instalação: Ubuntu Server
IP: Fixo e Público
Proxy: Deixar em branco
Nome: GIGAFULL SOLUCOES TECNOLOGICAS
Nome do Servidor: gigafull-admin
Nome do utilizador: gigafull
Senha: 123mudar
Install OpenSSH Server: Sim

Orientações Após Instalação

Atualizar
apt-get update
apt-get upgrade
Instalar pacotes básicos
apt-get install net-tools -y
apt-get install apache2 -y
apt-get install nmap -y
apt-get install php libapache2-mod-php php-mysql -y
apt install unzip -y
systemctl start apache2
systemctl enable apache2
apt-get install mysql-server -y
systemctl start mysql.service
systemctl enable mysql.service
Permitir remote root login
vim /etc/ssh/sshd_config
#Na linha PermitRootLogin alterar
De: PermitRootLogin no
Para PermitRootLogin yes
systemctl restart sshd

Configurações Banco de Dados

Alterar usuário root
mysql
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password by 'senha';
exit;
mysql_secure_installation
VALIDATE PASSWORD COMPONENT = n
Change the password for root = n
Remove anonymous users?  = y
Disallow root login remotely? = n
Remove test database and access to it? = y
Reload privilege tables now? = y
Criando database
mysql -u root -p
create database dbsistem character set utf8 collate utf8_bin;
create user 'dbsistem'@'%' identified by 'senha';
grant all privileges on *.* to 'dbsistem'@'%';
FLUSH PRIVILEGES;
quit;
Liberação acesso remoto ao banco de dados
vi /etc/mysql/mysql.conf.d/mysqld.cnf
Alterar o campo bind-address 127.0.0.1 para 0.0.0.0
systemctl restart mysql
Liberação root
Acessar o mysql via Workbench
Ir em Users and Privileges
Alterar Limit Hosts Matching para %