Hot answers tagged

14

You've added $_SERVER['HTTPS'] = 'on'; to your wp-config.php? You should also use the WP Migrate DB plugin to migrate from http://yoursite.com to https://yoursite.com


6

I work with several large WordPress sites, news sites specifically, that have thousands of posts and thousands of visitors (300k/day). With the stuff below, and a well coded theme, with well written queries, we're loading in 2.5s with 7 ad blocks from AdSense and RevContent. Do you have a CDN? I highly recommend a CDN if you don't have one. Depending on ...


5

@Tal, In terms of performance an unmanaged VPS will be better than a managed one. A Managed VPS will almost always come with CPanel which is great for shared hosting and for hosting companies to easily manage your VPS for you. You can still install any of the Opcode caching tools (APC, eAccelerator, XCache, MemCached) on a managed VPS with CPanel but ...


5

Souljacker, I would first take a look at your plugins. Star Ratings for Reviews hasn't been updated for over 3 years and looks like its real heavy on the db. I saw some raw sql with some INNER JOINS that look troublesome. On the server side you should implement some object caching. APC is the defacto standard and will give you the best results. Once ...


5

This also assumes .htaccess files are enabled in Apache, which almost always is in shared hosting, but is often disabled in enterprise environments. One way to accomplish this would be to write your own add_external_nginx_rule function that writes redirets out to a file (could use .htaccess even, though that might be confusing - it should be a hidden file ...


5

I solved it!! here's how: Edit your current theme's functions.php and add following line after the opening PHP tag to disable canonical redirection. remove_filter('template_redirect','redirect_canonical'); save and exit. Restart apache2 and nginx and check with curl -I IP.


5

Nginx is really good at concurrency (PHP not so much) so you should try a bit more than 180 requests per second. Maybe 500, or 1000 depending on your server resources and network throughput. The fastcgi_cache is served directly from ram. Wp-super-cache uses php to read a static file from the SSD so I see why it should be faster so why isn't it? It ...


4

The correct Nginx rewrite rules for WordPress are: location / { try_files $uri $uri/ /index.php?q=$uri&$args; } This sends everything through index.php and keeps the appended query string intact. If your running PHP-FPM you should also add this before your fastcgi_params as a security measure: location ~ \.php { try_files $uri ...


3

So any suggestions are welcomed. Suggestion #1 - Whenever Memcache is available in the server, I prefer Memcached Object Cache and Batcache, unless I have a specific reason to use W3 Total Cache. Whatever, W3 Total Cache offers, can be achieved without it too. For example, for minify, we have Better WP Minify, For Varnish, there is WordPress Varnish. ...


3

You need to set the path to your .conf file in the plugin general options then let W3 Total write to the file. I would create a w3-total.conf file in /etc/nginx then chown it www-data:www-data so w3 can write to it then add it as an include in your server file. Update: To answer your additional questions. If all your sites are using the same W3 Total ...


3

I unfortnately have no experience with this but evidently it can be done as these articles and plugins address some of the issues: HOWTO: Install WordPress On Nginx WordPress + nginx Compatibility Plugin Howto nginx + wordpress + ubuntu shortest setup Nginx front-end proxy cache for WordPress WordPress Pretty Permalinks with Nginx WordPress, Nginx and WP ...


3

What permissions should I set on each of wp folders? Users will need to upload various assets (images, pdfs, office docs, audio, video). I found this article here that seems helpful, but would like to get some input from folks having done this? This will be the same as any other web server. Whatever user happens to be running the web server need ...


3

Because I had cut and pasted define(’FS_METHOD’,’direct’); from the web, the incorrect quote characters were pasted into the file. should be define('FS_METHOD', 'direct'); The incorrect quote character also changed the encoding of the file somehow. If anyone has deeper knowledge of this issue please let me know in the comments.


3

No, it is not safe as it means that any security breach might end up in your code being changed. Alternatives: There is nothing wrong in using SFTP to upload changed plugins. If it is something that might take long time, you can manually put wordpress into maintenance mode by adding a file named .maintenance at the wordpress root directory and removing it ...


2

Take a look here: Performance tips for a large user base - it's a useful set of things to look at that go beyond just Apache. When looking to optimise performance, it's pretty important to look at the entire infrastructure to see where you might have issues - for example one of of my sites I eventually traced an issue that initially looked like an Apache ...


2

When you use W3TC with Nginx, it wants to write a nginx.conf file into your server root, do you have that file in place, writable by the nginx user? Also, did you add an include directive in your primary nginx config to pull that file in? For example, in my /etc/nginx/sites-enabled/dougal.gunters.org config file, I've got include ...


2

Small world :). You won't see a lot of issues with Nginx and Apache + Wordpress. We use it for our company as well, and we have no problem getting one server to serve 200k uniques/month and over a million pageviews/month for one site. Nginx + W3 Total Cache, you get some very remarkable numbers.


2

From what I've seen on the market, Nginx and Cherokee are pretty interchangeable for what you're doing. If you've already got things set up on Nginx ... there's no reason to switch to a different system. But if you want some benchmarks ... I did a quick Google search and came up with these: http://blog.mudy.info/2009/02/nginx-vs-cherokee/ ...


2

Is WordPress configured to use www or without www? Your server seems to be listening only for the www version and tries to redirect non-www requests to the www version. Considering that you provided a link to the non-www version of the domain above, my guess is that WordPress is trying to hook on to http://compassionpit.com, but your server redirects those ...


2

You should look in Wordpress Codex page related to Nginx. It's best manual for configuring nginx for wordpress I've seen over the internet.


2

"squat" is synonymous with "nothing" in this case. So, I'd say: Before you consider using nginx, be aware that PHP APC or a similar opcode cache with a WordPress caching plugin is going to offer significant performance improvements over just switching from Apache to nginx. If you aren't already using a PHP opcode cache and WordPress caching ...


2

Sometimes a plugin changes WordPress' internal rewrite rules during an update, an installation or deactivation. If the plugin's update happens to run after your taxonomy registration it may just wipe out the custom rules for the taxonomy. To inspect the currently active rewrite rules use the plugin Monkeyman Rewrite Analyzer. See this answer for details. ...


2

First of all, this isn't a WordPress issue - it's a Memcache issue - and if not for the open bounty, I'd close it as off-topic. Seconds, if your problem is with Memcache serving old content, then it sounds like you need to flush Memcache.


2

Both servers are listening to the same port. You have Nginx set to listen to 80 and nothing is set for Apache unless it's in your ports.conf. Your also proxy passing to Apache port 80 in your Nginx conf. In the Nginx conf change proxy_pass http://127.0.0.1:80; to proxy_pass http://127.0.0.1:9000; change listen XXX.XXX.XXX.XXX:80; to listen 80; In ...


2

Anchor will setup apache or nginx for me - but which should I choose?! Based on your concerns, I'd recommend Nginx -> Apache stack. Please let me explain. By default, Nginx can only process static content, such as images, CSS and JS files. Nginx passes PHP requests to PHP-FPM or to other servers such as Apache. Nginx can still cache dynamic content ...


2

Remove the 'fastcgi_intercept_errors' argument from you configuration. It's unnecessary since 'error_page' declares 404 errors, which should be handled by index.php, which will trigger PHP-FPM to handle it, and WordPress to present your theme's 404 page. It seems counter-intuitive, but 'fastcgi_intercept_errors' is actually causing PHP not to handle the ...


2

Place this code in your functions.php file add_filter( 'got_rewrite', '__return_true', 999 ); Update: got_mod_rewrite() function checks whether the current server is apache or not using apache_mod_loaded() function. Since we are using nginx it returns false. So wordpress adds index.php in the url. By using got_rewrite filter we are telling wordpress ...


2

The problem likely has to do with the server settings in Nginx for your blog. It's likely that the location rules for /blog/ are wrong, specifically try_files. It should look like this: location /blog/ { try_files $uri $uri/ /index.php$is_args$args; } This tells Nginx the order in which it should try to find the requested resource. It will first ...


2

Create a file specifically for W3 Total Cache configuration for your site, in a location Nginx/PHP-FPM can write to. Include this file in your site's Nginx server configuration. Then on the General Settings page, under Miscellaneous provide the full path to this file in the "Nginx server configuration file path" field. W3TC will then know to write any ...


2

This has been solved, please note I am using Wordpress 3.8 at the time of writing this, if you are from the future these plugins may not work with your current version, please check compatibility first. The plugin WP Multi Network provides this functionality. It basically allows you to create nested multi-site networks. I have my primary network at ...



Only top voted, non community-wiki answers of a minimum length are eligible