<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                >[danger] **棄用提醒:** > *由于看云對于免費用戶的限制愈發嚴苛,本文檔已經遷移至語雀。本文檔將不做維護。* > **語雀地址**:[https://www.yuque.com/a632079/nodebb](https://www.yuque.com/a632079/nodebb) ***** ## 一、準備 >[warning] 本教程測試環境為 `CentOS 7`, 同時默認您當前是以 `Root` 用戶登錄終端。 [TOC] 1. 首先更新 `centos` ``` $ yum -y update $ yum -y install epel-release #雖然 NodeBB Docs 并不需要 Centos6 執行這條命令,但為了安裝比較新的 Redis 還是建議執行 $ yum update ``` 2. 安裝基礎環境 ``` $ yum -y groupinstall "Development Tools" $ yum -y install git ImageMagick ImageMagick-devel ``` ## 二、安裝 ### §1. Node.js >[info] 我們現在推薦使用 `nvm` 來安裝Node.js. ------------------------ >[warning] 截止目前,NodeBB 要求 Node.js 的**最低版本**為 **v8.x** >[success] **LTS** ( Long-term Support ) 是 Node.js 的長期支持版本,使用該系列能夠讓你的程序擁有可靠安全的環境保障。 1. 首先,我們現在服務器上安裝 `NVM` ``` #截止2019.12.05,NVM最新版本為 v0.35.1 $ sudo curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.35.1/install.sh | bash ``` ***可以在 [Github](https://github.com/creationix/nvm/) 中獲取 NVM 最新的安裝指令*** 2. 添加 NVM 到環境變量 ``` $ export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm ``` 3. 使環境變量的修改生效 ``` $ source ~/.bashrc ``` 4. 檢查是否成功安裝 ``` $ command -v nvm ``` 如果沒有拋出任何錯誤信息,那么我們繼續下面的步驟吧。(如果有,請到Github中尋找解決方案。) ------------------------------- >[info] 如果你使用的機器是國內的話,建議使用以下代碼讓`NVM`使用淘寶鏡像來下載源碼(騰訊云的下載速度只有可憐的1x.kb/s...) ``` # 讓NVM使用淘寶源 $ export NVM_NODEJS_ORG_MIRROR=http://npm.taobao.org/mirrors/node $ export NVM_IOJS_ORG_MIRROR=http://npm.taobao.org/mirrors/iojs ``` 5. 好,我們使用下面的代碼來安裝LTS版本 ``` # 安裝Node.js LTS $ sudo nvm install --lts ``` 6. 等待執行完成,如果使用`node -v` ,`npm -v`都能正確輸出版本號的話,說明nodejs已經成功安裝。 >[info] 在國內,NPM源的速度比較慢,可以使用`npm config set registry http://registry.npm.taobao.org/`來將npm更換到國內的淘寶源 ---- ### §2. Redis ~~1. 啟用EPEL倉庫 & 更新倉庫~~ (之前執行過了,此處無需進行這步操作) 2. 通過 `yum` 安裝 ``` $ yum install redis ``` >[warning] 此時檢查一下你將下載的Redis是否是最新版本,如果是,跳到第5步,否則就繼續。([點擊這里查看最新 Stable 版本](https://redis.io/)) 3. 安裝 Remi 源 ``` $ yum install -y http://mirrors.tuna.tsinghua.edu.cn/remi/enterprise/remi-release-7.rpm #數字為 centos 版本,默認為 CentOS 7,如果你使用 CentOS 8,請修改 7 為 8. ``` 4. 通過 Remi 安裝最新的 Redis ``` $ yum --enablerepo=remi install redis ``` ------------------------------------- 5. 讓 Redis 開機自啟 ``` $ systemctl start redis $ systemctl enable redis ``` 6. 我們來給 Redis 加一些安全設置: * 加入密碼,僅限本地登入,刪除 FLUSHALL ``` $ vim /etc/redis/redis.conf #如果上面沒有,配置文件可能會在 /etc/redis.conf ``` 編輯 Redis 的配置文件,然后把下面的內容粘貼進去(建議放置到最后) ``` requirepass yourpassword bind 127.0.0.1 rename-command FLUSHALL "" ``` 7. 重啟 Redis 服務 ``` $ service redis-server restart ``` ### §3. NodeBB 1. 從 Github 上克隆 NodeBB 的發布版本分支 ``` $ cd /home #把目錄替換為你想安裝到的地方 $ git clone -b v1.13.x https://github.com/NodeBB/NodeBB nodebb ``` >[info] 現在,你可以使用國內的鏡像倉庫(`https://gitee.com/qiai365/NodeBB.git`)來提高連接速度。 2. 安裝 NodeBB 依賴環境 ``` $ cd /home/nodebb #替換為上面你修改的目錄 + /nodebb ``` >[info] 由于機器性能和網絡情況的差異,該操作可能需要您花費 數分鐘 甚至 數十分鐘 的時間! 3. 進行初始化設置 ``` $ ./nodebb setup ``` >[info] 需要注意的是: 由于默認選擇的數據庫是 MongoDB 所以在 `Which databases to use` 那步 請填寫 `redis`! -------------- >[success] 這時候您可以嘗試通過 `http://你的IP:4567` 訪問 NodeBB。如果成功訪問,那么我們就大功告成了!(可能需要您使 `iptables`/`firewalld` 允許外部連接對于 4567 端口的訪問) ## 三、反代 上一步我們安裝好了nodebb,但是需要通過`4567`端口才能訪問。現在我們設置一下反代服務,支持通過域名訪問網站。 >[info] 反代服務器 有很多種,但這里我們選取的是最流行也是性能最優秀的反代服務: Nginx 1. 首先,安裝nginx ``` $ yum install nginx ``` 2. 設置nginx反代規則 > 更詳細的 Nginx 規則 請參考 **Nginx 配置** 篇 ``` $ cd /etc/nginx/conf.d $ nano example.conf ``` 規則如下(www重定向至no-www,如果不需要,可以自己修改) ``` server { listen 80; server_name www.example.com; return 301 http://example.com$request_uri; } server { listen 80; server_name example.com; location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Host $http_host; proxy_set_header X-NginX-Proxy true; proxy_pass http://127.0.0.1:4567/; proxy_redirect off; # Socket.IO Support proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } } ``` 3. 讓 Nginx 配置生效 ``` $ service nginx reload ``` --------------- **如果出現如下錯誤:** ``` nginx: [emerg] could not build server_names_hash, you should increase server_names_hash_bucket_size: 32 nginx: configuration file /etc/nginx/nginx.conf test failed ``` 修改 `nginx.conf`,在 `http{}` 添加: ``` server_names_hash_bucket_size 64; ``` 保存,退出,啟動nginx > 教程改編自官方文檔,官方文檔地址:https://docs.nodebb.org/en/latest/installing/os/centos.html -------------------------- >[info] 編寫: gaokaigithub 維護: a632079 審核: PA Team 最后更新: 2019.12.07
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看