Quantcast
Channel: nginx –月小升网络笔记
Browsing all 19 articles
Browse latest View live

Linux 安装nginx

ubuntu vi /etc/apt/source.list 加入下面两句话 deb http://nginx.org/packages/ubuntu/ lucid nginx deb-src http://nginx.org/packages/ubuntu/ lucid nginx apt-get update apt-get install nginx vi...

View Article



nginx 下配置php-FPM

nginx 可以直接调用FPM来驱动php,从此就可以放弃apache了。什么原因不多说了。 先下载php5.4的安装包。 照别人的说法 ./configure --enable-fastcgi --prefix=/data1/server/php-cgi --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir...

View Article

linux下 手动安装php memcache扩展,配合php-fpm nginx

当然有不少办法可以安装memcache的插件不过如果你使用了php-fpm 和nginx驱动php采用那些sudo apt-get install php5-memcache可能就不好用了。 说说如果你把php手动安装在特别目录的情况下如何配置memcache php调用吧。 上下文参考我写的php-fpm安装那篇博客吧。 cd /data1/server/php-cgi/bin...

View Article

nginx,php-fpm性能优化

The page you are looking for is temporarily unavailable.Please try again later. 发生此情况nginx正常,fpm有进程。重启fpm即可。具体如何重启请参考 nginx下配置fpm 目前诊断发生的问题是fpm异常。对于一台支持高并发,每天承载巨大鸭梨的机器,需要确定fpm为何出问题。 先查看日志...

View Article

关闭nginx访问favico.ico功能

nginx日志最近发生大量访问favicon.ico无法找到的错误日志,月小升感觉很影响服务器性能,对于一个高并发的服务器每一个错误都会影响性能 关闭访问favicon.ico的功能 # 把以下配置放到 server {} 块. #关闭favicon.ico不存在时记录日志 location = /favicon.ico { log_not_found off; access_log off; }...

View Article


服务器nginx 是否要关闭keep-alive

最近nginx不知道什么原因导致经常并发高达4万。后来朋友说因为keep-alive问题。 特意研究一下keep-alive是什么。 nginx不像apache,直接有指令keep-alive off/on;它使用的是keepalive_timeout [time],默认的时长为75,可以在http、server、location使用此指令。 nginx keep-alive详情参考...

View Article

nginx php-fpm慢日志slowlog

nginx php-fpm慢日志slowlog php-fpm慢日志slowlog设置可以让我们很好的看见哪些php进程速度太慢而导致的网站问题。 可以让我们方便的找到问题的所在。 vi /data1/server/php-cgi/etc/php-fpm.conf   ; The log file for slow requests ; Default Value: not set ; Note:...

View Article

改变nginx logrotate方式采用sh文件自动切割日志文件

Logrotate读取/etc/logrotate.d目录下的文件 这里的文件会被系统自动执行 logrotate是作为linux系统日志的管理工具存在。他可以轮换,压缩,邮件系统日志文件。 默认的logrotate被加入cron的/etc/cron.daily中作为每日任务执行。 /etc/logrotate.conf为其默认配置文件指定每个日志文件的默认规则。...

View Article


CentOS 下载快速安装nginx

Ubuntu下安装nginx,直接apt-get install nginx就行了,很方便。 但是今天装了CentOS6.2,直接yum install nginx不行,要先处理下源,下面是安装完整流程,也十分简单: 1、CentOS 6,先执行: rpm -ivh...

View Article


nginx如何配置https ssl

最近在研究nginx,整好遇到一个需求就是希望服务器与客户端之间传输内容是加密的,防止中间监听泄露信息,但是去证书服务商那边申请证书又不合算,因为访问服务器的都是内部人士,所以自己给自己颁发证书,忽略掉浏览器的不信任警报即可。下面是颁发证书和配置过程。 首先确保机器上安装了openssl和openssl-devel #yum install openssl #yum install...

View Article

WordPress nginx 配置

WordPress是一个非常流行的Blog系统,它可以利用Apache的mod_rewrite来实现URL的静态化。安装好的WordPress在配置了持久链接之后,会在网站的根目录下(如果可写)生成一个.htaccess文件,这个文件可以指示Apache如何进行URL重写(如果服务器配置为允许使用htaccess的指令的话),它的内容如下: # BEGIN WordPress...

View Article

nginx php-fpm 上传大图片出错

1.需要安装gd库 yum -y install gd 重启动fpm 2.nginx 默认图片上传最大限制比较小。 修改PHP.ini中post_max_size upload_max_filesize max_execution_time max_input_time   打开php.ini文件,修改完毕后重启服务器。测试下上传文件。。。。(嘻嘻,是不是传上了很大的文件?)...

View Article

nginx 设置限制ip访问

一、服务器全局限IP #vi nginx.conf allow 10.57.22.172; #允许的IP deny all; 二、站点限IP #vi vhosts.conf 站点全局限IP: location / { index index.html index.htm index.php; allow 10.57.22.172; deny all; location ~ \.php$ { if (...

View Article


负载均衡如何做,负载均衡的几个方案

1.硬件负载均衡 一种是通过硬件来进行进行,常见的硬件有比较昂贵的NetScaler、F5、Radware和Array等商用的负载均衡器,它的优点就是有专业的维护团队来对这些服务进行维护、缺点就是花销太大,所以对于规模较小的网络服务来说暂时还没有需要使用; 2.软件负载均衡...

View Article

nginx 图片上传413 Request Entity Too Large

网站发布图片的时候发生413 Request Entity Too Large 背后nginx服务器 点击发布后,页面卡住了,过了一会返回浏览器显示“413 Request Entity Too Large”。 第一感觉就是文章内容太多,超过了nginx配置的限制,...

View Article


nginx 在centos7.2下报Failed to restart nginx.service: Unit nginx.service failed...

Linux 服务器种类繁多,版本不一,软件也是稀奇古怪,其实大致原理基本一致,搞清楚核心,就好办了。 service nginx restart Redirecting to /bin/systemctl restart nginx.service Failed to restart nginx.service: Unit nginx.service failed to load: No such...

View Article

Nginx 配置文件2018-11 Centos 7.4

简单配置 server { listen 81; server_name java-er.com; root /www/java-er.com;   location / { index index.html index.htm index.php; }   location ~ \.php$ { fastcgi_param SCRIPT_FILENAME...

View Article


centos 安装 owncloud+nginx+ssl 私有云

原因: 近来笔记本进水了,我老担心这笔记本会挂,然后把图片和以前暂时不用的资料都传到百度云了,可是工作上的文件天天在变,代码在svn倒是不担心,不过日常的word,ppt,这些文档,不方便在svn,百度和qq的云调查了一番如果交费用了,也不支持mac电脑自动同步,于是想到自己弄个云好了。 优势: owncloud...

View Article

nginx 按天生成日志

月小升记得以前nginx没有办法读取日期,今天找到个办法居然可以。 server{ location ~ \.php$ { fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include /etc/nginx/fastcgi_params; fastcgi_pass 127.0.0.1:9000;...

View Article
Browsing all 19 articles
Browse latest View live




Latest Images

Pangarap Quotes

Pangarap Quotes

Vimeo 10.7.0 by Vimeo.com, Inc.

Vimeo 10.7.0 by Vimeo.com, Inc.

HANGAD

HANGAD

MAKAKAALAM

MAKAKAALAM

Doodle Jump 3.11.30 by Lima Sky LLC

Doodle Jump 3.11.30 by Lima Sky LLC