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

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

linux 全新编译安装,全新linux中通过编译方式安装nginx

發布時間:2025/3/20 linux 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 linux 全新编译安装,全新linux中通过编译方式安装nginx 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

先去官網下載linux.tar.gz包 http://nginx.org/en/download.html

傳到linxu中

解壓tar包

在軟件包nginx-1.15.9目錄下對NGINX進行配置

./configure --sbin-path=/usr/local/nginx/nginx --conf-path=/usr/local/nginx/nginx.conf --pid-path=/usr/local/nginx/nginx.pid --with-http_ssl_module --with-http_stub_status_module --with-stream

執行以上命令,提示這個信息:說明沒有安裝編譯器

checking for OS

+ Linux 3.10.0-957.el7.x86_64 x86_64

checking for C compiler ... not found

./configure: error: C compiler cc is not found

解決:yum -install gcc

在執行以上命令提示這個信息

./configure: error: SSL modules require the OpenSSL library.

You can either do not enable the modules, or install the OpenSSL library

into the system, or build the OpenSSL library statically from the source

with nginx by using --with-openssl= option.

解決:yum -y install openssl openssl-devel

配置執行成功:

Configuration summary

+ using system PCRE library

+ using system OpenSSL library

+ using system zlib library

nginx path prefix: "/usr/local/nginx"

nginx binary file: "/usr/local/nginx/nginx"

nginx modules path: "/usr/local/nginx/modules"

nginx configuration prefix: "/usr/local/nginx"

nginx configuration file: "/usr/local/nginx/nginx.conf"

nginx pid file: "/usr/local/nginx/nginx.pid"

nginx error log file: "/usr/local/nginx/logs/error.log"

nginx http access log file: "/usr/local/nginx/logs/access.log"

nginx http client request body temporary files: "client_body_temp"

nginx http proxy temporary files: "proxy_temp"

nginx http fastcgi temporary files: "fastcgi_temp"

nginx http uwsgi temporary files: "uwsgi_temp"

nginx http scgi temporary files: "scgi_temp"

執行編譯:make

編譯安裝:make install

到NGINX目錄下啟動:./nginx

提示以下信息:

nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

nginx: [emerg] still could not bind()

原因:可能是進程已經啟動,或者是端口被占用

解決方式:先查看進程是否啟動:ps -ef |grep nginx。如未啟動,就是原因二。

原因二解決方式:到安裝目錄下打開配置文件:vi nginx.conf。將修改為8080,再次啟動即可

啟動成功后瀏覽器中輸入ip和端口訪問。

提示“無法訪問此網站”

原因:linux中啟動了防火墻,可通過:systemctl status firewalld命令查看防火墻狀態

解決方式:systemctl stop firewalld 使用該命令禁用防火墻

再次訪問ok

總結

以上是生活随笔為你收集整理的linux 全新编译安装,全新linux中通过编译方式安装nginx的全部內容,希望文章能夠幫你解決所遇到的問題。

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