分类: Linux

Centos 安装Nginx+Node


作者:朱培鑫

时间:2021-07-01

1、编译工具和库文件的安装

cd /usr/local/src
yum -y install make zlib zlib-devel gcc-c++ libtool  openssl openssl-devel

2、PCRE 安装
下载地址 https://ftp.pcre.org/pub/pcre/ 下载最新版pcre-8.44.tar.gz即可,pcre2似乎失败了

cd /usr/local/src
wget https://ftp.pcre.org/pub/pcre/pcre-8.44.tar.gz
tar zxvf pcre-8.44.tar.gz
cd pcre-8.44
./configure --prefix=/usr/local/pcre
make && make install

3、Nginx 安装
下载地址 https://nginx.org/en/download.html 下载最新版nginx-1.18.0.tar.gz即可 Stable version

cd /usr/local/src
wget https://nginx.org/download/nginx-1.18.0.tar.gz
tar zxvf nginx-1.18.0.tar.gz
cd nginx-1.18.0
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-pcre=/usr/local/src/pcre-8.44
make && make install

4、node安装

cd /usr/local/src
wget https://nodejs.org/dist/v14.16.0/node-v14.16.0-linux-x64.tar.xz
xz -d node-v14.16.0-linux-x64.tar.xz
tar xvf node-v14.16.0-linux-x64.tar
mv node-v14.16.0-linux-x64 /usr/local
cd /usr/local/
mv node-v14.16.0-linux-x64 node

5、环境变量设置

vim /etc/profile
#文件末尾加如下代码
export PATH=$PATH:/usr/local/nginx/sbin:/usr/local/node/bin
source /etc/profile

6、生成SSH key

ssh-keygen -t rsa -C "xxx@xx.com"
#将key添加至gitlab个人账号 SSH-key中
cat /root/.ssh/id_rsa.pub

( 本篇完 )

  • 下一篇: (无)