上一页 1 2 3 4 5 6 ··· 8 下一页
摘要: 安装完php php-fpm nginx 后访问php出现file not found错误,html就没问题配置文件server 段如下server { listen 80; server_name 192.168.1.11; root /home/www; location ~ .*\.php$ { try_files $uri =404; fastcgi_pass 127.0.0.1:9000; fastcgi_index inde... 阅读全文
posted @ 2013-10-12 11:41 sunsweet 阅读(8524) 评论(0) 推荐(0) 编辑
摘要: cd ~wget -S https://github.com/agentzh/echo-nginx-module/archive/master.zipmv master echo-nginx-module-master.zipunzip echo-nginx-module-master.zipcd ..cd nginx-1.4.2./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-http_gzip_static_module --user=www --group=www --add-module=/root/ 阅读全文
posted @ 2013-09-25 17:17 sunsweet 阅读(1218) 评论(0) 推荐(0) 编辑
摘要: 有这样的需求,客户上传图片,覆盖以前的图片,因为客户可能会频繁的换图片,上传覆盖完后,页面会自动请求刚才的图片,图片已经换掉,但是url并没有换,因为图片名字没改。因为更新的图要及时显示所以这个目录里的图片过期时间是location ~ .*\path\.(jpg|png|jpeg)${ expires 0;}但是并没有出现更新,浏览器依然会用本地的缓存。抓包发现,浏览器发现图片过期并发送了请求带有If-Modified-Since,得到的是304且Last-Modified时间没变,也就是说nginx说此图片没有更改,浏览器就用本地缓存了。但是通过stat命令发现此图片... 阅读全文
posted @ 2013-09-25 14:25 sunsweet 阅读(8900) 评论(0) 推荐(0) 编辑
摘要: linux下删除乱码文件名, 不废话:1. ls -i 列出文件的节点ID, 如: 1234567892. find ./ -inum 123456789 -print -exec rm -rf {} \; 阅读全文
posted @ 2013-09-18 15:53 sunsweet 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 序号任务命令组合1删除0字节文件find . -type f -size 0 -exec rm -rf {} \;find . type f -size 0 -delete2查看进程,按内存从大到小排列ps -e -o “%C : %p : %z : %a”|sort -k5 -nr3按cpu利用率从大到小排列ps -e -o “%C : %p : %z : %a”|sort -nr4打印说cache里的URLgrep -r -a jpg /data/cache/* | strings | grep “http:” | awk -F’http:’ ‘{print “http:”$2;}’5查看 阅读全文
posted @ 2013-09-17 13:28 sunsweet 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 一般用pushd dir pop命令切换目录,但是能存储的目录太少,今天发现一个更好的方法,使用符号链接跳转实际上这个手工解决方案总结起来是在一个隐藏文件夹下(例如 ~/.marks)储存符号链接.这里有4个shell函数:jump, mark, unmark, 和marks:export MARKPATH=$HOME/.marksfunction jump { cd -P "$MARKPATH/$1" 2>/dev/null || echo "No such mark: $1"}function mark { mkdir -p "$MA 阅读全文
posted @ 2013-08-26 20:27 sunsweet 阅读(324) 评论(0) 推荐(0) 编辑
摘要: #!/bin/sh mysql_port=3306 mysql_username="root" mysql_password="" function_start_mysql() { printf "Starting MySQL...\n" /bin/sh /data/mysql/bin/mysqld_safe --defaults-file=/data/mysql/${mysql_port}/my.cnf 2>&1 > /dev/null & } function_stop_mysql() { printf 阅读全文
posted @ 2013-08-21 21:33 sunsweet 阅读(413) 评论(0) 推荐(0) 编辑
摘要: #! /bin/sh### BEGIN INIT INFO# Provides: php-fpm# Required-Start: $remote_fs $network# Required-Stop: $remote_fs $network# Default-Start: 2 3 4 5# Default-Stop: 0 1 6# Short-Description: starts php-fpm# Description: starts the PHP FastCGI Process Manager daemon### END ... 阅读全文
posted @ 2013-07-31 22:19 sunsweet 阅读(887) 评论(0) 推荐(0) 编辑
摘要: 需求在一下数据后两个逗号前添加20130300样本数据BQTKCZ,04,2EDFS011--,-1,1,55.000000000,0,,,sed -i 's/\(.*\)\(,,\)/\120130300\2/g' datafileBQTKCZ,04,2EDFS011--,-1,1,55.000000000,0,20130300,, 阅读全文
posted @ 2013-07-26 13:59 sunsweet 阅读(143) 评论(0) 推荐(0) 编辑
摘要: dns server ip:192.168.1.254named.conf key "rndc-key" { algorithm hmac-md5; secret "z0xW7wm4O7E7OXXbUofd9w=="; }; controls { inet 127.0.0.1 port 953 allow { 127.0.0.1; } keys { "rndc-key"; }; };options{ Directory "/usr/local/named"; Pid-file "named.p... 阅读全文
posted @ 2013-07-22 13:25 sunsweet 阅读(316) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 8 下一页