差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录前一修订版
后一修订版
前一修订版
project:yixue:web [2022-07-22 16:44] goldentianyaproject:yixue:web [2022-07-26 21:08] (当前版本) – [部署服务器] goldentianya
行 10: 行 10:
   * common.ts    》 export const UIView: string = 'web'   * common.ts    》 export const UIView: string = 'web'
  
-编译 ionic build --prod -- --base-href http://huahe.simperator.com+编译  
 +<code | download> 
 +ionic build --prod -- --base-href https://huahe.simperator.com 
 +cp -r www/* ../huahe-github-pages/ 
 +</code> 
 + 
 +在终端进入 ../huahe-github-pages/ 文件夹 
 +<code> 
 +python -m SimpleHTTPServer 8080 
 +</code> 
 + 
 +默认端口是 8000 而且在编译的时候要使用 http://localhost:8080 这个地址。(或者在 index.html 修改 <base href="http://localhost:8000">) 
 + 
 +===== 部署服务器 ===== 
 + 
 +(一键部署 <color #ff7f27>''%%scp -r www/* root@serverback:/var/www/huahe.simperator.com/html%%''</color>
 + 
 + 
 +1 打包文件  <color #ff7f27>''%%tar -cvf huahe.tar.gz ~/projects/huahe-github-pages/%%''</color> 
 + 
 +2 传输到服务器 <color #ff7f27>''%%scp huahe.tar.gz root@serverali:/home/ftp%%''</color> 
 + 
 +3 解压文件 <color #ff7f27>''%%ls /var/www/huahe.simperator.com/html/%%''</color> 
 + 
 +<code> 
 + tar -xvf huahe.tar.gz 
 +cp -r Users/mai/projects/huahe-github-pages/* /var/www/huahe.simperator.com/html/ 
 +</code> 
 + 
 +部署服务 
 + 
 +<code> 
 +tar -zcvf huaheserver.tar.gz --exclude "node_modules" ~/projects/huaheserver/ 
 +scp huaheserver.tar.gz root@serverali:/home/ftp 
 +// 服务器 
 +cp -r Users/mai/projects/huaheserver/ /home/server/ 
 + 
 +npm install pm2@latest -g 
 +pm2 start app.js 
 +</code> 
 + 
 +注意:!: firewalld 开启3002端口,阿里云的安全组也要开通出/入站规则。 
 + 
 +允许 https 端口访问 
 +<code> 
 +var fs = require('fs'); 
 +var http = require('http'); 
 +var https = require('https'); 
 +var privateKey  = fs.readFileSync('sslcert/server.key', 'utf8'); 
 +var certificate = fs.readFileSync('sslcert/server.crt', 'utf8'); 
 + 
 +var credentials = {key: privateKey, cert: certificate}; 
 +var express = require('express'); 
 +var app = express(); 
 + 
 +// your express configuration here 
 + 
 +var httpServer = http.createServer(app); 
 +var httpsServer = https.createServer(credentials, app); 
 + 
 +httpServer.listen(8080); 
 +httpsServer.listen(8443); 
 +</code> 
 + 
 +++++ 服务器设置 | 
 +<code | download> 
 +server { 
 +    listen 80; 
 +    listen [::]:80; 
 +    server_name  huahe.simperator.com; 
 +    root /var/www/huahe.simperator.com/html; 
 +    index index.html index.htm; 
 +  
 +    location / { 
 + try_files $uri $uri/ =404; 
 +    } 
 +
 + 
 +=================================== 
 + 
 + 
 +server { 
 +     server_name huahe.simperator.com; 
 +     root /var/www/huahe.simperator.com/html; 
 +     index index.html index.htm; 
 + 
 +     location / { 
 +          try_files $uri $uri/ =404; 
 +     } 
 + 
 +     listen 443 ssl; # managed by Certbot 
 +     ssl_certificate /etc/letsencrypt/live/simperator.com/fullchain.pem; # managed by Certbot 
 +     ssl_certificate_key /etc/letsencrypt/live/simperator.com/privkey.pem; # managed by Certbot 
 +     include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot 
 +     ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot 
 +
 + 
 +server { 
 +    if ($host = huahe.simperator.com) { 
 +        return 301 https://$host$request_uri; 
 +    } # managed by Certbot 
 + 
 + 
 +    listen 80; 
 +    listen [::]:80; 
 +    server_name  huahe.simperator.com; 
 +    return 404; # managed by Certbot 
 +
 +</code> 
 +++++ 
project/yixue/web.1658508280.txt.gz · 最后更改: 2022-07-22 16:44 由 goldentianya
回到顶部
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0