tips:服务器版本为centos7.6版本
- 安装配置nginx
不怎么懂各种操作的意思,网上有很多参考文章。https://www.cnblogs.com/bluestorm/p/4574688.html
- nginx 默认配置
// nginx 默认配置
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm; // /usr/local/nginx/html 下的index.html (安装配置nginx成功的页面)
}
....
}
- 个人目前nginx server配置如下(除默认server配置外的)
server {
listen 8000;
# listen somename:8080;
server_name localhost;
location /admin { // 访问ip:8080/admin 时会出现/var/www/admin下的indexhtml文件
# root html;
alias /var/www/admin;
index index.html index.htm;
}
}
- 安装nodejs、yarn、pm2
curl --silent --location https://rpm.nodesource.com/setup_10.x | sudo bash - // 下载源文件
sudo yum install -y nodejs // 安装nodejs (node -v)
sudo yum install yarn // 安装yarn
npm install -g pm2
原文:https://www.cnblogs.com/laine001/p/11922027.html