Linux系統(tǒng)下如何搭建luarocks環(huán)境
更新時(shí)間:2024年06月19日 11:25:06 作者:longxiaobai_WJ
這篇文章主要介紹了Linux系統(tǒng)下如何搭建luarocks環(huán)境問(wèn)題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
1. notes
- 本文中
openresty
、git
、node
為隨手記錄; - 主要搭建
luarocks
環(huán)境,測(cè)試實(shí)現(xiàn)openresty部分功能;
2. luarocks
- lua或luajit安裝一個(gè)即可
wget https://luarocks.org/releases/luarocks-3.3.1.tar.gz tar -zxpf luarocks-3.3.1.tar.gz luarocks -h luarocks list luarocks install luafilesystem # 還可以指定你安裝的包的存放路徑 luarocks install package --tree=path
3. lua - luarocks
yum install -y readline-devel # 系統(tǒng)原有l(wèi)ua,通過(guò)以下命令查看版本 lua -v # 安裝同版本或穩(wěn)定版本 wget http://www.lua.org/ftp/lua-5.1.4.tar.gz tar -zxvf lua-5.1.4.tar.gz # make linux test cd lua-5.1.4 echo "INSTALL_TOP= /usr/local/lua_5.1.4" >> Makefile make linux && make install cd luarocks-3.3.1 # lua - configure ./configure --prefix=/usr/local/luarocks_3.3.1 --with-lua=/usr/local/lua_5.1.4 --with-lua-include=/usr/local/lua_5.1.4/include/ make && make install # lua require('cjson') luarocks install lua-cjson # Maybe Globals Env Note Settings export LUALOCKS_HOME=/usr/local/luarocks_3.3.1 export LUA_HOME=/usr/local/lua_5.1.4 export LUA_PATH="$LUALOCKS_HOME/share/lua/5.1/?.lua;?.lua;;" export LUA_CPATH="$LUALOCKS_HOME/lib/lua/5.1/?.so;?.so;;" export PATH = $PATH:$HOME/bin:$LUALOCKS_HOME/bin:$LUA_HOME/bin
4. luajit - luarocks
cd luarocks-3.3.1 # luajit - configure ./configure --prefix=/usr/local/luajit/ \ --with-lua=/usr/local/luajit/ \ --lua-suffix=jit \ --with-lua-include=/usr/local/luajit/include/luajit-2.0 \ --rocks-tree=/usr/local/ # --prefix 設(shè)定 luarocks 的安裝目錄 # --with-lua 則是系統(tǒng)中安裝的 lua 的根目錄 # --lua-suffix 版本后綴,此處因?yàn)閛penresyt的lua解釋器使用的是 luajit, 所以此處得寫 jit # --with-lua-include 設(shè)置 lua 引入一些頭文件頭文件的目錄 make && make install vim ~/.bashrc export LUAJIT_LIB=/usr/local/luajit/lib export LUAJIT_INC=$LUAJIT_LIB/include/luajit-2.0 ln -s /usr/local/bin/luarocks /usr/bin/luarocks # 刪除軟連接 # rm /usr/bin/luarocks # luajit require('cjson') luarocks install lua-cjson
5. openresty
# Yum Install yum-config-manager --add-repo https://openresty.org/package/centos/openresty.repo yum install -y openresty # Or 編譯安裝 wget https://openresty.org/download/openresty-1.19.3.1.tar.gz tar -zxvf openresty-1.19.3.1.tar.gz # 下載所需插件,如下示例 wget http://labs.frickle.com/files/ngx_cache_purge-2.3.tar.gz tar -zxvf ngx_cache_purge-2.3.tar.gz # 解壓緩存插件, /usr/local/src/ngx_cache_purge-2.3 # 編譯 OpenResty ./configure --prefix=/usr/local/openresty --with-luajit --without- http_redis2_module --with-http_stub_status_module --with-http_v2_module --with- http_gzip_static_module --with-http_sub_module \ --add-module=/usr/local/src/ngx_cache_purge-2.3 # 配置緩存插件的源碼路徑 # 安裝 OpenResty gmake && gmake install cd luarocks-3.3.1 # luajit - configure, --prefix 為 OpenResty --prefix - luajit ./configure --prefix=/usr/local/openresty/luajit \ --with-lua=/usr/local/openresty/luajit/ \ --lua-suffix=jit \ --with-lua-include=/usr/local/openresty/luajit/include/luajit-2.1 make sudo make install
6. git
yum -y install git
7. node
wget https://nodejs.org/dist/v16.19.1/node-v16.19.1-linux-x64.tar.xz tar -C /usr/local --strip-components 1 -xJf node-v16.19.1-linux-x64.tar.xz
8. openresty conf
./configure --prefix=/usr/local/openresty/nginx \ --with-cc-opt='-O2 -DNGX_LUA_ABORT_AT_PANIC -I/usr/local/openresty/zlib/include -I/usr/local/openresty/pcre/include -I/usr/local/openresty/openssl111/include' \ --with-ld-opt='-Wl,-rpath,/usr/local/openresty/luajit/lib -L/usr/local/openresty/zlib/lib -L/usr/local/openresty/pcre/lib -L/usr/local/openresty/openssl111/lib -Wl,-rpath,/usr/local/openresty/zlib/lib:/usr/local/openresty/pcre/lib:/usr/local/openresty/openssl111/lib' \ --with-cc='ccache gcc -fdiagnostics-color=always' \ --with-pcre-jit \ --with-stream \ --with-stream_ssl_module -\ -with-stream_ssl_preread_module \ --with-http_v2_module \ --without-mail_pop3_module \ --without-mail_imap_module \ --without-mail_smtp_module \ --with-http_stub_status_module \ --with-http_realip_module \ --with-http_addition_module \ --with-http_auth_request_module \ --with-http_secure_link_module \ --with-http_random_index_module \ --with-http_gzip_static_module \ --with-http_sub_module \ --with-http_dav_module \ --with-http_flv_module \ --with-http_mp4_module \ --with-http_gunzip_module \ --with-threads \ --with-compat \ --with-stream \ --with-http_ssl_module \ --add-module=../ngx_devel_kit-0.3.1 \ --add-module=../echo-nginx-module-0.62 \ --add-module=../xss-nginx-module-0.06 \ --add-module=../ngx_coolkit-0.2 \ --add-module=../set-misc-nginx-module-0.33 \ --add-module=../form-input-nginx-module-0.12 \ --add-module=../encrypted-session-nginx-module-0.09 \ --add-module=../srcache-nginx-module-0.32 \ --add-module=../ngx_lua-0.10.21 \ --add-module=../ngx_lua_upstream-0.07 \ --add-module=../headers-more-nginx-module-0.33 \ --add-module=../array-var-nginx-module-0.05 \ --add-module=../memc-nginx-module-0.19 \ --add-module=../redis2-nginx-module-0.15 \ --add-module=../redis-nginx-module-0.3.9 \ --add-module=../ngx_stream_lua-0.0.11 \
總結(jié)
以上為個(gè)人經(jīng)驗(yàn),希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。
您可能感興趣的文章:
相關(guān)文章
Linux下利用python實(shí)現(xiàn)語(yǔ)音識(shí)別詳細(xì)教程
早期語(yǔ)音識(shí)別系統(tǒng)僅能識(shí)別單個(gè)講話者以及只有約十幾個(gè)單詞的詞匯量?,F(xiàn)代語(yǔ)音識(shí)別系統(tǒng)已經(jīng)取得了很大進(jìn)步,對(duì)于 Python 使用者而言,一些語(yǔ)音識(shí)別服務(wù)可通過(guò) API 在線使用,且其中大部分也提供了 Python SDK,感興趣的小伙伴可以參考閱讀2023-03-03linux系統(tǒng)AutoFs自動(dòng)掛載服務(wù)安裝配置
大家好,本篇文章主要講的是linux系統(tǒng)AutoFs自動(dòng)掛載服務(wù)安裝配置,感興趣的同學(xué)趕快來(lái)看一看吧,對(duì)你有幫助的話記得收藏一下哦,方便下次瀏覽2021-12-12Ubuntu18.04安裝Pycharm教程的實(shí)現(xiàn)
這篇文章主要介紹了Ubuntu18.04安裝Pycharm教程的實(shí)現(xiàn),文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2019-09-09關(guān)于Grep的多次管道過(guò)濾的問(wèn)題及解決
這篇文章主要介紹了關(guān)于Grep的多次管道過(guò)濾的問(wèn)題及解決方案,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2023-03-03Ubuntu 16.04安裝搜狗拼音輸入法錯(cuò)誤問(wèn)題的解決方法
目前來(lái)說(shuō)搜狗輸入法是市場(chǎng)上最為好用和流行的輸入法,最為良心的是還有Linux版本,這讓眾多Linux人士歡呼雀躍。最近在新出的Ubuntu 16.04上安裝sogou輸入法的時(shí)候,碰到了一些問(wèn)題,主要還是依賴包沒(méi)有正確安裝,下面讓我們一起來(lái)看如何來(lái)解決這個(gè)問(wèn)題。2016-11-11