我运行一个视网膜图像插件与W3cachingCDN支持。 W3caching将图像移动到S3,但由于URL的不同,JS文件将不会从那里服务器的文件(它从htp://mysite.com到htp://assets.mysite.com) 我发现一个post,说这只是把这个添加到你的.htaccess # ———————————————————————- # CORS-enabled images (@crossorigin) # ———————————————————————- # Send CORS headers if browsers request them; enabled by default for images. # developer.mozilla.org/en/CORS_Enabled_Image # blog.chromium.org/2011/07/using-cross-domain-images-in-webgl-and.html # hacks.mozilla.org/2011/11/using-cors-to-load-webgl-textures-from-cross-domain-images/ # wiki.mozilla.org/Security/Reviews/crossoriginAttribute <IfModule mod_setenvif.c> <IfModule mod_headers.c> # mod_headers, yu no match by Content-Type?! <FilesMatch "\.(gif|png|jpe?g|svg|svgz|ico|webp)$"> SetEnvIf Origin ":" IS_CORS Header set Access-Control-Allow-Origin "*" env=IS_CORS </FilesMatch> […]
我正在尝试一些我认为相当简单的事情:即将domain.com/dashboard/redirect到另一个(不同的)应用程序,而不是我的主域(这是一个WordPress的安装,但这是相当不相关的,我认为)。 所以当访问domain.com/dashboard/anywhere ,这个第二个应用程序应该像if /dashboard/是域的路由一样,正常处理所有的URL。 我到目前为止所尝试的或者只是导致一个redirect循环,根本没有路由或者给出500错误。 这是迄今为止我的nginx位置的一个例子: location ~ ^/dashboard/ { alias /srv/www/htdocs/fork/; // this is the second application I want to access rewrite "^(/.*)$" http://domain.com/$1 permanent; index index.php index.html; include /etc/nginx/fastcgi_params; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name; break; } 我试过从alias切换到root ,但无济于事。 而且我不确定接下来要做什么。 有没有人有任何想法可能会导致redirect? (主要是造成domain.com/dashboard/dashboard/dashboard (等)的循环。 更新 好的,下面马克的build议,我已经移动位置块超过任何WordPress的规则,我已经注释了一些代码。 已经取得了进展,现在向domain.com/dashboard/的请求将访问正确的应用程序,但现在正在该应用程序中查找dashboard文件夹。 这是当前的代码: location ~ ^/dashboard(/)(.*)$ { root […]
我的目标是使用Google云端硬盘为使用Fuse的Wordpress多站点存储媒体文件,到目前为止,我可以使用google-drive-ocamlfuse作为根用户来挂载Google云端硬盘。 我可以将Google云端硬盘安装为/ mnt / google-drive,然后以root身份执行cp,rm,mkdir,编辑文件等,但是无法更改文件suid / guid。 我把cp -R的目录内容从/ wordpress / wp-content /上传到/ mnt / google-drive / wordpress / wp-content / uploads,然后把原来的上传/文件夹mv上传到/。做一个象征性的链接: ls -s / mnt / google-drive / wordpress / wp-content / uploads上传 当我尝试通过Wordpress上传新媒体上传文件时,出现错误: “3.jpg”由于错误而无法上传无法创build目录wp-content / uploads / sites / 6/2013/10。 其父目录是否可由服务器写入? 我曾尝试使用-o allow_other但无济于事。 谷歌驱动器上的文件suid / guid都是root:root,我猜这就是为什么Wordpress无法写入它。 我也尝试使用-o uid和gid标志,但不会更改Google云端硬盘上产生的文件或目录权限。 有什么build议我可以做什么?
我已经从Debian Wheezy软件包系统安装了一个Wordpress插件文件夹似乎被破坏。 正如在Apache2的错误日志文件中所述: [error] File does not exist: /var/lib/wordpress/wp-content/plugins/var 插件正在寻找基于完整path的URL,而不是相对path。 我可以“暂时修复”在插件文件夹中对/ var进行符号链接的问题,但我知道这是错误的和肮脏的。 我不知道从哪里开始debugging。 所以任何帮助是值得欢迎的 其他信息:/ etc / wordpress / htaccess # Multisites generated htaccess RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] # add a trailing slash to /wp-admin RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^ – [L] RewriteRule […]
所以这里是圣人: 负载均衡器(haproxy)交付给3个Web服务器和一个数据库服务器,共5台服务器,并且在Web服务器之间共享Memcache会话。 我可以确认PHPSESSIONID正在Web服务器之间共享,但是当我尝试login时, $_POST不断被重置,并且login的cookie从不设置,导致不断的redirect到login页面。 我已经在haproxy中设置了appsessionid ,而且这个工作正常,但是由于大多数用户都会login,所以它在使用负载均衡器的时候失败了,所以很可能一台服务器会比其他服务器获得更多的stream量。 有没有人遇到这个和任何想法如何解决? 还是我被迫使用粘性会话? 编辑1: 做了更多的研究,并意识到我可以在$_SESSION保存$_POST ,但可能会有一些安全问题。 我的想法是在每个页面的closures操作中将其从会话中清除。 思考? 编辑2: 这里是/etc/haproxy/haproxy.cfg global log /dev/log local0 log /dev/log local1 notice chroot /var/lib/haproxy stats socket /run/haproxy/admin.sock mode 660 level admin stats timeout 30s daemon user haproxy group haproxy # Default ciphers to use on SSL-enabled listening sockets. # For more information, see ciphers(1SSL). […]
我在这里遇到了一个问题,经过四天的考察,我决定在这里寻求一些帮助,毕竟一百万人的头脑比一个人想得更好。 我有一个与NGINX,HHVM,PHP5-FPM(作为备份),Percona MySQL,Memcached(将由Redis取代)的Ubuntu 14.04服务器设置。 我有fastcgi_cache设置为WordPress和对象caching完成通过memcached。 从理论上来说,这一切都很酷,但并不是在实践中。 这是一款带有2GB内存的RamNode OpenVZ SSD VPS和一个带有两个内核的Intel Xeon E5。 在其上运行Blitz.io,服务器正在被两个NGINX工作进程彻底谋杀,每个进程使用100%CPU根据top和htop。 我通常运行以下模式: –pattern 999-1000:60 https://www.geeksune.com/blog/hello-world/ 这使得CPU走向屋顶,根据Blitz.io这是这样的结果: 135个命中57,734个错误和234个时间 显然这不好。 内存使用一直保持在250MB以下,似乎所有来自Blitz.io的请求都在caching中,如下所示: 54.232.204.19 – HIT [23 / Nov / 2014:19:06:32 -0200]“GET / HTTP / 1.1”200 7632“ – ”“blitz.io; [email protected]” 注意开始时的HIT。 我设置了一个新的日志格式,并添加了$ upstream_cache_status。 在同一台机器上的一个类似的设置工作与Blitz.io很好,所以肯定是我的NGINX设置有问题,它似乎与fastcgi_cache相关。 每次我都有同样的结果,即使只有Zend的PHP5-FPM。 有没有人知道发生了什么? 我的configuration文件如下所示: /etc/nginx/nginx.conf – http://paste.ubuntu.com/9236266/ /etc/nginx/sites-available/geeksune.com – http://paste.ubuntu.com/9236282/ /etc/nginx/conf.d/includes/ssl.inc – http://paste.ubuntu.com/9236298/ /etc/nginx/conf.d/includes/security.inc […]
我正在用Nginx在Heroku上托pipe一个WordPress站点 。 DNS在CloudFlare后面。 我的WordPress插件报告Heroku的IP而不是真正的客户IP。 我有以下的Nginx规则: location / { try_files $uri $uri/ /index.php?$args; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $http_cf_connecting_ip; } # Allow for internal Heroku router – 10.xxx set_real_ip_from 10.0.0.0/24; # Allow for external CloudFlare proxies – https://www.cloudflare.com/ips set_real_ip_from 199.27.128.0/21; set_real_ip_from 173.245.48.0/20; set_real_ip_from 103.21.244.0/22; set_real_ip_from 103.22.200.0/22; set_real_ip_from 103.31.4.0/22; set_real_ip_from 141.101.64.0/18; set_real_ip_from 108.162.192.0/18; set_real_ip_from […]
的背景 最近我已经改变了php5-fpm而hhvm ,那真是他们所说的,“holly performance grialed” 我已经安装hhvm删除php5-fpm(真的是一个后备需要??)按照此说明: https : hhvm 。 我在这个VPS里有多个网站(域),其中大多数是wordpress + nginx + W3TC + Ubuntu 12.0.4p + MariaDB 10ish 主要问题 由于变化,随机hhvm突然停止运行。 不知道为什么,所以我决定按照本教程的最后一步,安装ps-watcher并检测服务是否未运行,并每5秒检查一次以重新启动它。 configuration hhvm.conf: location ~ \.(hh|php)$ { proxy_intercept_errors on; #error_page 502=@fallback; try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_keep_conn on; fastcgi_buffer_size 128k; fastcgi_buffers 256 16k; fastcgi_busy_buffers_size 256k; fastcgi_temp_file_write_size 256k; include fastcgi_params; fastcgi_index index.php; fastcgi_param […]
我想在Nginx + HVVM上运行Wordpress。 它在Apache + PHP上运行良好,但是当我激活Nginx时,网站中的大多数url都被重写为https。 这是我的网站configuration: server { root /var/www/claremacdonald.co.uk; index index.php index.html index.htm; server_name *.claremacdonald.co.uk; include hhvm.conf; location / { try_files $uri $uri/ /index.php?q=$uri&$args; } } hhvm.conf: location ~ \.(hh|php)$ { fastcgi_keep_conn on; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } /etc/hhvm/server.ini ; php options pid = /var/run/hhvm/pid ; hhvm specific […]
最近阿帕奇一直在产卵,尽pipe似乎没有理由。 重新启动〜10分钟后,它会让产卵工作人员继续工作,直到达到最大数量,并且从不提供新的请求。 服务重启( service apache2 restart )后,我开始监视访问日志。 只有两个相当简单的要求,才开始产卵像疯子这样的工人: #/var/log/apache2/access.log 66.249.64.215 – – [17/Feb/2016:00:30:18 +0000] "GET /wp-content/uploads/2015/08/colarinho_3.png HTTP/1.1" 304 179 "-" "Googlebot-Image/1.0" 201.80.103.196 – – [17/Feb/2016:00:33:00 +0000] "GET /wp-content/uploads/2015/09/circulo_cromatico.png HTTP/1.1" 200 40642 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:44.0) Gecko/20100101 Firefox/44.0" 在完全停止提供新的请求之前,这是完整的状态。 $apache2ctl fullstatus Apache Server Status for localhost (via ::1) Server Version: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.12 […]