日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

nginx proxy svn 加快_Hexo+Nginx+SVN搭建网站

發布時間:2025/4/16 85 豆豆
生活随笔 收集整理的這篇文章主要介紹了 nginx proxy svn 加快_Hexo+Nginx+SVN搭建网站 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

下載Notejs

  • 官網下載地址
    NoteJs官網
  • 百度網盤下載
    鏈接: https://pan.baidu.com/s/1JTmwNXaasghohKoADCpu6Q 密碼: 1kcc

配置NoteJs環境變量

  • 我本地安裝路徑
    E:my-toolsnotejsnode-v6.11.4-win-x64
  • 加入path
    計算機-屬性-高級系統設置-環境變量-系統變量-path 將本地的NoteJs路徑新增到path里面
  • 校驗配置是否成功
    win+R打開運行輸入cmd,然后輸入node -v,顯示下圖代表安裝成功

安裝git

  • 百度網盤下載
    鏈接: https://pan.baidu.com/s/1vSpojnLpFPHzLF0VTqY5Sw 密碼: edux 其中下載包中包含了Git和TortoiseGit,其中TortoiseGit是可視化工具 你可以只安裝Git,因為我們代碼的倉庫是git,所以安裝了TortoiseGit
  • 我本地安裝路徑
    C:Program FilesGitbin
  • 配置path
    計算機-屬性-高級系統設置-環境變量-系統變量-path 將C:Program FilesGitbin路徑新增到path里面
  • 校驗配置是否成功
    win+R打開運行輸入cmd,然后輸入git --version,顯示下圖代表安裝成功

  • 備注
    因為我的hexo是部署在自己的服務器上的,所以不需要按住git推送到gitpage上。

Github賬戶注冊和新建倉庫

  • 注冊地址
    github
  • 新建倉庫
    項目必須要遵守格式:賬戶名.http://github.io

安裝hexo

  • 本地新增文件夾
    我本地是E:my-toolshexo-blog

  • 進入新建的文件夾
    執行npm install hexo -g,開始安裝hexo
  • 查看hexo版本
    hexo -v

  • 初始化hexo目錄
    進入新建的目錄,執行hexo init

  • 啟動server
    hexo s或者hexo server hexo s -p 5000 是指定啟動端口
  • 訪問
    http://localhost:4000/

安裝完成

此時hexo的基本雛形已經安裝完成,剩余的就是hexo的優化和配置,如果感覺 默認的主題太丑,可以更新主題,詳情查看hexo配置next主題

安裝nginx

  • 下載地址 http://nginx.org/

  • 解壓啟動nginx

  • nginx常用指令
    • nginx -t 檢測配置文件是否正常
    • nginx -s reload 重啟nginx

安裝服務端SVN

  • 下載地址
    鏈接: https://pan.baidu.com/s/1DEQe47iLpQpF5Z8Hdbef2Q 密碼: m2qg
  • 安裝svn
  • nginx配置svn
location /svn{proxy_pass http://172.19.163.33:12080;include proxy.conf;index index.html index.txt index.jsp; }安裝svn的時候有個端口號,其中要配置的就是這個端口
  • proxy.conf
proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504; proxy_max_temp_file_size 0; proxy_connect_timeout 1800; proxy_send_timeout 1800; proxy_read_timeout 1800; proxy_buffer_size 16k; proxy_buffers 4 32k; proxy_busy_buffers_size 64k; proxy_temp_file_write_size 64k; client_max_body_size 100m;
  • 安裝配置成功

  • 創建blog版本庫

  • 設置svn post commit hook
    右擊版本庫-properties-Hooks-Post Commit Hook

其中E:my-blog是svn checkout的地址
  • 配置my-blog域名和nginx
#jayden.matchcess.comserver {listen 80;server_name jayden.matchcess.com;#編碼charset utf-8;#404頁面error_page 404 /404.html;#定義錯誤頁面error_page 500 502 503 504 /50x.html;location = /50x.html {root html;}#worklocation /work/{alias E:/my-blog/work/;auth_basic "secret"; #虛擬主機認證命名auth_basic_user_file cert/passwd_public.db;#用戶名密碼文件index index.html home.txt index.txt;}#dailylocation /daily/{alias E:/my-blog/daily/;auth_basic "secret"; #虛擬主機認證命名auth_basic_user_file cert/passwd.db;#用戶名密碼文件index index.html home.txt index.txt;}#bluedeerlocation /bluedeer/{alias E:/my-blog/bluedeer/;auth_basic "secret"; #虛擬主機認證命名auth_basic_user_file cert/passwd_bluedeer.db;#用戶名密碼文件index index.html home.txt index.txt;}location / {root E:/my-blog/;index index.html index.txt;}}server {listen 443 ssl;server_name jayden.matchcess.com;ssl on;root html;index index.html index.htm;ssl_certificate cert/jayden.matchcess.com_20180413.pem;ssl_certificate_key cert/jayden.matchcess.com_20180413.key;ssl_session_timeout 5m;ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;ssl_protocols TLSv1 TLSv1.1 TLSv1.2;ssl_prefer_server_ciphers on;#編碼charset utf-8;#404頁面error_page 404 /404.html;#定義錯誤頁面error_page 500 502 503 504 /50x.html;location = /50x.html {root html;}#worklocation /work/{alias E:/my-blog/work/;auth_basic "secret"; #虛擬主機認證命名auth_basic_user_file cert/passwd_public.db;#用戶名密碼文件index index.html home.txt index.txt;}#dailylocation /daily/{alias E:/my-blog/daily/;auth_basic "secret"; #虛擬主機認證命名auth_basic_user_file cert/passwd.db;#用戶名密碼文件index index.html home.txt index.txt;}#bluedeerlocation /bluedeer/{alias E:/my-blog/bluedeer/;auth_basic "secret"; #虛擬主機認證命名auth_basic_user_file cert/passwd_bluedeer.db;#用戶名密碼文件index index.html home.txt index.txt;}location / {root E:/my-blog/;index index.html index.txt;}}

相關鏈接

  • hexo命令
  • hexo主配置
  • hexo配置next主題
  • hexo配置百度統計
  • hexo網站美化
  • hexo寫文章
  • 本地編寫文章自動推送到服務器
  • MarkDown語法

總結

以上是生活随笔為你收集整理的nginx proxy svn 加快_Hexo+Nginx+SVN搭建网站的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。