编辑
2023-08-18
笔记
0

目录

CentOS 7 网络配置

shell
# 网络配置 sed -i 's/ONBOOT="no"/ONBOOT="yes"/g' /etc/sysconfig/network-scripts/ifcfg-eth0 sed -i 's/IPV6INIT="yes"/IPV6INIT="no"/g' /etc/sysconfig/network-scripts/ifcfg-eth0 sed -i 's/BOOTPROTO="dhcp"/BOOTPROTO="none"/g' /etc/sysconfig/network-scripts/ifcfg-eth0 sed -i 's/ONBOOT=no/ONBOOT=yes/g' /etc/sysconfig/network-scripts/ifcfg-eth0 sed -i 's/IPV6INIT=yes/IPV6INIT=no/g' /etc/sysconfig/network-scripts/ifcfg-eth0 sed -i 's/BOOTPROTO=dhcp/BOOTPROTO=none/g' /etc/sysconfig/network-scripts/ifcfg-eth0 cat << EOF >> /etc/sysconfig/network-scripts/ifcfg-eth0 IPADDR=192.168.2.23 PREFIX=16 GATEWAY=192.168.1.1 DNS1=114.114.114.114 DNS2=192.168.1.1 EOF cat << EOF >/etc/hostname QRadarCE EOF

CentOS 7 安装必备包

shell
# 必备软件 yum install -y epel-release yum update -y yum install -y bash-completion bash-completion-extras sudo openssh-server systemctl enable sshd systemctl start sshd ln -s -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime reboot

CentOS 6 安装必备包

shell
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-6.10.repo yum clean all && yum makecache yum install -y epel-release yum update -y yum install -y bash-completion bash-completion-extras sudo openssh-server echo "PermitRootLogin yes" | tee /etc/ssh/sshd_config ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key chkconfig sshd on service sshd start ln -s -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

Extra Packages for Enterprise Linux (EPEL)

shell
yum install -y epel-release

ELRepo Project

Import the public key:

shell
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org

To install ELRepo for RHEL-9:

bash
yum install https://www.elrepo.org/elrepo-release-9.el9.elrepo.noarch.rpm

To install ELRepo for RHEL-8:

shell
yum install https://www.elrepo.org/elrepo-release-8.el8.elrepo.noarch.rpm

To install ELRepo for RHEL-7, SL-7 or CentOS-7:

shell
yum install https://www.elrepo.org/elrepo-release-7.el7.elrepo.noarch.rpm

安装长期支持内核(lt = long time)

shell
yum --enablerepo=elrepo-kernel -y install kernel-lt

安装稳定主线内核kernel-ml(ml=mainline)

shell
yum --enablerepo=elrepo-kernel -y install kernel-ml

红帽软件集合

https://access.redhat.com/support/policy/updates/rhscl-rhel7

shell
yum install centos-release-scl –y

安装 GCC 9

shell
yum install devtoolset-9-toolchain –y # 临时使用 scl enable devtoolset-9 bash source scl_source enable devtoolset-9 安装 GCC 7 ```shell yum install devtoolset-7-toolchain –y # 临时使用 scl enable devtoolset-7 bash source scl_source enable devtoolset-7

安装 Python 3.8

shell
yum install rh-python38 rh-python38-python-devel –y # 临时使用 scl enable rh-python38 bash source scl_source enable rh-python38

MySQL Server 5.7

shell
yum install -y http://repo.mysql.com/mysql57-community-release-el7.rpm rpm -import http://repo.mysql.com/RPM-GPG-KEY-mysql-2022 yum install mysql-server -y systemctl enable mysqld systemctl start mysqld grep 'temporary password' /var/log/mysqld.log

MySQL Server 8.0

shell
yum install -y https://repo.mysql.com/mysql80-community-release-el7.rpm rpm -import http://repo.mysql.com/RPM-GPG-KEY-mysql-2022 yum install mysql-server -y systemctl enable mysqld systemctl start mysqld grep 'temporary password' /var/log/mysqld.log

Nginx

shell
yum install -y https://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm yum install -y nginx systemctl enable nginx systemctl start nginx

Redis 3.2

shell
yum install -y redis systemctl enable redis systemctl start redis

Redis 6

shell
yum install -y \ https://repo.ius.io/ius-release-el7.rpm \ https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm yum install -y redis6 systemctl enable redis systemctl start redis

OpenJDK

shell
# openjdk 8 yum install -y java-1.8.0-openjdk java-1.8.0-openjdk-devel # openjdk 11 yum install -y java-11-openjdk java-11-openjdk-devel

本文作者:菜鸟

本文链接:

版权声明:本博客所有文章除特别声明外,均采用 署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0) 许可协议。转载请注明出处!