首页 技术 正文
技术 2022年11月9日
0 收藏 860 点赞 3,033 浏览 2034 个字

先去官网下载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=<path> 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

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,484
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,899
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,732
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,485
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:8,125
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:5,286