<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>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                ## 簡介 WAF依賴 openresty/tengine、redis(集群使用) 注:**推薦使用centos 7|8.x** 目前是唯一對外地址: https://github.com/op-sec-team/releases-openstar-Enterprise 當前有2個分支,一個是 openresty 版本,一個分支是 tengine 版本 tengine 版本用的少,建議使用 openresty 版本,使用的人多,反饋的問題修復的快一些 ## 一鍵安裝腳本 這里介紹使用安裝腳本進行快速安裝 ### 安裝 redis **一組集群就需要安裝一臺redis!!! 【當然您也可以自行使用 yum / apt-get 安裝 redis】** 使用 root 運行 ~~~bash # 下載 安裝腳本 rds.sh (該腳本支持 centos / ubuntu ) wget -N --no-check-certificate https://raw.githubusercontent.com/op-sec-team/releases-openstar-Enterprise/master/openstar/bash/rds.sh # 增加腳本執行權限 chmod +x rds.sh # 進行 unix 轉換 dos2unix rds.sh # 腳本使用 ./rds.sh install # 安裝 redis 我們執行這行,開始安裝redis(當然你也可以使用yum/docker) ./rds.sh start & # 啟動 redis (后臺方式) ./rds.sh stop # 關閉 redis ./rds.sh # 連接 配置的 redis ~~~ [??rds.sh](https://www.yuque.com/attachments/yuque/0/2022/sh/1877304/1669439155233-27a64d21-90d0-4fca-bb51-a4f45741b711.sh) **腳本無法從 github 下載時,從這里下載吧!** 目前rds.sh腳本配置安裝的 redis 版本為:6.2.5;可以自行修改腳本,根據自己的需求。在啟動之前,請配置好redis的相關配置(監聽ip、端口、密碼、存放路徑、日志路徑等) ~~~bash ./rds.sh cfg #使用腳本中的配置進行配置 監聽端口、密碼配置等... -- 這里手動修改配置 -- vim /opt/redis/redis-6.2.5/redis.conf # 【注意路徑是否正確】 port 6379 # 【配置 監聽的 端口】 bind 192.168.25.34 # 【配置redis監聽的 ip (集群模式下,使用大家都可以訪問的ip,非 127.0.0.1)】 dir /opt/redis/ # 【 配置存放 db文件的路徑】 requirepass yourpassword #【配置自己的密碼!!!】 logfile /opt/redis/redis.log #【配置 redis 日志文件路徑】 ~~~ 配置好redis后,就可以啟動redis了 ./rds.sh start & 還可以修改rds.sh文件中連接redis的IP,端口,密碼,然后連接到redis,查看數據。 ~~~bash vim rds.sh ip=127.0.0.1 #【配置需要連接redis 的 ip】 psd=nihaoredis123 #【配置連接的 密碼】 port=6379 #【配置連接redis 的端口】 ~~~ ### openstar & openresty(tengine) 安裝 使用 root 運行 ~~~bash # 下載安裝腳本 openstar.sh 該腳本支持 centos / ubuntu ... openresty版本 下載: wget -N --no-check-certificate https://raw.githubusercontent.com/op-sec-team/releases-openstar-Enterprise/master/openstar/bash/openstar.sh tengine版本 下載: wget -N --no-check-certificate https://raw.githubusercontent.com/op-sec-team/releases-openstar-Enterprise/master/openstar/bash/tengine.sh # 增加腳本執行權限 chmod +x openstar.sh chmod +x tengine.sh tengine.sh # 進行 unix 轉換 dos2unix openstar.sh dos2unix tengine.sh # 運行腳本 ./openstar.sh(tengine.sh) ~~~ [??openstar.sh](https://www.yuque.com/attachments/yuque/0/2022/sh/1877304/1669439237686-7cb8a505-6026-4da6-accd-5907e1bb44f6.sh) [??tengine.sh](https://www.yuque.com/attachments/yuque/0/2022/sh/1877304/1669439243690-9844df05-dfaf-49a9-99e1-bc29c51a04fd.sh) **腳本無法從 github 下載時,從這里下載吧!** 根據腳本提示進行選擇吧~ openresty版本 ![](https://img.kancloud.cn/8f/96/8f96072f5da11090805a27b436ca25cc_671x737.png) tengine版本 ![](https://img.kancloud.cn/67/f5/67f578eb156d8c0019bb2b657011e5d3_624x724.png) 步驟如下: 1 --- 安裝 openresty/tengine 3 --- 安裝 openstar 7 --- 安裝 luarocks (tengine必須安裝) 8 -- openstar 運行環境檢查(**重要一定要運行**) 其他的選項更具自己的情況選擇使用吧 tengine版本 注意!!!: cjson.so 有時候腳本沒有安裝成功,需要您自己安裝一下/opt/tengine/luarocks/bin/luarocks install lua-cjson,再到目錄/opt/tengine/luarocks/lib/lua/5.1 看看有沒有cjson.so 這個文件 * * * 完成上面的操作,我們的openstar 、openresty/tengine、redis 就完全安裝完成了。 就可以啟動我們的 WAF 了 /opt/openresty(tengine)/nginx/sbin/nginx 環境變量已經添加(沒有使用在 /usr/bin 創建軟連接的方式,而是修改 /etc/profile 添加的環境變量) 但是本連接的shell還不能直接執行 nginx 命令,我們需要重新開啟一個 shell,執行 nginx -t 看是否正常 ## 手動安裝 ### 基本依賴安裝 ~~~bash # centos yum install -y wget make gcc readline-devel perl pcre-devel openssl-devel git unzip zip htop dos2unix bzip2 yum install -y sysstat goaccess libmaxminddb-devel # ubuntu apt-get install -y libpcre3-dev libssl-dev perl make build-essential curl git unzip zip htop dos2unix bzip2 apt-get install -y sysstat goaccess libmaxminddb-devel ~~~ ### redis 安裝 這里就不多說明了(yum/apt-get)就不說明了 ~~~bash # 下載 redis 以 6.2.5 為例子 mkdir -p /opt/redis/ && cd /opt/redis/ wget http://download.redis.io/releases/redis-6.2.5.tar.gz # 解壓文件 tar zxvf redis-6.2.5.tar.gz # 編譯安裝 cd redis-6.2.5 && make # edis 編譯成功了 ~~~ 就修改 我們的 rds.sh 腳本 ![](https://img.kancloud.cn/a1/d6/a1d6e4c4a42cc38bb0c7e33be2dc25ef_683x422.png) ### 安裝 jemalloc ~~~bash # 下載 jemalloc mkdir -p /opt/down/ && cd /opt/down wget https://github.com/jemalloc/jemalloc/releases/download/5.2.1/jemalloc-5.2.1.tar.bz2 # 解壓 tar -xvf jemalloc-5.2.1.tar.bz2 # 編譯安裝 cd jemalloc-5.2.1 && ./configure make && make install ldconfig ~~~ ### 安裝 openresty 我們一定要編譯安裝! ~~~bash # 下載相關包 以 1.19.9.1 mkdir -p /opt/down/ && cd /opt/down wget https://openresty.org/download/openresty-1.19.9.1.tar.gz wget http://luarocks.org/releases/luarocks-3.2.1.tar.gz wget http://labs.frickle.com/files/ngx_cache_purge-2.3.tar.gz git clone --depth=1 https://github.com/leev/ngx_http_geoip2_module.git # 解壓文件 tar -xvf openresty-1.19.9.1.tar.gz tar -xvf luarocks-3.2.1.tar.gz tar -xvf ngx_cache_purge-2.3.tar.gz # 編譯安裝 ./configure --prefix=/opt/openresty/ \ --add-module=/opt/down/ngx_http_geoip2_module \ --add-module=/opt/down/ngx_cache_purge-2.3 \ --with-ld-opt='-ljemalloc' \ --with-debug \ --with-threads \ --without-luajit-gc64 \ --with-stream_realip_module \ --with-stream_ssl_module \ --with-stream_ssl_preread_module \ --with-http_realip_module \ --with-http_stub_status_module \ --with-http_slice_module \ --with-http_v2_module gmake && gmake install ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime chown nobody:nobody -R /opt/openresty/ cd /opt/openresty/ chown root:nobody nginx/sbin/nginx chmod 751 nginx/sbin/nginx chmod u+s nginx/sbin/nginx cat /etc/profile |grep "openresty" ||(echo "PATH=/opt/openresty/nginx/sbin:\$PATH" >> /etc/profile && source /etc/profile) ## 安裝 luarocks cd /opt/down/luarocks-3.2.1 ./configure --prefix=/opt/openresty/luarocks \ --with-lua=/opt/openresty/luajit/ \ --with-lua-include=/opt/openresty/luajit/include/luajit-2.1 \ --lua-suffix='jit' make && make install ~~~ ### 安裝 openstar ~~~bash # 下載 cd /opt/openresty/ git clone --depth=1 https://github.com/op-sec-team/releases-openstar-Enterprise cp -Rf ./releases-openstar-Enterprise/openstar /opt/openresty/ cp -Rf ./releases-openstar-Enterprise/view-private /opt/openresty/nginx/html/ mkdir -p /opt/openresty/nginx/conf/conf.d mkdir -p /opt/openresty/nginx/conf/stream mkdir -p /opt/openresty/nginx/certs mkdir -p /opt/openresty/nginx/root_certs chown nobody:nobody -R /opt/openresty/openstar chown nobody:nobody -R /opt/openresty/nginx/html/view-private ~~~ ### 收尾 ~~~bash # 執行 ./openstar.sh 腳本 # 選擇 【 8 openstar運行檢查 】 ~~~ ## 添加開機啟動 把 redis 、nginx 設置好開機啟動即可;操作簡略如下! bash目錄下有一些 service 文件,在 centos7 下用于配置開機啟動服務的,具體可以參考一些 [文檔](https://www.cnblogs.com/lycokcc/p/5239318.html) 也可以直接放到啟動腳本中 /etc/rc.d/rc.local 設置文件可執行 ~~~bash vim /etc/rc.d/rc.local # 文件最后追加下面的內容 # 集群 master 增加 redis 啟動項(安裝了redis的服務器添加) sudo sh opt/openresty/openstar/bash/rds.sh start # 增加 nginx 啟動項 /opt/openresty/nginx/sbin/nginx # 配置rc.local執行權限 chmod +x /etc/rc.d/rc.local ~~~ ## 注意事項 1. openstar 目錄固定 /opt/openresty/openstar 或 /opt/tengine/openstar **目錄固定放到這里,不要修改!** 2. 新開啟一個shell后,使用命令 nginx -t 測試成功,查看是否測試成功執行 nginx 啟動 nginx 后,訪問 WAF 的 IP eg:[http://192.168.1.23](http://192.168.1.23) 可以是否正常訪問 ~~~bash # 響應內容 如下 { "msg": "system is ok" } ~~~ 訪問 http://192.168.1.23:5460 看看是否可以看到 WAF 的管理后臺 ![](https://img.kancloud.cn/77/ee/77ee3d62b06db9defbb1cfe479cbca6a_535x332.png) ## 常見問題 1:openresty-1.15.8.1 版本出現 cannot load incompatible bytecode 問題 注:1.13.6.2 之后的版本都需要增加編譯參數 \--without-luajit-gc64 解決:修改編譯參數 ~~~bash ./configure --prefix=/opt/openresty \ ..... --without-luajit-gc64 ~~~ 2:時區問題 需要配置WAF服務器時區為上海時區(北京) ~~~bash ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime ~~~
                  <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>

                              哎呀哎呀视频在线观看