技术交流QQ群:①185473046   ②190706903   ③203744115   网站地图
登录

下次自动登录
现在位置 >首页 > Nginx
0℃
准备篇 CentOS 7.x默认使用的是firewall作为防火墙,这里改为iptables防火墙。 1、关闭firewall: systemctl stop firewalld.service #停止firewall systemctl disable firewalld.service #禁止firewall开机启动 systemctl mask firewalld systemctl stop firewalld yum remove firewalld 2、安装iptables防火墙 RTMP基于TCP, 默认使用端口1935,再开放81端口 yum install iptables-services #安装 vi /etc/sysconfig/iptables #编辑防火墙配置文件 # sample configuration for iptables service # you can edit...
阅读全文
0℃
2022年08月03日 Nginx ⁄ 被围观 3,189次+
操作系统:CentOS 7.x 准备篇 一、防火墙配置 CentOS 7.x默认使用的是firewall作为防火墙,这里改为iptables防火墙。 1、关闭firewall: systemctl stop firewalld.service #停止firewall systemctl disable firewalld.service #禁止firewall开机启动 systemctl mask firewalld systemctl stop firewalld yum remove firewalld 2、安装iptables防火墙 yum install iptables-services #安装 vi /etc/sysconfig/iptables #编辑防火墙配置文件 # sample configuration for iptables service # you can edit this man...
阅读全文
0℃
2016年11月28日 Nginx ⁄ 被围观 13,319次+
说明: Nginx目录:/usr/local/nginx/ Nginx配置文件:/usr/local/nginx/nginx.conf 如果站点使用了vhost虚拟主机,并且只需要这一个虚拟主机支持pathinfo的,可以直接打开你的vhost的配置文件进行设置(绿色字为修改代码,蓝色字为增加代码)。 找到类似如下代码: location ~ .*\.(php|php5)?$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi.conf; #原来的代码 ...... } 编辑配置文件为以下代码: location ~ \.php { #定义变量 $path_info ,用于存放pathinfo信息 set $path_info...
阅读全文
0℃
2016年11月08日 Nginx ⁄ 被围观 16,940次+
教程目的: 使用Linux系统自带的命令logrotate对Nginx日志进行切割。 Nginx安装目录:/usr/local/nginx/ Nginx日志目录:/usr/local/nginx/logs/、/usr/local/nginx/logs/nginx_logs/ 1、添加nginx日志切割脚本 cd  /etc/logrotate.d  #进入目录 vi   /etc/logrotate.d/nginx   #编辑脚本 /usr/local/nginx/logs/*.log  /usr/local/nginx/logs/nginx_logs/*.log{ su root www missingok dateext notifempty daily rotate 7 create 0640 www adm sharedscripts postrotate if [ -f /usr/local/nginx/logs/nginx.pi...
阅读全文
0℃
2016年04月30日 Nginx ⁄ 被围观 18,699次+
一、配置nginx支持https协议访问,需要在编译安装nginx的时候添加相应的模块--with-http_ssl_module 查看nginx编译参数:/usr/local/nginx/sbin/nginx -V 如下所示: configure arguments: --prefix=/usr/local/nginx --with-google_perftools_module --without-http_memcached_module --user=www --group=www --with-http_stub_status_module --with-http_sub_module --with-http_ssl_module --with-http_gzip_static_module --with-openssl=/usr/local/src/openssl-1.0.1h --with-zlib=/usr/local/src/zlib-1....
阅读全文
0℃
2014年09月19日 Nginx ⁄ 被围观 34,534次+
说明: 操作系统:CentOS 6.x web环境:php+nginx+mysql nginx安装目录:/usr/local/nginx nginx配置文件:/usr/local/nginx/conf/nginx.conf nginx默认站点目录:/usr/local/nginx/html/ 需求:让nginx能够解析.cgi后缀的文件 具体操作: 一、安装perl-fcgi依赖包,通过安装perl-fcgi来支持nginx运行.cgi yum install perl-CPAN perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker 二、安装perl cd /usr/local/src wget http://www.cpan.org/src/5.0/perl-5.20.0.tar.gz #下载安装包,需要提前安装wget工具 tar -x...
阅读全文
0℃
说明: 操作系统:CentOS 站点1:bbs.osyunwei.com 站点2:sns.osyunwei.com Nginx安装路径:/usr/local/nginx Nginx配置文件路径:/usr/local/nginx/conf/nginx.conf 站点1配置文件路径:/usr/local/nginx/conf/vhost/bbs.osyunwei.com.conf 站点2配置文件路径:/usr/local/nginx/conf/vhost/sns.osyunwei.com.conf 目的: 1、对站点1和站点2的nginx访问日志按天保存,日志路径为: 站点1:/usr/local/nginx/logs/nginx_logs/bbs_logs 站点2:/usr/local/nginx/logs/nginx_logs/sns_logs 2、只保留30天以内的日志...
阅读全文
1℃
2012年02月01日 Nginx ⁄ 被围观 25,287次+
     1、在相应nginx配置文件的server容器中添加下面的代码      系统运维  www.osyunwei.com  温馨提醒:qihang01原创内容©版权所有,转载请注明出处及原文链接 location / { if (-f $request_filename/index.html){                 rewrite (.*) $1/index.html break;         } if (-f $request_filename/index.php){                 rewrite (.*) $1/index.php;         } if (!-f $request_filename){                 rewrite (.*) /index.php;         } } 例如:        vi /usr/local/nginx/conf/nginx...
阅读全文
0℃
2011年11月03日 Nginx ⁄ 被围观 11,458次+
引言:为了防止域名解析恶意指向,我们需要禁止nginx默认的空主机头,操作如下 vi /usr/local/nginx/conf/nginx.conf    #配置文件 系统运维  www.osyunwei.com  温馨提醒:qihang01原创内容©版权所有,转载请注明出处及原文链接 找到server,在上面一行添加如下内容: ############################## server {      listen       80 default;      server_name  _;      location / {      root   html;      return 404;                     }      location ~ /.ht {      deny  all;                       ...
阅读全文
0℃
2011年11月02日 Nginx ⁄ 被围观 10,852次+
在相应nginx配置文件的server中,添加如下代码 rewrite ^/(.*)-htm-(.*)$ /$1.php?$2; 系统运维  www.osyunwei.com  温馨提醒:qihang01原创内容©版权所有,转载请注明出处及原文链接 例如: vi /usr/local/nginx/conf/nginx.conf #编辑nginx配置文件 找到下面这行,在server_name localhost;后边一行添加上面的代码 server { listen 80; server_name localhost; rewrite ^/(.*)-htm-(.*)$ /$1.php?$2; #charset koi8-r; #access_log logs/host.access.log main; location / { root html; index index.php in...
阅读全文
1℃
2011年11月02日 Nginx ⁄ 被围观 20,133次+
在相应nginx配置文件的server中,添加如下代码 rewrite ^([^\.]*)/topic-(.+)\.html$ $1/portal.php?mod=topic&topic=$2 last; rewrite ^([^\.]*)/article-([0-9]+)-([0-9]+)\.html$ $1/portal.php?mod=view&aid=$2&page=$3 last; rewrite ^([^\.]*)/forum-(\w+)-([0-9]+)\.html$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3 last; rewrite ^([^\.]*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=viewthread&tid=$2&extra=page%3D$4&page=$3 last; rewrite ...
阅读全文


Copyright© 2011-2024 系统运维 All rights reserved
版权声明:本站所有文章均为作者原创内容,如需转载,请注明出处及原文链接
陕ICP备11001040号-3