.

설치 WordPress의 NGINX에 (FURLs & 캐시) - VPS 성경 백금 13

English 영어 (변경)
  • Digg
  • Twitter
  • Technorati
  • del.icio.us
  • Facebook
  • MySpace
  • Reddit
  • StumbleUpon
  • LinkedIn
  • email

설정 관리되지 않는 VPS (4 Newbies) - 파트 14 : Tweak 워드 프레스를위한 Nginx - 프리티 URL에 & WP 슈퍼 캐시 최대

nginx WordPress의 로고 이미지

WordPress의 블로그 플랫폼을 제대로 Nginx와 함께 우리는 웹 서버 구성을 조정할 필요가 작동합니다. 이 튜토리얼은 모두 캐싱을 설정하는 것입니다 - WP 슈퍼 캐시 플러그인을 통합 - 그리고 아주 영구 활성화 (감다, CURL, 모두!들) 몇 가지 간단한 규칙을 재작 성 s에.

좋아, 그럼 당신이 WordPress의 블로거는거야. 면, 신속하게 움직일 아니에요. 그렇지 않으면, 당신은, 계속 Nginx - 주스 마실래 여기.

왜냐하면 내가 보는 모든 WordPress의에, 그리고 사랑 해요 분명히 세계와 그녀의 동생이며, 전능하신 WP 때문에 행복 Nginx 서버와 살고 약간 TLC 요구, 난 마법을주지 필요하지 않습니다.

설정 관리되지 않는 VPS (4 Newbies) .. 최대 VPS 성경

20 복사 있음 / 붙여넣기 단계 .. 제로의 영웅에서 빈 상자를 리눅스 서버 귀여운 -했다.

아래로 스크롤하여 전체 시리즈의 색인을 생성합니다.

그럼, 헤이, & 만세! 희망 가상 공유 창고에 도움이됩니다. the_guv

왜 WP 슈퍼 캐시와 싫은 가요?

'왜냐하면 과도한 트래픽 및 귀하의 사이트 버스터 처리 속도! 그 자세한 내용을 보려면 여기를 참조하십시오. 본질적 : -

  • 에 디그 - 증거를 귀하의 블로그를

영구 링크에 관해서는?

URI로 변환하려면이 www.xyz.com에 www.xyz.com/r/default.asp?iID=HFJJLH&iPostID=JMMGD처럼 / 예쁜 -하시기 바랍니다. 본질적 : -

  • 가용성에 대한
  • 서재응

사랑스런.

WordPress의 플러그인을 WP 슈퍼 캐시 & 영구 번들

경우에만 영구 아니라 캐싱, 여기로 건너 뜁니다 싶어요.

새 파일을 만듭니다 : -

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

.