CentOS 7

CentOS Configuration

Basic Info Checks

  • Check CentOS Version
cat /etc/redhat-release
Shell

Set up Networks

  • Open network service
vi /etc/sysconfig/network-scripts/ifcfg-xx
Shell

Config as below

Then restart the network service

service network restart
Shell
  • Install net-tools
yum install net-tools
Shell

Install pre-requisite packages

yum install -y gcc gcc-devel gcc-c++ gcc-c++-devel make kernel kernel-devel bzip2
Shell

Install Python

yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel  mysql-devel gcc gcc-devel python-devel
Shell
  • In CentOS Python 3.7 above will report No module named ‘ctypes’
yum install libffi-devel
Shell

Download

yum install wget
wget https://www.python.org/ftp/python/3.8.2/Python-3.8.2.tgz
Shell

Unzip

tar -zxvf Python-3.8.2.tgz
Shell

Config Python 3.8

mkdir ~/app/python3
cd Python-3.8.2.tgz
./configure --prefix=/root/app/python3

make && make install
Shell

Add to .bash_profile

vi .bash_profile
Shell

in .bash_profile add below

# Python
export PYTHON_HOME=/root/app/python3
export PATH=$PYTHON_HOME/bin:$PATH
Shell

exit, the reload

source .bash_profile
Shell

Install MySQL

  • Uninstall mariadb
yum remove mariadb-libs.x86_64
Shell
  • download and install mysql repo
wget https://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm
yum localinstall mysql57-community-release-el7-8.noarch.rpm
Shell
  • Install mysql
yum install mysql-community-server
Shell
  • Check if mysql is started
ps -ef | grep mysql
Shell

if mysql is not started run

service mysqld start
Shell
  • mysql default pw
cat /var/log/mysqld.log | grep "password"
Shell
  • login mysql
mysql -uroot -p
Shell
  • Change root password
SET PASSWORD = PASSWORD("abc123");
Shell
set global validate_password_policy=0;
set global validate_password_length=1;
Shell
  • Set remote access

close firewall

service firewalld stop
Shell

allow remote access

update mysql.`user` set Host='%' where User='root' and Host='localhost';
flush privileges;
Shell

   Reprint policy


《CentOS 7》 by Isaac Zhou is licensed under a Creative Commons Attribution 4.0 International License