nginx に Webサーバーを変えてみた(正確にはサーバーを変えてみた)

4月 15, 2011 · Posted in MJ::Blog, Wordpress 

twitter でツイートした nginx 1.0リリース。熱が冷めぬうちに自分のブログを移設してみた。
nginxは HTTPサーバー(だけじゃないけど)ですね。広く利用されている Apacheと比較して軽い・早いと評判を聞き、最近オープンしているサービスも nginx 使っているのもあるので使ってみたかったのでした。インストール好きとしては。

なんで nginx かというと、単に使ってみたいというのが大きな理由なんだけど
今度リリースする予定のサービスが高負荷になるかもしれなくて、クラウドなどは利用するとして Apache というここまでほぼ一択で来ていた Webサーバーの選択について見直してみようかという思いもあったからです。
Apache 自体そんなにあれこれチューニングできるレベルには達してないけど、簡単な設定ならスイスイ設定できるくらい慣れ親しんでいる。ちょっとくらいのトラブルであればなんとか復旧もできる。
しかし、より高いパフォーマンス・安定しているという話を聞き、何時までも枯れたWebサーバーに甘んじるのではなく、個人的にもスキルが停滞しているし、ここはひとつ重い腰を動かすことにした。

で、さくらVPSに ubuntu いれたサーバーがあったのでそこに突っ込んだ。
というわけでメモ残し。

nginx インストール

$ sudo su -
# nginx=stable
# add-apt-repository ppa:nginx/$nginx
# aptitude update
# aptitude install nginx

majima.net 用バーチャルホストの設定

/etc/nginx/site-available/www.majima.net を作成


server {
  listen  80;
  server_name www.majima.net;

  access_log  /var/log/nginx/majima.net-access.log combined;

  location / {
    root /var/www/majima.net;
    index index.php index.html index.htm;

    # static files
    if (-f $request_filename) {
      expires 30d;
      break;
    }

    # request to index.php
    if (!-e $request_filename) {
      rewrite ^(.+)$ /index.php?q=$1 last;
    }
  }

  # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  #
  location ~ \.php$ {
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME /var/www/majima.net$fastcgi_script_name;
  }
}

で、設定を有効にするために

ln -s /etc/nginx/site-available/www.majima.net /etc/nginx/site-enable/
/etc/init.d/nginx configtest
/etc/init.d/nginx reload

結構簡単だったな。

WordPressを100倍速くする! MySQLの調整やnginx proxy cache | KRAY Inc
を参考に、proxy cache も組み込んでみたけど大きく早くなったような気もしないので、うまくいっていないかもしれんので、詳しくは上記を見てください。


Comments

74 Responses to “nginx に Webサーバーを変えてみた(正確にはサーバーを変えてみた)”

  1. KennethsoigE on 1月 26th, 2017 5時48分49秒

    essay writers online jobs http://optimized-by.rubiconproject.com/t/10129/20427/67863-15.3574420.3740554?url=http%3A%2F%2Foonix.us functional resume for retail management
    g6687hjhk7

  2. Jeffreycog on 1月 26th, 2017 13時14分48秒

    essay writing pdf grading book report rubric french holiday essay gcse

  3. LeonardNow on 1月 27th, 2017 10時55分00秒

    gis analyst resume
    george orwell essay english language
    good comparison topics essay
    fun essay questions
    free sample of manufacturing resume

  4. CharlesMow on 1月 29th, 2017 6時35分58秒

    essay yellow wallpaper analysis write a character description of huckleberry finn free language phrases homework helper

  5. HoraceVok on 2月 2nd, 2017 16時48分04秒

    frau paula trousseau resume marcuse an essay on liberation pdf free business plan resources

  6. HoraceVok on 2月 2nd, 2017 17時35分38秒

    free cover letter examples for customer service representative how to write email format free business mgt research papers

  7. HoraceVok on 2月 2nd, 2017 19時58分28秒

    gender stereotypes essay full auth3 filmbay yniii nw html english comparative essay conclusion example of ninth grade book report

  8. HoraceVok on 2月 2nd, 2017 20時46分13秒

    free event planner resume templates search information research paper example of an argumentative thesis statement

  9. HoraceVok on 2月 2nd, 2017 21時33分31秒

    georgia tech division of professional practice resume computer crime in the 90s essay full auth4 filmbay yn1ii qj html flowers for algernon and charly essay

  10. HoraceVok on 2月 2nd, 2017 22時20分44秒

    free site for resume search proper research paper format furniture store sales resume

  11. HoraceVok on 2月 2nd, 2017 23時20分00秒

    example of construction managers resume cover letter attorney job example of travelogue essay

  12. HoraceVok on 2月 2nd, 2017 23時45分08秒

    front office executive resume format essay about leisure activity free essay on time value of money

  13. HoraceVok on 2月 3rd, 2017 0時10分14秒

    free college term paper help action essay from hermeneutics ii in spep text frank raymond gis resume

  14. HoraceVok on 2月 3rd, 2017 1時00分26秒

    examples dissertation sample of substitute teacher cover letter free sample of research papers

  15. HoraceVok on 2月 3rd, 2017 1時25分41秒

    frederick douglass essay thesis difference between undergraduate postgraduate dissertation examples of how to write an abstract

  16. HoraceVok on 2月 3rd, 2017 2時15分56秒

    example questionnaire business plan help your child with physics homework essay topics co education

  17. HoraceVok on 2月 3rd, 2017 2時41分08秒

    example resume for school administrator how to write salary transfer letter gawain and the green knight essay questions

  18. HoraceVok on 2月 3rd, 2017 3時06分21秒

    gender role essay introduction the foo dog ate my homework fresh electronic engineer resume

  19. HoraceVok on 2月 3rd, 2017 3時31分32秒

    feature film business plan sample 6th grade book report instructions formatting a research paper outline

  20. HoraceVok on 2月 3rd, 2017 3時56分48秒

    funny essay scholarships political science topics for a term paper financial business plan software

  21. HoraceVok on 2月 3rd, 2017 4時22分03秒

    example of resume for executive secretary personal finance resume dual teaching free resume word template download

  22. HoraceVok on 2月 3rd, 2017 4時47分17秒

    exam essay writing tips thesis roca a5a0150c00 free essay on the importance of being earnest

  23. HoraceVok on 2月 3rd, 2017 5時12分38秒

    finished resume samples drive thru espresso business plan good essay writing structure

  24. HoraceVok on 2月 3rd, 2017 6時03分15秒

    general resume objectives for students activities for critical thinking skills expository essay on spies

  25. HoraceVok on 2月 3rd, 2017 6時28分32秒

    francis bacon essay of love analysis sample executive cv cover letter free example of good resume

  26. HoraceVok on 2月 3rd, 2017 7時19分10秒

    format of cover note for resume how to write on sign post minecraft experienced chartered accountants resume

  27. HoraceVok on 2月 3rd, 2017 7時44分32秒

    federal free resume sample role of project manager essay essay topics computer networks

  28. HoraceVok on 2月 3rd, 2017 8時09分50秒

    format of resume for doctors in india sample promptions coordintor resume example muet essay

  29. HoraceVok on 2月 3rd, 2017 8時35分09秒

    free dissertation examples pdf resume faux pas free resume search for employers in pakistan

  30. HoraceVok on 2月 3rd, 2017 9時00分27秒

    flowers essay kentucky wildlife essay winners geography a2 coursework

  31. HoraceVok on 2月 3rd, 2017 9時25分48秒

    foh restaurant manager resume sample creating a resume for mba applications goki eda thesis

  32. HoraceVok on 2月 3rd, 2017 9時51分12秒

    free microsoft works resume templates common application essay topics 2011 free homework charts print

  33. HoraceVok on 2月 3rd, 2017 10時16分32秒

    example of acknowledgement in research paper essay topic sentence founding brothers joseph ellis thesis

  34. HoraceVok on 2月 3rd, 2017 10時41分58秒

    essay teamwork teamwork in business sample list of tables in thesis free research paper euthanasia

  35. HoraceVok on 2月 3rd, 2017 11時07分23秒

    free sales resume search school entrance essay format freelance graphic designer resume samples

  36. HoraceVok on 2月 3rd, 2017 11時32分48秒

    examples persuasive essays cover letter grammar free essay about steroids

  37. HoraceVok on 2月 3rd, 2017 11時58分32秒

    geography coursework as level write a reportage george orwell shooting an elephant essay

  38. HoraceVok on 2月 3rd, 2017 12時23分58秒

    examples of research objectives in a research proposal essay topics vietnam war exhilarate business plan

  39. HoraceVok on 2月 3rd, 2017 12時49分31秒

    examples of sample resume finance internship resume objective examples free business plan for cyber cafe

  40. HoraceVok on 2月 3rd, 2017 14時05分51秒

    free ppt templates for business plan why did the french revolution fail essay fsu admission essay help

  41. HoraceVok on 2月 3rd, 2017 14時31分15秒

    gene evolution term papers exemple d39introduction de philosophie dissertation free samples of an essay

  42. HoraceVok on 2月 3rd, 2017 14時56分40秒

    example thesis computer aided instruction internal promotion resume sample example cover letter

  43. HoraceVok on 2月 3rd, 2017 15時22分09秒

    example essay for environmental pollution great expectations gentleman essay essay writing powered by disqus

  44. HoraceVok on 2月 3rd, 2017 15時47分38秒

    free resume creation tool ro write a cover letter essay writing competition insurance

  45. HoraceVok on 2月 3rd, 2017 16時13分13秒

    examples research paper outlines can opera resume downloads example medical administrative assistant resume

  46. HoraceVok on 2月 3rd, 2017 16時38分41秒

    free downloadable resume template parker biology answers for homework free example research paper abortion

  47. HoraceVok on 2月 3rd, 2017 17時04分17秒

    example resume network analyst literary analysis on the inferno field sales representative resume

  48. HoraceVok on 2月 3rd, 2017 17時29分54秒

    estate planning attorney cover letter how to write sakubun girl jamaica kincaid essay postmodernism

  49. HoraceVok on 2月 3rd, 2017 18時21分00秒

    fundamentals of academic writing how to write a featurehuman interest article free pilot resume format

  50. HoraceVok on 2月 3rd, 2017 18時46分33秒

    free resume templates word one page essay apa format free real estate business plan template

  51. HoraceVok on 2月 3rd, 2017 19時12分08秒

    gas station cashier duties resume cover letter telecommunications technicians example of resume in personal information

  52. HoraceVok on 2月 3rd, 2017 19時37分42秒

    example cover letter design job essay pearl harbour freshers resume for mba

  53. HoraceVok on 2月 3rd, 2017 20時03分16秒

    free book report rubrics elementary typical structure of a research paper free download essay on american culture

  54. HoraceVok on 2月 3rd, 2017 20時28分51秒

    excellent cover letter for job application baby resume for modeling free essay air pollution

  55. HoraceVok on 2月 3rd, 2017 20時54分31秒

    free scannable resume template how to write zaner bloser formatting essay examples

  56. HoraceVok on 2月 3rd, 2017 21時20分09秒

    gcse english essay structure queens college supplemental essay freedom for teenagers essay

  57. HoraceVok on 2月 3rd, 2017 21時45分53秒

    free business plan for comic trade how to write good descriptions fulfillment and warehousing sample resume

  58. HoraceVok on 2月 3rd, 2017 22時11分32秒

    filling out a resume organisational change management literature review five criteria for a successful business plan in biotech

  59. HoraceVok on 2月 3rd, 2017 22時37分15秒

    examples of critical reviews college cheerleading resume freire banking concept essay

  60. HoraceVok on 2月 3rd, 2017 23時03分01秒

    fine dining server cover letter sample free reflective essay examples nursing good key words for a resume

  61. HoraceVok on 2月 3rd, 2017 23時50分35秒

    example of cover letter for procurement manager http://brightfeed.us/index.php?link=8028 flash developer html resume toronto

  62. HoraceVok on 2月 4th, 2017 1時08分07秒

    film review essay format http://fiveshots.us/index.php?view-id=7040 examle of cover letter

  63. HoraceVok on 2月 4th, 2017 1時34分05秒

    good essay guide http://oota.us/index.php?viewpage=11326 formula one research paper

  64. HoraceVok on 2月 4th, 2017 2時51分34秒

    expository essay english language http://space2conferences.xyz/index.php?viewpage=2361 export automobile parts business plan sample

  65. HoraceVok on 2月 4th, 2017 4時34分56秒

    experience of cashier in resume http://minuko.us/index.php?page-id=9199 foreign policy essay examples

  66. HoraceVok on 2月 4th, 2017 5時00分48秒

    foundation engineering homework solutions http://jettag.us/index.php?page-id=4219 find a research paper on date rape

  67. HoraceVok on 2月 4th, 2017 5時52分32秒

    examples of teaching resume cover letters http://snappad.us/index.php?topic=3438 examples of a good business plan

  68. HoraceVok on 2月 4th, 2017 6時18分22秒

    essay the poet http://wikindo.us/index.php?page=7657 free online essay template

  69. HoraceVok on 2月 4th, 2017 6時44分13秒

    free formal essay sample http://jblbest.us/index.php?view-id=9270 essays on teacher

  70. HoraceVok on 2月 4th, 2017 7時35分51秒

    final 24 acting resume http://narkemer.us/index.php?page-id=11144 gcse english language essay structure

  71. HoraceVok on 2月 4th, 2017 8時27分35秒

    essay topics for high school applications http://dabfeed.us/index.php?link=12553 examples of literary essay

  72. ВалокВерхняя Тура on 2月 13th, 2017 2時32分04秒

    RE:nginx ? Web??????????(??????????????) | MJ::Blog Валок КПЭ-3.8 Кириллов

  73. RalphPiose on 2月 15th, 2017 0時39分42秒
  74. JarrettDix on 3月 28th, 2017 10時13分18秒

    is cialis over the counter – cialis over the counter, over the counter cialis.

Leave a Reply