06 2018 档案
摘要:1 gzip模块 参考:http://nginx.org/en/docs/http/ngx_http_gzip_module.html 浏览器的请求头里会表明Accept-Encoding 方式。服务器收到请求,就把内存按格式压缩,发给浏览器,响应头里会说明Content-Encoding和Cont
阅读全文
摘要:在服务器的响应头中,有Content-Type一行,表明传输的http媒体类型。 比如:txt文件就用text/plain 表明。 conf/mime.type
阅读全文
摘要:$args, 请求中的参数; $content_length, HTTP请求信息里的"Content-Length"; $content_type, 请求信息里的"Content-Type"; $document_root, 针对当前请求的根路径设置值; $document_uri, 与$uri相同
阅读全文
摘要:1 需求 一台服务器的nginx上如果需要运营多个网站,或者把二级域名拆分成不同的web映射目录。就需要使用vhost。web client上请求不同的域名,nginx会根据vhost里的server conf加载不同的配置。 2 配置 conf/nginx.conf 不需要server标签,只要在
阅读全文
摘要:1 安装php5.6 首先确保mysql已安装 碰到一些依赖问题 2 nginx对php的转发配置 nginx本身只处理静态网页,对于php网页,则专门做一个location映射,转发到php-fpm进程(默认监听在127.0.0.1 9000),然后php-fpm到对应的document_root
阅读全文
摘要:参考:http://nginx.org/en/docs/http/ngx_http_rewrite_module.html 1 语法 2 测试 2.1 精确匹配/return code 2.2 正则匹配/rewrite 2.3 是否存在/fastcgi_para 2.4 设定变量 3 反向引用
阅读全文
摘要:简单点的方法: 写个定时任务: cd /root/onlinezip log.out.$date.zip log.out> log.out#find ./ -name *.zip -ctime +7 | xargs rm -f 或者 0 03 * * * if [ -d /opt/logs ];th
阅读全文
摘要:0 conf结构 分三大部分:全局区/events/http。默认conf 如下 1 全局区 worker_processes 8; #设定工作进程数,一般等于core数就行。每个进程跑一个core。 #error_log logs/error.log debug;#error_log logs/e
阅读全文
摘要:检查版本与配置项 指定配置文件启动 检查conf语法是否正确 平滑重启,重读conf 如果修改./nginx/conf/nginx.conf,nginx不重启不会重新加载新的conf。例如:我修改默认的location / ,把ab.html放在第一访问序列。不重启,则仍是访问index.html
阅读全文
摘要:目录 1 install 2 anonymous_user 3 lcoal_user 4 iptables 5 log 6 virtual_user --end-- vsftpd.conf 1 install 2 anonymous_user 在vsftpd.conf里有对匿名用户的配置选项。全部配
阅读全文
摘要:参考: http://www.rabbitmq.com/tutorials/tutorial-one-python.html http://www.rabbitmq.com/tutorials/tutorial-three-python.html 1 基本 RabbitMQ是一个消息中间件(mess
阅读全文
摘要:1 基本理解 python不支持真多线程,无法在单进程中调用多核cpu。对于cpu密集型任务,可以使用多进程。python会调用OS原生多进程,运行在多核上,以此提高运行速度。 2 基本实现 3 父子进程间关系 4 class Queue() 线程共享内存数据,进程的内存是独立的。 在queue模块
阅读全文