参考
http://www.wdudes.com/capture-screenshot-website-using-php-without-api/
主要是利用 PhantomJS 的截屏功能
php文件改进如下
参考
http://www.wdudes.com/capture-screenshot-website-using-php-without-api/
主要是利用 PhantomJS 的截屏功能
php文件改进如下
apache 2.4 的 Substitute 模块是个好东西,可以用来实时修改页面内容,做些替换什么的工作,比如
ProxyPass / http://other_web_site.com
ProxyPassReverse / http://other_web_site.com
AddOutputFilterByType SUBSTITUTE text/html
Substitute “s|http://other_web_site.com|http://localhost|i”
可以把网页里面的 http://other_web_site.com 字样替换为 http://localhost
那么有时候 你会发现这个没生效,没法替换,但是这也没什么错误啊,
其实问题很可能是因为你proxy的那个站点用来压缩,导致在Substitute看起来页面是压缩的内容,他当然替换不了,那么必须在压缩前进行解压缩,其实并不需要解压,只需要告诉对方的服务器,我这里不接受压缩的文件,那么就需要另外一个模块了
LoadModule headers_module modules/mod_headers.so
这个模块可以更改proxy模块发到对方的header
RequestHeader set Accept-Encoding “”
那么完整就可以可以这样写
ProxyPass / http://other_web_site.com ProxyPassReverse / http://other_web_site.com RequestHeader set Accept-Encoding "" AddOutputFilterByType SUBSTITUTE text/html Substitute "s|http://other_web_site.com|http://localhost|i"
一共需要启用如下模块
LoadModule filter_module modules/mod_filter.so
LoadModule headers_module modules/mod_headers.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule substitute_module modules/mod_substitute.so
附:有关nginx里面proxy的时候碰到gzip
看这里 http://www.zjpro.com/nginx-substitutions4nginx.html
RT,搭设了 VPN,可以访问谷歌 FB等,现在却无法访问百度以及亚马逊,这真的很奇怪,有朋友也遇到相同的问题吗?着急求解!!
|
下载 ip-up-local,上传到服务器的 /etc/ppp/ip-up.local 文件,然后重启ppp服务
service pptpd stop && service pptpd start
参考资料来自
错误摘要
HTTP 错误 500.0 – Internal Server Error
FastCGI 进程最近常常失败。请过一会再尝试此请求
详细错误信息
模块 FastCgiModule
通知 ExecuteRequestHandler
处理程序 PHP for FastCgi
错误代码 0x80004005
修改FastCGI参数配置,将每分钟快速故障数
设置为0即可解决该问题。
参考 http://piaoyun.cc/814.html
nginx里面,防盗链需要针对你的域名和泛域名做相应的开放,所有图中 *.domain.com 是必须的,否则你的类似 www.domain.com 也会在屏蔽之列了
location ~* \.(gif|jpg|jpeg|png|bmp|swf|flv)$
{
valid_referers none blocked domain.com *.domain.com baidu.com *.baidu.com ;
if ($invalid_referer) {
return 403;
}
}
1)nginx.conf 里面的参数配置,假设服务器8核心(逻辑核心)
worker_processes 8;
worker_cpu_affinity 00000001 00000010 00000100 00001000 00010000 00100000 01000000 10000000;
worker_rlimit_nofile 102400;
events
{
use epoll;
worker_connections 204800;
accept_mutex on;
}
2) /etc/rc.local
echo “ulimit -SHn 65535” >> /etc/rc.local
3)/etc/security/limits.conf
* soft nofile 655360
* hard nofile 655360
4) /etc/sysctl.conf
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
net.ipv4.tcp_max_tw_buckets = 6000
net.ipv4.tcp_sack = 1
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_rmem = 4096 87380 4194304
net.ipv4.tcp_wmem = 4096 16384 4194304
net.core.wmem_default = 8388608
net.core.rmem_default = 8388608
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.core.netdev_max_backlog = 262144
net.core.somaxconn = 262144
net.ipv4.tcp_max_orphans = 3276800
net.ipv4.tcp_max_syn_backlog = 262144
net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_synack_retries = 1
net.ipv4.tcp_syn_retries = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_mem = 94500000 915000000 927000000
net.ipv4.tcp_fin_timeout = 1
net.ipv4.tcp_keepalive_time = 30
net.ipv4.ip_local_port_range = 1024 65000
参考文件:
http://www.open-open.com/lib/view/open1392942521299.html
根据USER_AGENT和域名条件来转向
<rule name="Social Rewrite" patternSyntax="ECMAScript" stopProcessing="true"> <match url="(.*)" ignoreCase="true" negate="false" /> <conditions logicalGrouping="MatchAll" trackAllCaptures="false"> <add input="{HTTP_USER_AGENT}" pattern="字符串" /> <add input="{HTTP_HOST}" pattern="^www\.domain1\.com$" /> </conditions> <action type="Redirect" url="http://www.domain2.com/{R:1}" appendQueryString="true" redirectType="Permanent" /> </rule>
重要地方
logicalGrouping="MatchAll" 表示全部符合才行,类似条件的串联 AND
logicalGrouping="MatchAny" 表示符合其一就可以,类似条件的并联 OR