centos 系统初始化

cmd

修改主机名
hostnamectl set-hostname xxx
vi /etc/hosts 

vi  /etc/sysctl.conf 增加
fs.file-max = 655350

vi /etc/security/limits.conf 增加如下内容:
root soft nofile 655350
root hard nofile 655350
root soft nproc 655350
root hard nproc 655350
* soft nofile 655350
* hard nofile 655350
* soft nproc 655350
* hard nproc 655350

vi /etc/systemd/system.conf  与 /etc/systemd/user.conf 增加如下内容
DefaultLimitCORE=infinity
DefaultLimitNOFILE=655350
DefaultLimitNPROC=655350

vi /etc/ssh/sshd_config  搜索Port 改成21688

重启

yum update -y && yum install -y openssl-devel bzip2-devel libffi-devel zsh mysql mysql-devel  && yum install -y git zsh && yum -y install gcc-c++ make nginx epel-release supervisor

安装supervisor: yum install -y epel-release supervisor

安装python:
* yum 安装经常会出现缺少依赖
* 打开官网确认最新版本: https://www.python.org/downloads/
* 修改版本下载源码:wget https://www.python.org/ftp/python/3.10.5/Python-3.10.5.tgz
* 编译:./configure --enable-optimizations && make altinstall


安装zsh:

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
安装:autojump: git clone git://github.com/joelthelion/autojump.git && cd autojump && python3 install.py
复制 内容到~/.zshrc

安装nodejs: 

* 查看目前推荐使用的版本:https://nodejs.org/en/
* 找到下载对应版本的链接:https://github.com/nodesource/distributions
* 复制命令:` curl -sL https://rpm.nodesource.com/setup_16.x | bash -`
* yum install -y nodejs
* npm install -g tyarn

安装go:

* 复制下载链接:https://golang.google.cn/doc/install
* 按照网页命令执行

ref

  • https://computingforgeeks.com/how-to-install-python-on-3-on-centos/

你可能感兴趣的:(centos 系统初始化)