安装node.js
# 下载
wget https://nodejs.org/dist/v12.18.1/node-v12.18.1-linux-x64.tar.xz
# 解压
tar xf node-v12.18.1-linux-x64.tar.xz
# 进入解压目录
cd node-v12.18.1-linux-x64
# 编辑配置文件profile(修改linux系统的环境变量来设置直接运行命令)
vim /etc/profile
# 在配置文件profile最下面添加export PATH=$PATH: 后面跟上 node 下 bin 目录的路径
export PATH=$PATH:/root/node-v12.18.1-linux-x64/bin
# 立即生效
source /etc/profile
# 查看版本号(验证是否安装成功)
node -v
安装Nginx
Nginx下载
官网下载:http://nginx.org/en/download.html
或者直接在linux执行命令:wget http://nginx.org/download/nginx-1.12.2.tar.gz
# 进入下载文件存放目录
cd /root/ghyExploit/nginx
# 下载
wget http://nginx.org/download/nginx-1.12.2.tar.gz
# 解压
tar -zxvf nginx-1.12.2.tar.gz
# 进入目录
cd nginx-1.12.2/
# 安装pcre-devel、openssl
yum -y install pcre-devel
yum -y install openssl openssl-devel
(或 yum -y install pcre-devel openssl openssl-devel)
# 执行配置
./configure //默认安装在/usr/local/nginx
./configure --prefix=/root/ghyExploit/nginx/nginx //指定安装目录
# 编译安装
make
make install
# 查看进程列表
ps -ef | grep nginx
# 查看Nginx的进程id
ps -C nginx -o pid
不安装pcre-devel、openssl会报错:
./configure: error: the HTTP rewrite module requires the PCRE library.
./configure: error: the HTTP cache module requires md5 functions from OpenSSL library.