首页 > 系统相关 >nginx安装配置 linux

nginx安装配置 linux

时间:2022-10-27 11:34:19浏览次数:42  
标签:http 配置文件 -- nginx conf linux 安装

编译安装nginx的配置文件的路径在哪
这个版本不同,位置还是不同的。
我的是nginx-1.9.9版本源码安装,配置文件在conf这个目录里面:
/usr/local/nginx/conf/nginx.conf
如果你找不见也可以搜索:
find/|grepnginx.conf
php和nginx安装后怎么配置
先安装编译依赖的一些组件
复制代码代码如下:
yuminstallpcrepcre-developensslopenssl-devel-y
1、解压程序包
复制代码代码如下:
tarxfnginx-1.10.0.tar.gz
cdnginx-1.10.0
2、预编译配置参数
复制代码代码如下:
./configure--user=www\
--group=www\
--prefix=/data/server/nginx\
--with-http_stub_status_module\
--without-http-cache\
--with-http_ssl_module\
--with-http_gzip_static_module
3、执行编译
复制代码代码如下:
make&&makeinstall
4、替换配置文件
nginx.conf
userwwwwww;
worker_processes1;
error_log/u01/data/log/nginx/error.logcrit;
pid/u01/data/server/nginx/logs/nginx.pid;
#Specifiesthevalueformaximumfiledescriptorsthatcanbeopenedbythisprocess.
worker_rlimit_nofile65535;
events
useepoll;
worker_connections65535;
http{
includemime.types;
default_typeapplication/octet-stream;
#charsetgb2312;
server_names_hash_bucket_size128;
client_header_buffer_size32k;
large_client_header_buffers432k;
client_max_body_size8m;
sendfileon;
tcp_nopushon;
keepalive_timeout60;
tcp_nodelayon;
fastcgi_connect_timeout300;
fastcgi_send_timeout300;
fastcgi_read_timeout300;
fastcgi_buffer_size64k;
fastcgi_buffers464k;
fastcgi_busy_buffers_size128k;
fastcgi_temp_file_write_size128k;
gzipon;
gzip_min_length1k;
gzip_buffers416k;
gzip_http_version1.0;
gzip_comp_level2;
gzip_typestext/plainapplication/x-javascripttext/cssapplication/xml;
gzip_varyon;
#limit_zonecrawler$binary_remote_addr10m;
log_formatmain'$remote_addr-"$request_time"[$time_local]"$request"'
'"$status"$body_bytes_sent"$http_referer"'
'"$http_user_agent"$http_x_forwarded_for';
log_format'$remote_addr-$remote_user[$time_local]"$request"'
'$status$body_bytes_sent"$http_referer"'
'"$http_user_agent"$http_x_forwarded_for"$request_time"';
include/u01/alidata/server/nginx/conf/vhosts/*.conf;
本回答由提问者推荐
nginx修改配置需要重启吗
nginx更改配置文件后需要重启生效。1、更改配置重启nginx:kill-HUP主进程号或进程号文件路径或者使用cd/usr/local/nginx/sbin./nginx-sreload2、判断配置文件是否正确:nginx-t-c/usr/local/nginx/conf/nginx.conf或者cd/usr/local/nginx/sbin./nginx-t
CentOS系统上,怎么安装nginx
1、安装nginx
安装nginx的linux系统需要联网,通过yum install nginx 可以查找安装。
2、找到相关的依赖包。输入确认完成安装。
3、确认是否安装成功,rpm 查询检索。
4、启动nginx服务。
安装好之后,启动nginx服务。centos7下采用systemctl控制安装。
5、查看端口是否启动,netstat检索nginx网站端口(默认是80)。
6、关闭防火墙,或者开通相应端口。通过其他主机访问,nginx网站页面。
7、nginx的配置文件,主配置文件nginx.conf 。
8、查询nginx的配置,/usr/sbin/nginx -V 可以列出nginx的详细配置。

标签:http,配置文件,--,nginx,conf,linux,安装
From: https://blog.51cto.com/yetaotao/5800574

相关文章

  • nginx配置文件location详解
    Centos7安装nginx完成后发现nginx.conf文件中没有server,只有events{...}和http{...},这是什么问题?在nginx.conf文件同目录的conf.d文件夹下的default.conf文件里面,应该是新......
  • nginx安装反向代理
    centos使用yum安装nginx后如何添加模块1.确认你已经安装在用的nginx信息nginx-V2.下载和此版本相同的nginx源码包并解压tar-xvzfnginx-1.10.3.tar.gz3.更新一下依赖相关包y......
  • nginx安装rewrite模块
    Linuxnginx安装目录找不到?如果找不到,那应该就是没有完成安装或者编译:首先要确认是否正确安装了:make&&makeinstall重新编译一次其次,在确定安装的目录:直接查看rpm包试试,rpm-q......
  • nginx处理一个请求的过程
    nginx能不能把一个请求过来的get参数接受,然后作为参数转发到另一个地址?php端用__GET()获取参数,然后用libcurl库函数转发至另一个URL地址。nginx如何拦截请求可以设置拦截一......
  • nginx错误日志路径
    nginx500错误,怎么解决(1)查看nginxerrorlog,查看phperrorlog(2)如果是toomanyopenfiles,修改nginx的worker_rlimit_nofile参数,使用ulimit查看系统打开文件限制,修改/etc/secur......
  • nginxyum下来的安装包默认再哪个目录
    linuxnginx缓存文件在哪个文件夹假设你是用包管理工具安装的nginx:如果你是redhat系列的,安装包是.rpm包,或者你用yum安装的话,这样查找:rpm-qlnginx如果是ubuntu,也是类似的方......
  • Linux下Jdk1.8的安装与环境变量配置教程(添加完整配置)
    文章目录摘要1.1常见概念1.1.1机器学习本质1.1.2什么是神经网络1.1.3各种常见算法图示1.1.4计算图的导数计算1.1.5理解局部最优与全局最优1.1.6大数据与深度学习......
  • LinuxCentOS在不删除Linux自带JDK的情况下安装JDK1.8(图文教程:重点是环境变量的配置)...
    环境:CentOS6.9安装JAVAJDK1.81.创建两个文件夹?mkdir-p/export/softmkdir/export/servers2.?上传jdk安装包到?/export/soft?命令:rz?选择JDK......
  • Linux上安装jdk1.8和配置环境变量
    Linux上安装jdk1.8和配置环境变量,参考相关文档,本人在此总结,操作归纳如下。[root@VM_0_4_centossrc]#mkdir-p/usr/local/src/jdk[root@VM_0_4_centossrc]......
  • Linux 环境下安装jdk1.8并配置环境变量
    很久没有碰过linux系统了,最近抽空又买了一台腾讯云的服务器准备玩一玩。记录一下Linux配置jdk1.8的步骤以加深记忆jdk的安装包可以直接去Oracle官网[https://www.or......