CentOS 7 – Configuração do Servidor
CONFIGURAÇÕES BÁSICAS
————————————————
## Dados da empresa
chfn
## Configuração de Rede – https://pplware.sapo.pt/linux/endereco-ip-no-centos-7/
nmtui
## Atualização dos pacotes
yum update
## Instalação do EPEL
yum install epel-release
INSTALAÇÃO DO MYSQL
————————————————
## Remove MariaBD
systemctl stop mariadb
yum remove mariadb-server mariadb mariadb-libs
yum clean all
## Add MySQL Repository
rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
## Install MySQL Packages
yum install -y mysql-server
## Enable on Boot and Start MySQL Server
systemctl enable mysqld
systemctl start mysqld
## Definir a senha do usuário root do MySQL
mysql_secure_installation
## Criar usuário Xkey
CREATE USER ‘xkey’@’localhost’ IDENTIFIED BY ‘xkey@123’;
GRANT ALL PRIVILEGES ON * . * TO ‘xkey’@’localhost’;
GRANT ALL PRIVILEGES ON *.* TO “xkey”@”%” identified by “xkey@123”;
**** Executar as duas linhas para dar permissão de acesso do localhost e externamente ****
FLUSH PRIVILEGES;
## Firewall rule allowing access to the MySQL server on port 3306/tcp
firewall-cmd –permanent –zone=trusted –add-port=3306/tcp
firewall-cmd –permanent –add-service=mysql
firewall-cmd –reload
## Instalação do Samba
yum install samba samba-client samba-common
mv /etc/samba/smb.conf /etc/samba/smb.conf.bak
mkdir -p /dados/xkey/sax
vim /etc/samba/smb.conf
################################################################################
## Arquivo smb.conf
[global]
workgroup = WORKGROUP
server string = Samba Server %v
netbios name = xkey
security = user
map to guest = bad user
dns proxy = no
#============================ Share Definitions ==============================
[SAX-Xkey]
path = /dados/xkey/sax
browsable =yes
writable = yes
guest ok = yes
read only = no
################################################################################
systemctl enable smb.service
systemctl enable nmb.service
systemctl restart smb.service
systemctl restart nmb.service
firewall-cmd –permanent –zone=public –add-service=samba
firewall-cmd –reload
chmod 755 /dados/xkey/sax/
chown -R nobody:nobody /dados/xkey/sax/
chcon -t samba_share_t /dados/xkey/sax
http://www.tecdicas.com/servidor-centos-7-instalando-o-mysql-server/