Articles of wordpress

logging403重写暴力攻击

正如Wordpress编解码器中所解释的,我想通过RewritetRule来防止对wp-login.php的暴力攻击。 http://codex.wordpress.org/Brute_Force_Attacks#Deny_Access_to_No_Referrer_Requests 我想重写为403 Forbidden状态,而不是Codex的301状态码,并将其logging为“ 客户端被服务器configuration拒绝 ”,以便Fail2Ban可以处理日志并阻止IP。 我正在使用下面的代码。 # Stop spam attack logins and comments <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_METHOD} POST RewriteCond %{REQUEST_URI} .(wp-comments-post|wp-login)\.php* RewriteCond %{HTTP_REFERER} !.*example.com.* [OR] RewriteCond %{HTTP_USER_AGENT} ^$ RewriteRule (.*) – [R=403,L] </ifModule> 它禁止POST攻击作为403状态码,但是我没有看到有关error_log发生的任何日志。 我如何使RewriteRulelogging正常的发生率403loginerror_log? 而且是Rewrite + Fail2Banconfiguration来处理有效的服务器pipe理的蛮力攻击还是不行?

WordPress和Apache崩溃MySql(CLOSE_WAIT)

最后一天,我的vps上的mysql服务器开始崩溃,有时在重新启动后。 我在wordpress网站发现了这个问题。 service mysql start许多apache2进程超载内存和CPU。 这是顶部的截图。 我没有发现从Apache日志有用,mysql错误日志显示关于内存不足的消息: 140922 12:24:43 [Note] Plugin 'FEDERATED' is disabled. 140922 12:24:43 InnoDB: The InnoDB memory heap is disabled 140922 12:24:43 InnoDB: Mutexes and rw_locks use GCC atomic builtins 140922 12:24:43 InnoDB: Compressed tables use zlib 1.2.8 140922 12:24:43 InnoDB: Using Linux native AIO 140922 12:24:43 InnoDB: Initializing buffer pool, size […]

如何debugging在Azure网站中托pipe的WordPress

我有一个WordPress的站点在Azure托pipe和configuration与我的域名和私人证书。 前段时间(我不记得有任何改变,但我往往不记得事情)编辑post几分钟后,我开始从pipe理面板注销。 这种情况偶尔发生,我一直无法看到一个可以解释行为的好模式。 我不是IIS或Azure网站的专家,但是我有很强的技术背景,所以我想检查一下为什么会出现这个问题,但我不知道从哪里开始。 我应该在网站上检查什么日志? 我需要启用哪些日志loggingtypes来获取这些日志? 我如何访问它们?

在Ubuntu VPS上提高WordPress后端的速度

我有一个运行在我的VPS上的WordPress站点,这个站点是相当高规格的(3520MB RAM,4个内核)。 服务器运行Nginx和php5-fpm。 虽然该网站在前端有响应,但后端往往会很慢,一些pipe理页面需要几秒钟才能加载。 该网站运行WooCommerce,但我有WP总caching运行以及APC对象caching。 我的问题是真的关于php5-php的configuration,因为我想我可能没有设置最佳利用服务器的资源。 这是我在php5池中的www.conf : pm.max_children = 10 ; The number of child processes created on startup. ; Note: Used only when pm is set to 'dynamic' ; Default Value: min_spare_servers + (max_spare_servers – min_spare_servers) / 2 pm.start_servers = 2 ; The desired minimum number of idle server processes. ; Note: Used […]

Nginx的WordPress重写多个子文件夹

我目前正在为我们公司设置新的服务器,而且我们正在开发很多不同的应用程序,现在我们要在wp.domain.com/app1,wp.domain.com/app2等所有的wordpress应用程序中。 默认不工作的原因是因为我们想为所有的应用程序使用%postname%permalink。 我目前正在通过对每个子文件夹进行重写来进行pipe理,但是我宁愿用一个location块来重写每个子文件夹,所以每当我们上传一个新的应用程序到服务器时,我都不必编辑服务器块。 我们也有可能上传到子目录,例如wp.domain.com/appgroup1/app3,wp.domain.com/appgroup1/app6等。 这是我的wp.domain.comconfiguration: server { listen 80; root /usr/share/nginx/html/wp; index index.php index.html index.htm; server_name wp.domain.com; location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ =404; } location ~ /(.*)/ { index index.php; try_files $uri $uri/ /$1/index.php?$args; } […]

WordPress的错误目录打开

我有一个运行AMI(基于RedHat的)Linux的Amazon ec2 m3中型实例。 我试图通过在httpd.conf的末尾添加这个实例来在这个实例上托pipe多个域: <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /var/www/html/domain1 ServerName domain1.com ErrorLog logs/domain1.com_error_log CustomLog logs/domain1.com_access_log common </VirtualHost> <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /var/www/html/ ServerName domain2.com ErrorLog logs/domain2.com-error_log CustomLog logs/domain2.com-access_log common </VirtualHost> 现在这是我的问题: 当我打开domain1.com时,它打开的很好,但是当我打开浏览器domain1.com服务器的IP时打开。 domain1.com的内容存储在192.168.1.1/domain1/ OR / var / www / html / domain1中 目录/ var / www / html被假定为未来的主机domain2.com。 所以当我打开IP时,应该显示/ var / www / […]

永久链接和nginx不能获得WordPress页面的404s

我有nginx 1.6.2服务一个wordpress网站,用php-fpm。 固定链接设置如下: /blog/%postname%/ nginx正确地为网站页面( / , /products , /contact …)以及博客文章(在/blog/ )提供服务。 404s可以很好地用于博客文章(即example.com/blog/idontExist将以404响应)。 但是,浏览到example.com/iDontExist会得到HTTP 200响应和网站索引页的内容,而不是404。 这是我的nginx.conf: server { server_name example.com; root /var/local/example.com/; access_log /var/log/nginx/example.com-access.log main; error_log /var/log/nginx/example.com-error.log; error_page 404 /index.php?$request_uri; location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; # fastcgi_split_path_info ^(/blog)(/.*)$; include /etc/nginx/fastcgi_params; #fastcgi_intercept_errors on; #fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index […]

将旧的wordpress网站移动到服务器上的另一个文件夹,但即使没有.htaccess文件仍然redirect

我的朋友网站有一些恶意软件或其他东西,所以他决定停止使用wordpress,并让我从头开始build立自己的网站。 我从来没有在我的生活中使用wordpress,但我FTP'd到服务器上的根目录,创build一个名为“old_wordpress_site”的新文件夹,并将每个文件移动到该文件夹​​。 我在根目录下创build了一个名为index.html的文件,然后我去了URL,但似乎仍然受到WordPress的影响。 我去www.example.com它说: 未find 在此服务器上找不到请求的URL / newink /。 此外,尝试使用ErrorDocument处理请求时遇到404 Not Found错误。 似乎没有.htaccess文件(这很奇怪,因为我认为.htaccess文件是自动redirect的唯一方式,但无论如何…),但是我在这里回答了这个问题: https:// stackoverflow.com/questions/18406156/redirect-all-to-index-php-htaccess ,复制并粘贴答案,并将.htaccess文件添加到根目录。 它没有工作。 现在我看到: 内部服务器错误 服务器遇到内部错误或configuration错误,无法完成您的请求。 请联系服务器pipe理员,并通知他们错误发生的时间以及您在此错误发生之前执行的操作。 有关此错误的更多信息可能在服务器错误日志中可用。 我怎样才能摆脱这个WordPress的垃圾,像我通常做的那样添加一个index.php文件?

WordPress无法写入文件,尽pipe正确的文件权限

我无法自动安装插件或主题在我的新的WordPress的设置。 它给了我这个屏幕: 我相信这通常是由于wordpress目录上的写权限错误。 这些是我迄今为止所做的步骤: nginx在root用户下运行,在nginx用户下有工作进程: # ps -ef | grep nginx | head root 14197 1 0 07:46 ? 00:00:00 nginx: master process nginx nginx 14198 14197 0 07:46 ? 00:00:00 nginx: worker process PHP-FPM在root用户下运行,在nginx用户下有工作进程: # ps -ef | grep php-fpm | head root 14748 1 0 08:38 ? 00:00:00 php-fpm: master process (/etc/php-fpm.conf) nginx […]

WordPress永久链接不起作用

我有一个WordPress永久链接redirect无法正常工作的问题。 我可以通过设置界面指定永久链接对话框。 WordPress正确命名超链接。 但是,当redirect返回在此服务器上找不到请求的URL。 回到默认状态也不会。 点击my_url /?p = 123将我redirect到最后选定的永久约定,例如my_url /%postname%/,这又导致“未find”错误。 我检查和我的.htaccess是可写的,它有以下内部: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # BEGIN WordPress # END WordPress 我如何删除那些陈旧的redirect? 谢谢