CentOS 7

CentOS Configuration

Basic Info Checks

  • Check CentOS Version
cat /etc/redhat-release

Set up Networks

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

Config as below

Then restart the network service

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

Install pre-requisite packages

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

Install Python

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

Download

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

Unzip

tar -zxvf Python-3.8.2.tgz

Config Python 3.8

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

make && make install

Add to .bash_profile

vi .bash_profile

in .bash_profile add below

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

exit, the reload

source .bash_profile

Install MySQL

  • Uninstall mariadb
yum remove mariadb-libs.x86_64
  • 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
  • Install mysql
yum install mysql-community-server
  • Check if mysql is started
ps -ef | grep mysql

if mysql is not started run

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

close firewall

service firewalld stop

allow remote access

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

   Reprint policy


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