Articles of wordpress

LAMP内存pipe理(CentOS)

首先,我不得不说我不是服务器pipe理方面的专家。 我已经在几个平台上完成了10多年的networking编程,但是大部分时间都来到了IT专业人员或者一个好的networking托pipe公司的现成情况。 现在我终于在一个需要从零开始构buildLAMP-setup的地方(只用一个香草CentOS安装)来提供非常强大的Wordpress设置。 一切都比较顺利,因为我一直在使用基于Linux的服务器pipe理来阻止事情的发展,但是我每周都会遇到一些非常奇怪的系统冻结,因为我是唯一一个可以访问服务器的人,启动服务,这是非常恼人的。 以下是一些关键数据: 服务器 384MB的内存 CentOS 5.6 PHP 5.2.10 MySQL 5.0.77 Apache 2.2.3 用法 约 WordPress中有300篇文章 约 每周10K独特用户 约 每月10万次的浏览量 事情做完了: 所有静态的东西(jQuery的,样式,布局图像)是从外部networking服务器的服务器。 WordPress的尽可能caching(W3总caching) 我把问题的范围缩小到内存pipe理 – 或者是缺乏内存pipe理。 出于某种原因,在服务器上禁用了交换function,一旦内存消耗达到100%,服务器就会进入抖动状态,所有希望都将消失。 内存的数量(384MB)仍然足以承载这些统计的网站,所以有些事情是错误的。 我只是想尽一切办法。 我显然尝试调整my.cnf,php.ini和httpd.conf中的设置,但无济于事。 这是我目前的关键设置: my.cnf中 skip-innodb datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock skip-locking skip-ndbcluster skip-bdb skip-networking safe-show-database query_cache_limit=8M query_cache_size=48M query_cache_type=1 max_user_connections=200 max_connections=32 interactive_timeout=60 wait_timeout=60 connect_timeout=50 thread_cache_size=4 key_buffer= 96M join_buffer=1M max_connect_errors=20 […]

Nginx的index.php只禁止子目录!

我在OpenVZ容器上使用nginx 1.0.4 + php-fpm + wordpress。 我的设置工作正常。 但是当我尝试访问http://example.com/wp-admin/它给我403错误,我访问http://example.com/wp-admin/index.php工作正常。 错误日志: 2011/07/24 21:50:38 [error] 29939#0: *35 "/home/example/blog/public_html/wp-admin/index.php" is forbidden (13: Permission denied), client: 125.234.xx, server: loopback.info, request: "GET /wp-admin/ HTTP/1.1", host: "example.com" 以下是我的configuration: upstream example { server unix:/dev/shm/example.sock; server { listen 80; server_name example.com; root /home/example/blog/public_html; index index.php; access_log /home/example/blog/logs/access.log; error_log /home/example/blog/logs/error.log; location ~ /\.ht { deny […]

错误的URL在wp-admin的WordPress的子目录和代理

我正在使用apache2和mod-proxy将wordpress博客整合到我的TLD的子目录中。 主站点:example.com Blog1:[ http://example.com/blog] Blog2:[ http://example.com/other-blog] Apach2主站点的虚拟主机与代理: <VirtualHost *:80> ServerName example.com … # Rewrite rule to add missing slashes RewriteRule ^/blog$ /blog/ [R=301] RewriteRule ^/other-blog$ /other-blog/ [R=301] <Proxy *> Order deny,allow Allow from all </Proxy> ProxyRequests off ProxyPass /blog/ http://blog1.localhost/ ProxyPassReverse /blog/ http://blog1.localhost/ ProxyPass /other-blog/ http://blog2.localhost/ ProxyPassReverse /other-blog/ http://blog2.localhost/ … </VirtualHost> 用于博客的Apach2虚拟主机: <VirtualHost *:80> ServerName […]

Nginx + Apache + WordPressredirect到localhost / 127.0.0.1

任何人都知道如何解决Nginx + Apache + WordPressredirect到localhost / 127.0.0.1的问题? 我已经尝试了很多不同的修补程序,但没有一个为我工作。 我可以去http://domain.com/wp-admin就好了,正常使用。 但是,如果我尝试去http://domain.comredirect到127.0.0.1。 如果我只是通过Apache运行,一切都可以正常工作。 这里是我的nginx.conf的相关部分: server { listen 80; server_name domain.com; root /var/www/html/wordpress; location / { try_files $uri $uri/ /index.php; } location ~ \.php$ { proxy_pass http://127.0.0.1:8080; } } 这里是我的httpd.conf的相关部分: Listen *:8080 ServerName <ip> <VirtualHost *:8080> ServerAdmin test@test DocumentRoot /var/www/html/wordpress ServerName domain.com </VirtualHost> 这就是我的nginx日志所喜欢的: <ip> – – [19/Jun/2012:22:35:35 […]

WordPress不调整图像与Nginx的+ PHP的FMP和其他问题

最近,我为Ubuntu LoCo团队的WordPress博客设置了一个带有512MB / 1ghz CPU,Nginx + php-fpm + Varnish + APC + Percona的MySQL服务器+ CloudFlare Pro的Ubuntu 12.04 VPS。 博客每天点击3〜4k左右,使用大约180MB和8〜20%的CPU。 一切似乎都快速工作…页面加载非常好,比我们的竞争对手快16倍…但是有一个问题。 当我们上传一个图片时,WordPress不会调整它的大小,所以我们可以在图片中插入完整的图片。 如果imagem有,比方说,30kb,它调整罚款…但如果图像有100kb +,它不会… 在nginx错误日志中我看到这个: upstream timed out (110: Connection timed out) while reading response header from upstream, client: 150.162.216.64, server: www.ubuntubrsc.com, request: "POST /wp-admin/async-upload.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "www.ubuntubrsc.com", referrer: "http://www.ubuntubrsc.com/wp-admin/media-upload.php?post_id=2668&" 这似乎与这个问题有关,但我不知道。 当超时发生的时候,当我试图查看post的时候,我开始明白: upstream timed out […]

网站上的活跃访问者数量与一个时间点上的Web服务器并发连接数量

我有1个单一网站运行在1个Amazon EC2实例(Linux,中等大小)上。 我们的网站基于WordPress,并启用了W3 Total Cache + Page cache – except for logged-in users + Object cache + Browser cache 我注意到,在一个时间点,活跃访问者的数量与我们的Web服务器的并发连接数量之间存在巨大的差异。 在1点,只有5个活跃的访问者,但有100多个并发连接到我们的服务器(由netstat -plan | grep :80 | wc -l )。 另一方面,有10个活跃的访问者,但有50个以上的并发连接到我们的Web服务器。 任何人都可以给我一些提示,我应该怎么去解决这个问题(我称之为一个问题,因为168个并发连接导致我们的服务器昨天下来,当时我们还在使用小的EC2实例)?

如何保护我的WordPress / Apache网站免受暴力僵尸networking攻击?

有什么东西(僵尸networking?),显然是攻击我的WordPress的网站。 我在Apache访问日志中看到很多这样的条目,每秒几个: 46.105.113.8 – – [14/Apr/2013:22:57:18 -0400] "POST /blog//wp-login.php HTTP/1.1" 200 4115 "-" "Mozilla/5.0 (X11; U; Linux i686; pt-BR; rv:1.9.0.15) Gecko/20091028 15 Ubuntu/9.04 (jaunty) Firefox/3.0.15" 74.207.229.103 – – [14/Apr/2013:22:57:19 -0400] "POST /wp-cron.php?doing_wp_cron=1365994639.0381069183349609375000 HTTP/1.0" 200 222 "-" "WordPress/3.5.1; http://mysite.com" 我在想,有些东西正在试图蛮力猜测密码。 我有一个想法是阻止所有的请求wp-login.php,除了我的家庭IP地址。 我将如何做到这一点? 还是有一个Wordpress插件,将自动阻止这些暴力攻击? 还是有更好的主意? 我在Ubuntu 12.04上运行Apache 2.2.22。

php5-fpm最大化所有内核(nginx + php5fpm + wordpress)

我们有一个运行8个cpu内核的16个gode linode,我试图debugging一个问题,当我尝试一个负载testing时,服务器开始在一个非常基本的WordPress站点上发出大约250个请求。 我只打在网站的头版fyi。 当我login到服务器并查看Htop上的服务器统计数据时,我发现所有核心都被挂钩,并且php5-fpm进程的垃圾负载也是如此。 testing完成后,这些过程仍然存在,我最终必须重新启动php-fpm才能使服务器恢复正常运行。 我今天在做日志的时候看到了这个。 [23-Dec-2013 12:19:03] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 0 idle, and 27 total children [23-Dec-2013 12:19:04] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 16 children, there are 0 idle, and […]

WordPress wp-admin在IIS ARR反向代理之后redirect循环

我有一个独特和有趣的设置,从我所能告诉的一个有趣的问题。 我有一个Windows Server 2012框作为我的主Web服务器托pipewebsite.com。 在http://website.com/sites/我有一个ARR反向代理设置,将所有内容都指向运行Apache的Debian框上的Wordpress WPMU安装。 这是重写规则configuration: 现在,一切工作正常,但搞砸了一件事是,如果我通过反向代理去任何wp-admin /页面,我得到一个redirect循环: 为了准确描述我所描述的内容,下面是我的.htaccess文件和我的wp-config.php文件 (省略了明显的东西)。 我觉得有趣的是,如果我改变我的本地主机文件指向我的域到Debian的IP地址,并绕过IIS ARR,那么WP – pipe理/工作得很好,没有问题。 这似乎是我的问题是IIS和Apache之间的翻译的地方? 我不知道要看什么,并进一步debugging。 任何帮助将超级赞赏!

将所有urlredirect到/ wp-admin和wp-json之外的根目录

我尝试将所有的urlredirect到除了wordpresspipe理和wordpress REST API之外的根目录。 我在.htaccess有这些规则: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !^/wp-admin.* RewriteCond %{REQUEST_URI} !^/wp-json.* RewriteRule ^.*$ / [L,R=301] </IfModule> 这是完美的工作,所有的redirect期望的/wp-json路线,我得到404错误。 此外,我有我的apache日志文件中的这些错误types: File does not exist: […]/dmjob/wp-json, referer: http://dmjob.dev:8888/ 你能帮我么 ? 非常感谢 ! 🙂