日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 人文社科 > 生活经验 >内容正文

生活经验

在Ubuntu 14.04 64bit上安装OpenResty 1.9.7.4

發布時間:2023/11/27 生活经验 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 在Ubuntu 14.04 64bit上安装OpenResty 1.9.7.4 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

為了自己的ThinkPad T420上面的Ubuntu可以使用openresty開發,我特地記錄一下安裝過程:

安裝依賴包

apt-get install libreadline-dev libncurses5-dev libpcre3-dev libssl-dev perl make build-essential
下載源碼并編譯安裝
wget https://openresty.org/download/openresty-1.9.7.4.tar.gz
tar zxvf openresty-1.9.7.4.tar.gz -C ~/program_develop/
cd ~/program_develop/
cd openresty-1.9.7.4

./configure --prefix=/opt/openresty --with-luajit --without-http_redis2_module --with-http_iconv_module
make
sudo make install
設置環境變量
vim /etc/profile
或者
vim ~/.bashrc
export PATH=/opt/openresty/nginx/sbin:$PATH
source /etc/profile

source ~/.bashrc

echo $PATH

查看環境變量是否設置正確?

配置文件
cd ~/program
mkdir -p openresty-test openresty-test/conf openresty-test/logs
在conf目錄下面手動創建
vim nginx.conf
啟動nginx
nginx -p ~/program/openresty-test/

客戶端測試

curl http://localhost:6699 -i
中途如果更改了nginx.conf,使用下面的命令來測試語法正確性

sudo nginx -p ~/program/openresty-test -t

停止

sudo nginx -p ~/program/openresty-test -s reload


需要注意的問題
與默認安裝的nginx不共存,會相互干擾,因為端口不一樣。如果安裝openresty之前系統中已經安裝有nginx,需要徹底卸載。默認安裝的nginx的配置文件在/etc/nginx/nginx.conf,可以將其服務停掉,以避免干擾
sudo service nginx stop
需要徹底刪除原有nginx相關目錄下面的所有文件。

我按照上面的方法徹底刪除nginx后,發現sudo命令下找不到nginx,只有在nginx可執行程序的那一目錄路徑下面才能使用下面的命令
sudo ./nginx -p ~/program/openresty-test/ -t
sudo ./nginx -p ~/program/openresty-test/ -s reload
第一條命令是測試配置文件是否有錯誤,第二條命令是重新加載配置文件(如果語法沒有錯誤)

參考文獻
[1].https://moonbingbing.gitbooks.io/openresty-best-practices/content/openresty/install_on_ubuntu.html

總結

以上是生活随笔為你收集整理的在Ubuntu 14.04 64bit上安装OpenResty 1.9.7.4的全部內容,希望文章能夠幫你解決所遇到的問題。

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