Small knowledge, big challenge! This paper is participating in theEssentials for programmers”Creative activities

CentOS install JDK8

Download and install the configuration

https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html # 01 - download JDK RPM package wget < url > rename sudo chmod 777 Sudo RPM -ivh jdk8.rpmCopy the code

Configuring environment Variables

#Find the Java installation directory
#The default/usr/Java/jdk1.8.0 _291 - amd64
sudo find / -name "jdk" -print

#Configure Java environment variables
sudo vim /etc/profile
#Write it at the bottomExport export JAVA_HOME = / usr/Java/jdk1.8.0 _291 - amd64 export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar export PATH=$JAVA_HOME/bin:$PATH source /etc/profile java -versionCopy the code

CentOS install MySQL57

Download and install Mysql57

#Download the RPM
wget https://repo.mysql.com//mysql80-community-release-el7-3.noarch.rpm --no-check-certificate
#Yum install mysql source
yum localinstall mysql80-community-release-el7-3.noarch.rpm
#Verify that the installation is successful
yum repolist all | grep mysql

#Example Change the default installation version to 5.7 
vim /etc/yum.repos.d/mysql-community.repo

>i (Insert)
>8.0 enabled = 0
>5.7 enabled = 1

#Mysql installation
yum install mysql-community-server

#Contos 7 Start mysql
#Start mysql: systemctl start mysqld.service
#Run the following command to check the mysql status: systemctl status mysqld.service

#Example Query the initial password of MySQL
grep 'temporary password' /var/log/mysqld.log
> 2021-04-30T06:22:17.740068Z 1 [Note] A temporary password is generated forroot@localhost: yj? DGkdVo4V&


find ~ -iname "mysqld.log"
#Log on to the MySQL
mysql -u root -p

#Changing the Login Password
> alter user root@localhost identified by 'New password'

#Setting a Password PolicySet global validate_password_policy=LOW Set minimum password length. set global validate_password_length=6
> flush privileges;Refer to the website: https://www.cnblogs.com/wintest/p/11483559.htmlCopy the code

Set remote access from the Internet

#Set remote access from the Internet
vim /etc/my.cnf
port=3306  
#The bind - address = 0.0.0.0

> mysql -u root -p
> use mysql;
> select user,host from user;
> update user set host=The '%' where user ='root';

#Authorized user specific permissionsgrant all privileges on *.* to 'root'@'%' identified by 'Asilence31? ' with grant option; flush privileges;
#Restart mysql for the effect to take effect
systemctl restart mysqld

#Navicat Connection takes effect in 1 to 10 minutes
Copy the code

Common commands

#The login
mysql -u root -p
#Start the mysql
systemctl start mysqld.service
#Mysql > Update mysql
systemctl status mysqld.service
#Restart the mysql
systemctl restart mysqld
#Set automatic startup upon startup
systemctl enable mysqld 
systemctl daemon-reload
Copy the code

CentOS install Nodejs

Nodejs installation

#Wget HTTP: / / https://nodejs.org/dist/v14.16.0/node-v14.16.0-linux-x64.tar.xzInstall package downloadWget https://nodejs.org/dist/v16.9.1/node-v16.9.1-linux-x64.tar.xz tar xf node - v16.9.1 - Linux - x64. Tar. Xz # decompression installation package mv Node-v14.4.0-linux-x64 /usr/nodev14 # rename and move to usr directoryCopy the code

Nodejs configuration

#Backup/etc/profile
cp /etc/profile /etc/profile.date.bak
#The editor
vim /etc/profile

export NODE_HOME=/usr/nodev16
export PATH = $NODE_HOME/bin:$PATH

#:wq Exit and save the configuration
#Make the configuration take effect
source /etc/profile

#Verifying the Installation Status

node -v
npm -v

Copy the code

CentOS install Git

The installation

#The RPM source address http://opensource.wandisco.com/centos/7/git/x86_64/
wget http://opensource.wandisco.com/centos/7/git/x86_64/wandisco-git-release-7-1.noarch.rpm && rpm -ivh wandisco-git-release-7-1.noarch.rpm

yum install git -y

#validation
git --version 
Copy the code

configuration

git config --global user.name "xujiantong"
git config --global user.email "[email protected]"
git config --list
Copy the code
#Configuring the Remote Repository
## SSH key generated locally on Linux server
ssh-keygen -t rsa -C "[email protected]"
#Enter all the way
#Pub generates a public key id_rsa.pub and a private key ID_RSAYour public key has been saved in /root/.ssh/id_rsa.pub. # public key position The key fingerprint is: SHA256: zIPrBkjhgsJMsBDx/rwf8KHWLdxjeIp6H8PfeihTQR8 [email protected]
#Copy id_rsa.pub to github SSH keys
Copy the code

CentOS install Yarn

curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo

sudo yum install -y yarn
Copy the code

Centos install Nginx

Copy the code

CentOS install Docker

Reference address: docs.docker.com/engine/inst…

Install using the repository

Set up the repository

 sudo yum install -y yum-utils
 sudo yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo
    
 sudo yum-config-manager --enable docker-ce-nightly
 sudo yum-config-manager --enable docker-ce-test
 # OR disable
 sudo yum-config-manager --disable docker-ce-nightly
Copy the code

Install Docker Engine

sudo yum install docker-ce docker-ce-cli containerd.io
Copy the code

Start Docker

sudo systemctl start docker

verify that Docker Engine is installed correctly by running the hello-world image.
sudo docker run hello-world
Copy the code

Docker version is installed successfully

Uninstall Docker Engine🔗

#Unload rely on
sudo yum remove docker-ce docker-ce-cli containerd.io
#Uninstall resources
sudo rm -rf /var/lib/docker
sudo rm -rf /var/lib/containerd
Copy the code

Ali cloud configuration docker image acceleration

sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://5nqj371k.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
Copy the code

CentOS7 installation GitLab

You need to configure the server. The minimum hardware configuration is 2 cores or more than 2GB memory (excluding the 2GB memory, which is directly exhausted when running). The recommended hardware configuration is as follows: 4 core 4 gb of memory to support 500 users 8-core 8 gb of memory support 1000 users docker compose reference address: https://www.cnblogs.com/linuxk/p/10100431.htmlCopy the code
Cat /etc/os-release uname -rCopy the code

Docker install Tomcat

Docker run -d -p 8080:8080 --name tomcat01 tomcat:9.0 Stop CTRL + C # Docker exec -it tomcat01 /bin/bashCopy the code

Install Nginx

Yum -y install GCC pcre-devel zlib-devel openssl openssl-devel nginx yum -y install GCC pcre-devel zlib-devel openssl https://nginx.org/download/ wget http://nginx.org/download/nginx-1.21.0.tar.gz tar - ZXVF nginx - 1.21.0. Tar. Gz mv Nginx-1.21.0 /usr/local CD /usr/local mv nginx-1.21.0 nginx CD nginx./configure --prefix=/usr/local/nginx make make CD /usr/local/nginx./sbin/nginx -tCopy the code