- 看看这里
- 查看服务器版本
cat /proc/version // 查看系统
Linux version 3.10.0-1062.1.2.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC) ) #1 SMP Mon Sep 30 14:19:46 UTC 2019
lsb_release -a // 查看内核
LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.7.1908 (Core)
Release: 7.7.1908
Codename: Core
- 安装 git
yum install git
安装 node
install_node.sh
VERSION=v12.16.3
DISTRO=linux-x64
wget https://nodejs.org/dist/$VERSION/node-$VERSION-$DISTRO.tar.xz
sudo mkdir -p /usr/local/lib/nodejs
sudo tar -xJvf node-$VERSION-$DISTRO.tar.xz -C /usr/local/lib/nodejs
- 设置环境变量
vim ~/.bash_profile
添加
VERSION=v12.16.3
DISTRO=linux-x64
export PATH=/usr/local/lib/nodejs/node-$VERSION-$DISTRO/bin:$PATH
source ~/.bash_profile
验证
node -v
- 安装
nginx
// 启动
sudo systemctl start nginx
// 状态
sudo systemctl status nginx
// 暂停
sudo systemctl stop nginx
无法访问见这里
增加[虚拟主机配置]
// 查看 Nginx 运行状态
ps -ef | grep nginx
// 查看监听端口
netstat -nlptu
// Nginx 重启
nginx -s reload
// 安装 lsof
yum install lsof
// 查看端口
lsof -i:40440
//防火墙开放接口
firewall-cmd --add-port=40441/tcp --permanent
#重载防火墙规则
firewall-cmd --reload