apt-get安裝以下的開發(fā)庫:
apt-get install libpcre3-dev \
libssl-dev perl make build-essential curl
下載
從下載頁 Download下載最新的 OpenResty? 源碼包,并且像下面的示例一樣將其解壓:
tar -xzvf openresty-VERSION.tar.gz
./configure
然后在進入 openresty-VERSION/ 目錄, 然后輸入以下命令配置:
./configure
默認, --prefix=/usr/local/openresty 程序會被安裝到/usr/local/openresty目錄。
您可以指定各種選項,比如
./configure --prefix=/opt/openresty \
--with-luajit \
--without-http_redis2_module \
--with-http_iconv_module \
--with-http_postgres_module
試著使用 ./configure --help 查看更多的選項。
配置文件(./configure script)運行出錯可以到 build/nginx-VERSION/objs/autoconf.err 找到。
make
您可以使用下面的命令來編譯:
make
如果您的電腦支持多核 make 工作的特性, 您可以這樣編譯:
make -j2
假設(shè)您是的機器是雙核。
make install
如果前面的步驟都沒有問題的話,您可以使用下面的命令安裝l OpenResty到您的系統(tǒng)之中:
make install
在 Linux,通常包括 sudo來執(zhí)行root權(quán)限做的事情。