.

Установка WordPress на Nginx (FURLs & кэша) - VPS Библии Pt 13

English Английский (изменить)
  • Digg
  • Twitter
  • Technorati
  • del.icio.us
  • Facebook
  • MySpace
  • Reddit
  • StumbleUpon
  • LinkedIn
  • email

Настройка Неуправляемые VPS (4 новичков) - Часть 14: Tweak Nginx для WordPress - Pretty URLs & WP Super Кэш

Nginx WordPress изображения логотипов

Для блога WordPress платформы для правильной работы с Nginx нам необходимо настроить конфигурацию веб-сервера. Этот учебник позволит обеим кэширования - интеграция WP Super Кэш плагин - и активировать довольно постоянным (FURL S, S CURL, все-таки!) С некоторыми простыми правилами перезаписи.

Итак, вы ведете блог WordPress. Если вы не быстро перейти на. В противном случае, и вы хотите Nginx сока, держать его здесь.

Потому что видя как я все любили вверх на WordPress, и, видимо, так же как и мир, и ее сестра, и потому, что всемогущие РГ нужно немного TLC, чтобы жить счастливо с сервером Nginx, я изложу's, что требуется.

Настройка Неуправляемые VPS (4 чайниками) .. VPS Библии

В 20 Copy / Paste шаги .. от нуля до героя, пустое поле Cute-как сервер Linux.

Прокрутку вниз для полного индекса серии.

Итак, эй, Сарай общих & Viva виртуальный! Надеемся, что оно помогает. The_guv

Зачем с WP Super Кэш?

'Cos он работает с интенсивным движением и скоростью до вашего сайта, Buster! Более подробную информацию о том, что посмотреть здесь. По существу: --

  • с Digg-доказательство вашего блога

Что касается постоянных ссылок?

Чтобы преобразовать Ури как www.xyz.com/r/default.asp?iID=HFJJLH&iPostID=JMMGD к www.xyz.com / Pretty-пожалуйста. По существу: --

  • для удобства
  • для SEO

Восхитительный.

WordPress плагин WP Super Кэш & Постоянные Bundle

Если вы хотите только постоянные, а не кэширование, чтобы показывать здесь.

Создать новый файл: --

sudo nano /usr/local/nginx/conf/wordpress_params.super_cache

And in there, paste:-

# if the requested file exists, return it immediately
if (-f $request_filename) {
break;
}

set $supercache_file '';
set $supercache_uri $request_uri;

if ($request_method = POST) {
set $supercache_uri '';
}

# Using pretty permalinks, so bypass the cache for any query string
if ($query_string) {
set $supercache_uri '';
}

if ($http_cookie ~* "comment_author_|wordpress|wp-postpass_" ) {
set $supercache_uri '';
}

# if we haven't bypassed the cache, specify our supercache file
if ($supercache_uri ~ ^(.+)$) {
set $supercache_file /wp-content/cache/supercache/$http_host/$1index.html;
}

# only rewrite to the supercache file if it actually exists
if (-f $document_root$supercache_file) {
rewrite ^(.*)$ $supercache_file break;
}

# all other requests go to Wordpress
if (!-e $request_filename) {
rewrite . /index.php last;
}

Save and quit - CTRL-X and Enter.

WordPress Permalinks Without WP Super Cache

If you've added the file above, ignore this section.

Create a file:

sudo nano /usr/local/nginx/conf/wordpress_params.regular

And paste this within:-

# WordPress pretty URLs: (as per dominiek.com)
if (-f $request_filename) {
break;
}
if (-d $request_filename) {
break;
}
rewrite ^(.+)$ /index.php?q=$1 last;
# Enable nice permalinks for WordPress: (as per Yawn.it)
error_page  404  = //index.php?q=$uri;

Save and quit (CTRL-X, 'y' to confirm, then Enter).

Configure Nginx for WordPress Permalinks & WP Super Cache

We'll link to either of those files now, from the virtual host file we created in Part 13: Serve Multiple Sites & Blogs with Virtual Hosts . If you have more than one standalone blog, as per Part 13, you'll have a vhost file for each, and must edit each of them.

Open the vhost file for each WP blog. For instance, for my site waywiderweb, which I've been exampling in this series:-

sudo nano /usr/local/nginx/sites-available/waywiderweb.com

If you want BOTH the WP Super Cache and the friendly URLs

After the line index index.php index.html; , so before the } , paste this:-

# Wordpress WP Super Cache plugin and permalinks.
include /usr/local/nginx/conf/wordpress_params.super_cache;

If you want ONLY the friendly URLs

After the line index index.php index.html; , so before the } , paste this:-

# Wordpress permalinks.
include /usr/local/nginx/conf/wordpress_params.regular;

Restart Nginx:-

n2r

Or, if you didn't follow Part 7: Edit bashrc for User-Friendly Linux , type:-

sudo /etc/init.d/nginx restart

Done. Check your site in a web browser.

I'd like to thank Matt Stevens and Gleb Esman for the Nginx integration.

Next Up, Installing WordPress & Other Platforms with Subversion.

That's it for pretty URIs, friendly URLs, FURLs, CURLs, permalinks or whatever else they're called. And we'll enable the caching when we install the WP Super Cache plugin. Talking of which, in the next how-to guide in this series, we do just that, using super-duper Subversion, with which we'll also simplify the WordPress installation process.

.. Damn, I'm good to you ;)   Guess what ...


SETUP an Unmanaged VPS (4 Newbies) .. The V-P-S Bible

Serve multi sites & blogs on a budget .. at the fastest possible speed .. with the least downtime .. in the most secure environment .. and future-proofed for easy admin.

That's what the VPS Bible is about, stepped out in simple copy & paste guides.

From high traffic WordPress blogs to startup web hosts, here's what you need.

Set it up?   Click here for the 21 part follow-up .. V-P-S Admin

.