ssh root@47.92.243.226
apt-get update
apt-get upgrade
apt-get install wget curl git
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
source /root/.bashrc
nvm install stable
node -v
npm i cnpm -g
npm i nrm -g
Nginx 是一个高性能的 HTTP 和反向代理服务器
apt-get install nginx
名称 | 命令 | ||||||
---|---|---|---|---|---|---|---|
启动 nginx | nginx -c /etc/nginx/nginx.conf | ||||||
关闭 nginx | nginx -s stop | ||||||
重读配置文件 | nginx -s reload kill -HUP nginx | ||||||
常用命令 | service nginx {start | stop | status | restart | reload | configtest | } |
安装 mysql
apt install mysql-server -y
apt install mysql-client
apt install libmysqlclient-dev
git clone https://gitee.com/zhufengpeixun/2018projects1.git
cd 2018projects1/zhufeng-cms
yarn
wget http://7xil5b.com1.z0.glb.clouddn.com/zhufeng-cms.sql
mysql -uroot -proot
CREATE DATABASE IF NOT EXISTS zhufengcms default charset utf8 COLLATE utf8_general_ci;
use zhufengcms;
source zhufengcms.sql;
yarn start
cd 2018projects1/zhufeng-cms-front
yarn
yarn build
/etc/nginx/nginx.conf
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
include /etc/nginx/sites-enabled/default
root /var/www/html;
scp 1.txt root@47.92.243.226:/root
server {
listen 80;
server_name 47.92.243.226;
root /var/www/html;
location / {
try_files $uri $uri/ @router;
index index.html;
}
location /api {
rewrite ^/api/(.*)$ /$1 break;
proxy_pass http://127.0.0.1:7001;
}
location @router {
rewrite ^.*$ /index.html break;
}
}