0.安裝SecureCRT
下載完成后 打開SecureCRT連接你的阿里云你的實(shí)例
1.安裝nginx
yum install nginx
systemctl start nginx // 啟動(dòng)nginx
輸入 公網(wǎng)ip 如果出現(xiàn) welcome nginx 則成功
2.安裝lrzsz
yum install nginx
3.編譯vue項(xiàng)目(build)
4.壓縮dist
tar -czf dist.tar.gz dist
5.SecureCRT里輸入
cd /home
mkdir vue
cd vue
rz
選擇 dist.tar.gz 上傳
6.到上傳好的目錄里解壓:
tar -xzvf dist.tar.gz
7.配置nginx
find / -name nginx
vim /etc/nginx/nginx.conf
nginx.conf
server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location / {
root /home/vue/dist;
# 如果你配置router mode:history
try_files $uri $uri/ /index.html;
index index.html;
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
- 重啟nginx
nginx -s reload
- 輸入的公網(wǎng)ip到瀏覽器 成功