PageRenderTime 64ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 1ms

/content/98bdbbc023d58582046a04e417e88139

https://github.com/tzmartin/gitmarks_tzm
#! | 1838 lines | 1446 code | 392 blank | 0 comment | 0 complexity | 5267c972ceca14f5105e2c74f91e113b MD5 | raw file
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head profile="http://gmpg.org/xfn/11">
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  5. <meta name="distribution" content="global" />
  6. <meta name="robots" content="follow, all" />
  7. <meta name="language" content="en, sv" />
  8. <title> Perfect Setup: Ubuntu Hardy+Nginx+MySQL5+PHP5+Wordress : MENSK Technologies Corporation</title>
  9. <meta name="generator" content="WordPress 3.0.1" />
  10. <!-- leave this for stats please -->
  11. <link rel="Shortcut Icon" href="http://www.mensk.com/wp-content/themes/revolution_tech-30/images/favicon.ico" type="image/x-icon" />
  12. <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="http://www.mensk.com/feed/" />
  13. <link rel="alternate" type="text/xml" title="RSS .92" href="http://www.mensk.com/feed/rss/" />
  14. <link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="http://www.mensk.com/feed/atom/" />
  15. <link rel="pingback" href="http://www.mensk.com/xmlrpc.php" />
  16. <link rel='archives' title='August 2010' href='http://www.mensk.com/2010/08/' />
  17. <link rel='archives' title='January 2009' href='http://www.mensk.com/2009/01/' />
  18. <link rel='archives' title='December 2008' href='http://www.mensk.com/2008/12/' />
  19. <link rel='archives' title='November 2008' href='http://www.mensk.com/2008/11/' />
  20. <link rel='archives' title='October 2008' href='http://www.mensk.com/2008/10/' />
  21. <link rel='archives' title='September 2008' href='http://www.mensk.com/2008/09/' />
  22. <link rel='archives' title='August 2008' href='http://www.mensk.com/2008/08/' />
  23. <link rel='archives' title='July 2008' href='http://www.mensk.com/2008/07/' />
  24. <link rel="alternate" type="application/rss+xml" title="MENSK Technologies Corporation &raquo; Perfect Setup: Ubuntu Hardy+Nginx+MySQL5+PHP5+Wordress Comments Feed" href="http://www.mensk.com/webmaster-toolbox/perfect-ubuntu-hardy-nginx-mysql5-php5-wordpress/feed/" />
  25. <link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://www.mensk.com/xmlrpc.php?rsd" />
  26. <link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://www.mensk.com/wp-includes/wlwmanifest.xml" />
  27. <link rel='index' title='MENSK Technologies Corporation' href='http://www.mensk.com/' />
  28. <link rel='start' title='Use ranking accelerator keywords to boost your organic ranking' href='http://www.mensk.com/seo-sem/use-ranking-accelerator-keywords-to-boost-your-organic-ranking/' />
  29. <link rel='prev' title='Ottawa Sales Leadership Initiative &#8211; the missing link?' href='http://www.mensk.com/happenings/ottawa-sales-leadership-initiative-the-missing-link/' />
  30. <link rel='next' title='How to prevent wordpress from messing up with your rich editing tags' href='http://www.mensk.com/webmaster-toolbox/wordpress/how-to-prevent-wordpress-from-changing-tags-and-text-formatting-rich-text-editor/' />
  31. <meta name="generator" content="WordPress 3.0.1" />
  32. <link rel='canonical' href='http://www.mensk.com/webmaster-toolbox/perfect-ubuntu-hardy-nginx-mysql5-php5-wordpress/' />
  33. <link rel='shortlink' href='http://www.mensk.com/?p=89' />
  34. <!-- All in One SEO Pack 1.6.12.1 by Michael Torbert of Semper Fi Web Design[-1,-1] -->
  35. <!-- /all in one seo pack -->
  36. <script charset="utf-8" type="text/javascript" src="http://w.sharethis.com/widget/?tabs=web%2Cpost%2Cemail&amp;charset=utf-8&amp;style=rotate&amp;publisher=647813e3-68f4-4195-82a1-47462b8fe7b1&amp;wp=3.0.1"></script><!--[if IE]><script src="http://www.mensk.com/wp-content/plugins/wp-gbcf/wp-gbcf_focus.js" type="text/javascript"></script><![endif]-->
  37. <!-- GBCF -->
  38. <style type="text/css" media="screen"><!-- @import url( http://www.mensk.com/wp-content/themes/revolution_tech-30/style.css ); --></style>
  39. <script type="text/javascript"><!--//--><![CDATA[//><!--
  40. sfHover = function() {
  41. if (!document.getElementsByTagName) return false;
  42. var sfEls = document.getElementById("nav").getElementsByTagName("li");
  43. // if you only have one main menu - delete the line below //
  44. var sfEls1 = document.getElementById("subnav").getElementsByTagName("li");
  45. //
  46. for (var i=0; i<sfEls.length; i++) {
  47. sfEls[i].onmouseover=function() {
  48. this.className+=" sfhover";
  49. }
  50. sfEls[i].onmouseout=function() {
  51. this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
  52. }
  53. }
  54. // if you only have one main menu - delete the "for" loop below //
  55. for (var i=0; i<sfEls1.length; i++) {
  56. sfEls1[i].onmouseover=function() {
  57. this.className+=" sfhover1";
  58. }
  59. sfEls1[i].onmouseout=function() {
  60. this.className=this.className.replace(new RegExp(" sfhover1\\b"), "");
  61. }
  62. }
  63. //
  64. }
  65. if (window.attachEvent) window.attachEvent("onload", sfHover);
  66. //--><!]]></script>
  67. </head>
  68. <body>
  69. <div id="wrap">
  70. <div id="top">
  71. <img src="http://www.mensk.com/wp-content/themes/revolution_tech-30/images/top.gif" alt="Top" />
  72. </div>
  73. <div id="header">
  74. <div class="headerleft">
  75. <a href="http://www.mensk.com/"><img src="http://www.mensk.com/wp-content/themes/revolution_tech-30/images/main_logo.jpg" alt="Life and Business &#8211; on Internet and Beyond" /></a>
  76. </div>
  77. <!--To define the 468x60 ad, go to your WP dashboard and go to Presentation -> Revolution Tech Options and enter the ad code.-->
  78. <div class="headerright">
  79. <p><a href="http://www.mensk.com/feed/rss/"><img style="vertical-align:middle" src="http://www.mensk.com/wp-content/themes/revolution_tech-30/images/rss.gif" alt="Subscribe to MENSK Technologies Corporation" /></a><a href="http://www.mensk.com/feed/rss/">News Feed</a><a href="http://www.mensk.com/comments/feed/"><img style="vertical-align:middle;margin-left:10px;" src="http://www.mensk.com/wp-content/themes/revolution_tech-30/images/rss.gif" alt="Subscribe to MENSK Technologies Corporation" /></a><a href="http://www.mensk.com/comments/feed/">Comments</a></p>
  80. </div>
  81. </div>
  82. <div id="navbar">
  83. <div id="navbarleft">
  84. <ul id="nav">
  85. <li><a href="http://www.mensk.com">Home</a></li>
  86. <li class="page_item page-item-2"><a href="http://www.mensk.com/about/" title="About">About</a></li>
  87. <li class="page_item page-item-17"><a href="http://www.mensk.com/ask-me/" title="Ask me!">Ask me!</a></li>
  88. <li class="page_item page-item-13"><a href="http://www.mensk.com/contact/" title="Contact Us">Contact Us</a></li>
  89. </ul>
  90. </div>
  91. <div id="navbarright">
  92. <form id="searchform" method="get" action="/index.php">
  93. <input type="text" value="Search this website..." name="s" id="s" onfocus="if (this.value == 'Search this website...') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search this website...';}" />
  94. <input type="submit" id="sbutt" value="GO" /></form>
  95. </div>
  96. </div>
  97. <div id="subnavbar">
  98. <ul id="subnav">
  99. <li class="cat-item cat-item-9"><a href="http://www.mensk.com/category/seo-sem/" title="View all posts filed under Dancing with Search Engines">Dancing with Search Engines</a>
  100. </li>
  101. <li class="cat-item cat-item-57"><a href="http://www.mensk.com/category/happenings/" title="View all posts filed under Happenings">Happenings</a>
  102. </li>
  103. <li class="cat-item cat-item-13"><a href="http://www.mensk.com/category/internet-marketing/" title="View all posts filed under Marketing on Internet and Beyond">Marketing on Internet and Beyond</a>
  104. </li>
  105. <li class="cat-item cat-item-6"><a href="http://www.mensk.com/category/services/" title="View all posts filed under Services">Services</a>
  106. </li>
  107. <li class="cat-item cat-item-25"><a href="http://www.mensk.com/category/webmaster-toolbox/" title="View all posts filed under Webmaster Toolbox">Webmaster Toolbox</a>
  108. <ul class='children'>
  109. <li class="cat-item cat-item-59"><a href="http://www.mensk.com/category/webmaster-toolbox/wordpress/" title="View all posts filed under Wordpress">Wordpress</a>
  110. </li>
  111. </ul>
  112. </li>
  113. </ul>
  114. </div>
  115. <div id="content">
  116. <div id="contentleft">
  117. <div class="postarea">
  118. <div class="breadcrumb">
  119. </div>
  120. <h1>Perfect Setup: Ubuntu Hardy+Nginx+MySQL5+PHP5+Wordress</h1>
  121. <div class="date">
  122. <p>August 16, 2008 by <a href="http://www.mensk.com/author/admin/" title="Posts by admin">admin</a>&nbsp;</p>
  123. </div>
  124. <style type="text/css">
  125. <!--
  126. pre {
  127. font-family: "Courier New", Courier, monospace;
  128. font-size: small;
  129. background-color: #E6E6E6;
  130. padding: 6px;
  131. /* height: 250px; */
  132. width: 600px;
  133. border-top-width: 1px;
  134. border-right-width: 1px;
  135. border-bottom-width: 1px;
  136. border-left-width: 1px;
  137. border-top-style: inset;
  138. border-right-style: inset;
  139. border-bottom-style: inset;
  140. border-left-style: inset;
  141. overflow:auto
  142. }
  143. .code_tag {
  144. font-family: "Courier New", Courier, monospace;
  145. font-size: small;
  146. font-style: normal;
  147. font-weight: bold;
  148. background-color: #333333;
  149. display: block;
  150. width: 600px;
  151. color: #00FF00;
  152. padding-top: 2px;
  153. padding-right: 2px;
  154. padding-bottom: 2px;
  155. padding-left: 5px;
  156. margin-bottom: 12px;
  157. margin-top: 2px;
  158. }
  159. .in_editor_tag, .in_editor_normal
  160. {
  161. font-family: "Courier New", Courier, monospace;
  162. font-size: small;
  163. font-style: normal;
  164. font-weight: bold;
  165. background-color: #CCC;
  166. display: inline;
  167. /* width: 600px; */
  168. color: #000;
  169. padding-top: 1px;
  170. padding-right: 5px;
  171. padding-bottom: 1px;
  172. padding-left: 5px;
  173. }
  174. .in_editor_normal
  175. {
  176. font-weight: normal;
  177. }
  178. .main_text {
  179. font-family: Verdana, Arial, Helvetica, sans-serif;
  180. font-size: small;
  181. }
  182. .main_text ul li{
  183. margin-left:5px;
  184. }
  185. .sub_heading {
  186. font-size: x-large;
  187. font-family: Georgia, "Times New Roman", Times, serif;
  188. margin-top: 55px;
  189. margin-right: 50px;
  190. margin-bottom: 10px;
  191. margin-left: 20px;
  192. border: 1px solid #666666;
  193. padding-top: 5px;
  194. padding-right: 10px;
  195. padding-bottom: 5px;
  196. padding-left: 10px;
  197. background-color: #FFFFCC;
  198. display: block;
  199. }
  200. -->
  201. </style>
  202. <div class="main_text">
  203. <p>The Perfect Setup:</p>
  204. <p> <strong><a href="http://www.ubuntu.com/getubuntu/download">Ubuntu Server 8.04.1 LTS Hardy</a> (supported to 2013) + EngineX (NGINX) Web Server built from sources + MySQL 5 + PHP 5.</strong> <br />
  205. (Or <strong><em>LEMP</em></strong> )</p>
  206. <p>Tested on <a href="http://www.slicehost.com/">256MB VPS slice at SliceHost</a>. Should work for other hardware.</p>
  207. <p>From baremetal/barebone/empty fresh install of Ubuntu Server to shiny, fast and SEO-friendly WordPress Portal propelled by <a href="http://wordpress.org/extend/plugins/wp-super-cache/">WP Super Cache plugin</a>. <br />
  208. All configured and powered by <a href="http://nginx.net/">NGinx WEB Server</a>.<br />
  209. Step by step copy/paste instructions - from &quot;zero to hero&quot; with everything on a single page (albeit long one) and in the right order. Just what your granma was asking for! </p>
  210. <p>Every time I need to quickly utilize new product or technology it always made me wonder &quot;why don't someone came up with a simple step by step instructions on <strong>which buttons to press</strong> to make this thing work?&quot;. So instead of waiting for someone to do it this time I decided to make one myself.</p>
  211. <p>After spending countless hours and days hunting for scripts, searching for clues, scrolling through misleading posts, extracting bits from articles, eliminating blubber and fluff, bugging busy geeky people for hints and getting all necessary pieces together in the right order I finally came up with this instructional post. It all boils down to step-by-step copy/paste instructions that should take you less than 1 hour to get from freshly installed Ubunty server to fully functioning, search engine optimized business-ready WordPress-powered website.</p>
  212. <p>I tested it all on 256MB VPS image offered by <a href="http://www.slicehost.com/">SliceHost</a> but the same instructions should work just just fine on any real hardware as well. <br />
  213. Most credits goes to <a href="http://articles.slicehost.com/ubuntu-hardy">excellent set of articles by PickedOnion at SliceHost</a> plus to some more sources, acknowledged within this post.</p>
  214. <p>This article assumes your username is 'jsmith' and your domain is 'mydomain.com'.</p>
  215. <p>Now it's time to get our hands dirty!</p>
  216. <span class="sub_heading">Secure and tidy-up your fresh Ubuntu Server installation</span>
  217. <ul>
  218. <li>Login as root.</li>
  219. <li>Change root password:
  220. <br />
  221. <span class="code_tag">passwd</span></li>
  222. <li>Add new username - yourself:<br />
  223. <span class="code_tag">adduser jsmith<br />
  224. visudo</span></li>
  225. <li>Append this line to end of file (to navigate within 'vi' editor to create next line - use these: <strong>L</strong>, <strong>$</strong>, <strong>a</strong>, &lt;ENTER&gt;):<br />
  226. <span class="in_editor_tag">jsmith ALL=(ALL) ALL</span><br />
  227. To save and exit do: &lt;ESC&gt;, :wq, &lt;ENTER&gt;<br />
  228. <br />
  229. </li>
  230. <li>SSH configuration:<br />
  231. <span class="code_tag">nano /etc/ssh/sshd_config</span> - Find <br />
  232. <span class="in_editor_tag">Port 22</span> - and change number to something different (12345) to make hacking more difficult. <br />
  233. - Set these to: <br />
  234. <span class="in_editor_tag">PermitRootLogin no</span><br />
  235. <span class="in_editor_tag">X11Forwarding no</span> <br />
  236. <span class="in_editor_tag">UsePAM no</span><br />
  237. - Append these lines to the very end:
  238. <br />
  239. <span class="in_editor_tag">UseDNS no</span>
  240. <br />
  241. <span class="in_editor_tag">AllowUsers jsmith</span><br /><br /></li>
  242. <li>Secure slice with iptables
  243. <br />
  244. <span class="code_tag">iptables-save &gt; /etc/iptables.up.rules<br />
  245. nano /etc/iptables.test.rules</span></li>
  246. <li>1. Copy contents of <a href="http://articles.slicehost.com/assets/2007/9/4/iptables.txt"><strong>this file</strong></a> -&gt; and paste it into '</code>iptables.test.rules'.<br />
  247. 2. Change port number to your port number on this line:<br />
  248. ...<br />
  249. <span class="in_editor_tag">-A INPUT -p tcp -m state --state NEW --dport 30000 -j ACCEPT</span><br />
  250. ...<br />
  251. 3. Save and exit (Ctrl+O, Ctrl+X).<br />
  252. <br />
  253. </li>
  254. <li>Apply new iptables rules:
  255. <br />
  256. <span class="code_tag">iptables-restore &lt; /etc/iptables.test.rules</span></li>
  257. <li>Save iptables rules permanently:
  258. <br />
  259. <span class="code_tag">iptables-save &gt; /etc/iptables.up.rules</span></li>
  260. <li>Make sure iptables rules will apply when server is rebooted as well:
  261. <span class="code_tag"> nano /etc/network/interfaces</span></li>
  262. <li>Add new line after these 2:
  263. <br />
  264. <span class="in_editor_normal">auto lo</span> <br />
  265. <span class="in_editor_normal">iface lo inet loopback</span><br />
  266. <span class="in_editor_tag">pre-up iptables-restore &lt; /etc/iptables.up.rules</span><br />
  267. Save and exit.</li>
  268. <li>Reload SSH to use new ports and configurations:
  269. <br />
  270. <span class="code_tag"> /etc/init.d/ssh reload</span></li>
  271. <li>Keep 'root' session running and open second session.<br />
  272. SSH login to your slice to new port, with your new username and password:
  273. <br />
  274. - Linux: <span class="code_tag">ssh -p 12345 jsmith@123.45.6.78 </span>- Windows: <span class="code_tag">putty jsmith@123.45.6.78 12345</span></li>
  275. <li>If you logged on successfully via your new username: 'jsmith' - you may close 'root' session now. <br />
  276. If not - you still have 'root' session opened to fix problems. In the worst case - you can use web based console shell login from your manage.slicehost.com dashboard to fix issues.
  277. <span class="code_tag">sudo aptitude -y install screen</span></li>
  278. <li>Enter screen: <br />
  279. <span class="code_tag">screen </span>Screen is the great little utility that allows your terminal session activity to keep running (say lengthy builds) even if you were cut off or disconnected. You may reenter your abandoned screen session at a later time to check progress and continue working.<br />
  280. - Usage notes:<br />
  281. - <u>new</u> screen session: <strong>screen</strong><br />
  282. - <u>attach</u> to existing screen session: <strong>screen -r</strong><br />
  283. - <u>list</u> all existing screen sessions: <strong>screen -list</strong> (output: <strong><em>12045</em></strong>.pts-0.MENSK (Detached), etc...)<br />
  284. - <u>attach</u> to existing screen session by number: <strong>screen -r 12045</strong><br />
  285. - <u>detach</u> from screen session and back to main terminal: <strong>Ctrl+A, D</strong><br />
  286. - to <u>rename</u> screen session from inside of it: <strong>Ctrl+A, Shift+A</strong> - and enter it's name.<br />
  287. - to <u>kill</u> current screen session: <strong>exit </strong>or <strong>Ctrl+A</strong><br />
  288. - to <u>kill all</u> screen sessions: <strong>Ctrl+A,\</strong><br />
  289. <br />
  290. </li>
  291. <li>Edit .bashrc file to make terminal window a bit more helpful:
  292. <br />
  293. <span class="code_tag">nano ~/.bashrc</span></li>
  294. <li>Append these lines to the end of it:
  295. <br />
  296. <span class="in_editor_tag">export PS1="\[\e[32;1m\]\u\[\e[0m\]\[\e[32m\]@\h\[\e[36m\]\w \[\e[33m\]\$ \[\e[0m\]"</span><br />
  297. <span class="in_editor_tag">alias ll="ls -la" </span><br />
  298. <span class="in_editor_tag">alias a2r="sudo /etc/init.d/apache2 stop &amp;&amp; sleep 2 &amp;&amp; sudo /etc/init.d/apache2 start"</span> <br />
  299. <span class="in_editor_tag">alias n2r=&quot;sudo /etc/init.d/nginx stop &amp;&amp; sleep 2 &amp;&amp; sudo /etc/init.d/nginx start&quot;</span> <br />
  300. <span class="in_editor_tag">alias ver="cat /etc/lsb-release"</span><br />
  301. Save and exit. <br />
  302. <br />
  303. </li>
  304. <li>Reload .bashrc to make changes active:
  305. <br />
  306. <span class="code_tag">source ~/.bashrc</span></li>
  307. <li>Update sources: <span class="code_tag">sudo aptitude update</span></li>
  308. <li>Set system locale:
  309. <br />
  310. <span class="code_tag">sudo locale-gen en_US.UTF-8<br />
  311. sudo /usr/sbin/update-locale LANG=en_US.UTF-8</span></li>
  312. <li>Upgrade system now:<br />
  313. <span class="code_tag">sudo aptitude -y safe-upgrade<br />
  314. sudo aptitude -y full-upgrade</span></li>
  315. </ul>
  316. <span class="sub_heading">Install PHP 5, Build Essentials and related libraries</span>
  317. <ul>
  318. <li>Install Build essentials:<br />
  319. <span class="code_tag">sudo aptitude -y install build-essential</span></li>
  320. <li>Install PHP with php client and without apache (one long line):<br />
  321. <span class="code_tag" >sudo aptitude -y install php5-common php5-dev php5-mysql php5-sqlite php5-tidy php5-xmlrpc php5-xsl php5-cgi php5-mcrypt php5-curl php5-gd php5-memcache php5-mhash php5-pspell php5-snmp php5-sqlite libmagick9-dev php5-cli</span></li>
  322. <li>Fix issues with imagick:<br />
  323. <span class="code_tag">sudo aptitude -y install make php-pear<br />
  324. sudo pecl install imagick</span>
  325. (Just press &lt;ENTER&gt; at prompt)<br />
  326. <br />
  327. </li>
  328. <li>Adjust php.ini:<br /><span class="code_tag">sudo nano /etc/php5/cgi/php.ini</span> Adjust memory limit to accomodate WordPress requirements:<br />
  329. Find line:<br />
  330. <code class="in_editor_tag">memory_limit = 16M</code> and change it to: <code class="in_editor_tag">memory_limit = 48M</code><br />
  331. <br />
  332. Append to the end of this file this line:<br />
  333. <code class="in_editor_tag">extension=imagick.so</code><br />
  334. <br />
  335. </li>
  336. <li>Install MySQL server, secure it and create database for wordpress (or other dynamic web app you will be using)<br />
  337. <span class="code_tag">sudo aptitude -y install mysql-server mysql-client libmysqlclient15-dev</span>Secure MySQL server:<br />
  338. <span class="code_tag">mysql_secure_installation</span></li>
  339. <li>Install subversion (best to install and upgrade wordpress is via subversion):<br />
  340. <span class="code_tag">sudo aptitude -y install subversion</span></li>
  341. </ul>
  342. <span class="sub_heading">Install Postfix to prepare e-mail capabilities for your web application</span>
  343. <ul>
  344. <li>First - login into slicemanager at manage.slicehost.com, click &quot;DNS&quot; tab and &quot;Reverse DNS&quot;.<br />
  345. Replace record with: <code class="in_editor_tag">mail.mydomain.com.</code><br />
  346. </li>
  347. <li><span class="code_tag">sudo nano /etc/hostname</span> Replace <span class="in_editor_tag">slicename</span> with <span class="in_editor_tag">mail.mydomain.com</span><br />
  348. <br />
  349. </li>
  350. <li> <span class="code_tag">sudo nano /etc/hosts</span><br />
  351. Replace <span class="in_editor_tag">127.0.0.1 slicename</span> with <span class="in_editor_tag">127.0.0.1 mail.mydomain.com</span></li>
  352. <li>Reboot slice:<br />
  353. <span class="code_tag">sudo reboot</span></li>
  354. <li>When rebooted - check slice hostname (it must be mail.mydomain.com):<br />
  355. <span class="code_tag">hostname -f</span></li>
  356. <li>Install dns utils and check RDNS (by using your slice's IP address)<br />
  357. <span class="code_tag">sudo aptitude -y install dnsutils</span></li>
  358. <li>Check if RDNS propagated already:<br />
  359. <span class="code_tag">dig -x 123.45.6.78 <br />
  360. </span>If &quot;ANSWER SECTION&quot; still shows old name (or anytihng other than mail.mydomain.com) - you'll have to wait until propagation will finish before proceeding.</li>
  361. <li> <span class="code_tag">sudo aptitude -y install postfix telnet mailx</span>
  362. Select &quot;Internet Site&quot;, and then for &quot;System mail name:&quot; -&gt; &quot;mail.mydomain.com&quot;.</li>
  363. <li>Redirect all email destined to 'root' toward 'jsmith':<br />
  364. <span class="code_tag">sudo nano /etc/aliases</span>Append this line to the end of file:<br />
  365. <span class="in_editor_tag">root: jsmith</span><br />
  366. </li>
  367. <li>Refresh aliases database now:<br />
  368. <span class="code_tag">sudo newaliases<br />
  369. </span></li>
  370. <li>Edit main.cf file:<br />
  371. <span class="code_tag">sudo nano /etc/postfix/main.cf<br />
  372. </span>- Replace: <span class="in_editor_tag">myorigin = /etc/mailname </span><br />
  373. - with this: <span class="in_editor_tag">myorigin = $mydomain</span><br />
  374. <br />
  375. - Replace this: <span class="in_editor_tag">mydestination = mail.mydomain.com, localhost.mydomain.com, , localhost</span><br />
  376. - with this: <span class="in_editor_tag">mydestination = $mydomain, localhost.$mydomain, localhost</span><br />
  377. <br />
  378. - Replace this: <span class="in_editor_tag">mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128</span><br />
  379. - with this: <span class="in_editor_tag">mynetworks = 127.0.0.0/8</span><br />
  380. <br />
  381. </li>
  382. <li>Restart postfix to make changes take effect:<span class="code_tag"> sudo /etc/init.d/postfix restart</span></li>
  383. <li>Test email sending capabilities. Run little php console prog to do it. Check if you receive email message.<br />
  384. <span class="code_tag">php -a<br />
  385. mail ('your@email.com', &quot;Hello from slice!&quot;, &quot;My email setup works!&quot;);<br />
  386. exit ();</span></li>
  387. <li>Follow this article if you want to <a href="http://articles.slicehost.com/2008/8/1/postfix-mx-records-and-receiving-emails">setup postfix to receive emails</a> as well (opening port 25 in firewall and configuring stuff):<br />
  388. But what we've done already is enough to have hosted portal with full outgoing email capabilities.<br />
  389. </li>
  390. </ul>
  391. <span class="sub_heading">Install and configure NGINX</span><br />
  392. <ul><li>
  393. Install NGINX. Dependencies first. Check sysoev.ru website first for newer versions though.<br />
  394. <span class="code_tag">sudo aptitude -y install libpcre3 libpcre3-dev libpcrecpp0 libssl-dev zlib1g-dev<br />mkdir ~/sources<br />
  395. cd ~/sources/<br />
  396. wget http://sysoev.ru/nginx/nginx-0.6.32.tar.gz<br />
  397. tar -zxvf nginx-0.6.32.tar.gz<br />
  398. cd nginx-0.6.32<br />
  399. ./configure --sbin-path=/usr/local/sbin --with-http_ssl_module <br />
  400. make<br />
  401. sudo make install</span></li>
  402. </ul>
  403. <ul>
  404. <li>Start Nginx:<br />
  405. <span class="code_tag">sudo /usr/local/sbin/nginx</span></li>
  406. <li>Navigate to your slice's IP address to test that it works: http://123.45.6.78</li>
  407. <li>Stop Nginx:<br />
  408. <span class="code_tag">sudo kill `cat /usr/local/nginx/logs/nginx.pid`</span> </li>
  409. <li>Create NGINX init script<br />
  410. <span class="code_tag">sudo nano /etc/init.d/nginx</span> Copy/paste this text into it:<br />
  411. <pre>
  412. #! /bin/sh
  413. ### BEGIN INIT INFO
  414. # Provides: nginx
  415. # Required-Start: $all
  416. # Required-Stop: $all
  417. # Default-Start: 2 3 4 5
  418. # Default-Stop: 0 1 6
  419. # Short-Description: starts the nginx web server
  420. # Description: starts nginx using start-stop-daemon
  421. ### END INIT INFO
  422. PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
  423. DAEMON=/usr/local/sbin/nginx
  424. NAME=nginx
  425. DESC=nginx
  426. test -x $DAEMON || exit 0
  427. # Include nginx defaults if available
  428. if [ -f /etc/default/nginx ] ; then
  429. . /etc/default/nginx
  430. fi
  431. set -e
  432. case "$1" in
  433. start)
  434. echo -n "Starting $DESC: "
  435. start-stop-daemon --start --quiet --pidfile /usr/local/nginx/logs/$NAME.pid \
  436. --exec $DAEMON -- $DAEMON_OPTS
  437. echo "$NAME."
  438. ;;
  439. stop)
  440. echo -n "Stopping $DESC: "
  441. start-stop-daemon --stop --quiet --pidfile /usr/local/nginx/logs/$NAME.pid \
  442. --exec $DAEMON
  443. echo "$NAME."
  444. ;;
  445. restart|force-reload)
  446. echo -n "Restarting $DESC: "
  447. start-stop-daemon --stop --quiet --pidfile \
  448. /usr/local/nginx/logs/$NAME.pid --exec $DAEMON
  449. sleep 1
  450. start-stop-daemon --start --quiet --pidfile \
  451. /usr/local/nginx/logs/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS
  452. echo "$NAME."
  453. ;;
  454. reload)
  455. echo -n "Reloading $DESC configuration: "
  456. start-stop-daemon --stop --signal HUP --quiet --pidfile /usr/local/nginx/logs/$NAME.pid \
  457. --exec $DAEMON
  458. echo "$NAME."
  459. ;;
  460. *)
  461. N=/etc/init.d/$NAME
  462. echo "Usage: $N {start|stop|restart|reload|force-reload}" >&#038;2
  463. exit 1
  464. ;;
  465. esac
  466. exit 0
  467. </pre>
  468. </li>
  469. <li>Set it executable:<br />
  470. <span class="code_tag">sudo chmod +x /etc/init.d/nginx</span> </li>
  471. <li>Add it to the default run levels:<br />
  472. <span class="code_tag">sudo /usr/sbin/update-rc.d -f nginx defaults</span> </li>
  473. <li>Create folder layout:<br />
  474. <span class="code_tag">sudo mkdir /usr/local/nginx/sites-available
  475. <br />
  476. sudo mkdir /usr/local/nginx/sites-enabled</span> </li>
  477. <li>
  478. Adjust main NGINX configuration file to look in sites-enabled folder for vhosts:<span class="code_tag"> sudo nano /usr/local/nginx/conf/nginx.conf</span> Delete all contents of this file and replace it with this:<br />
  479. <pre>
  480. user www-data www-data;
  481. worker_processes 4;
  482. events {
  483. worker_connections 1024;
  484. }
  485. http {
  486. include mime.types;
  487. default_type application/octet-stream;
  488. sendfile on;
  489. tcp_nopush on;
  490. tcp_nodelay off;
  491. keepalive_timeout 5;
  492. gzip on;
  493. gzip_comp_level 2;
  494. gzip_proxied any;
  495. gzip_types text/plain text/html text/css application/x-javascript text/xml application/xml
  496. application/xml+rss text/javascript;
  497. include /usr/local/nginx/sites-enabled/*;
  498. }
  499. </pre>
  500. <br />
  501. </li>
  502. <li>Create default vhost in 'sites-available' folder:<br />
  503. <span class="code_tag">sudo nano /usr/local/nginx/sites-available/default</span>Copy/paste this text into it:<br />
  504. <pre>
  505. server {
  506. listen 80;
  507. server_name localhost;
  508. location / {
  509. root html;
  510. index index.php index.html index.htm;
  511. }
  512. # redirect server error pages to the static page /50x.html
  513. #
  514. error_page 500 502 503 504 /50x.html;
  515. location = /50x.html {
  516. root html;
  517. }
  518. }
  519. </pre>
  520. </li>
  521. <li>Enable vhost by creating symlink:<br />
  522. <span class="code_tag">sudo ln -s /usr/local/nginx/sites-available/mydomain.com /usr/local/nginx/sites-enabled/mydomain.com</span></li>
  523. <li>Start NGINX:<br />
  524. <span class="code_tag">sudo /etc/init.d/nginx start</span> Make sure that navigating to slice IP will show &quot;Welcome to nginx!&quot; default page.<br />
  525. <br />
  526. </li>
  527. <li>Create layouts for domains to be served.<br />
  528. <span class="code_tag">sudo mkdir /home/public_html<br />
  529. sudo mkdir -p /home/public_html/mydomain.com/{public,private,log,backup}</span></li>
  530. <li>Setup users and groups to manage portal:<br />
  531. <span class="code_tag">sudo -i<br />
  532. addgroup webmasters<br />
  533. usermod -G webmasters jsmith<br />
  534. </span>OPTIONAL: Do it for every user who will be allowed to manage files for the portal: <br />
  535. <span class="code_tag"> usermod -G webmasters user_2<br />
  536. usermod -G webmasters user_3<br />
  537. </span>Change ownership of main web files directory:<br />
  538. <span class="code_tag">chown -R jsmith.webmasters /home/public_html<br />
  539. chmod -R g+w /home/public_html<br />
  540. </span>Set group id to 'webmasters' for all newly created files and dirs.<br />
  541. <span class="code_tag">find /home/public_html -type d -exec chmod g+s {} \;<br />
  542. exit</span></li>
  543. <li>Create initial index.html file for the domain:<br />
  544. <span class="code_tag">sudo nano /home/public_html/mydomain.com/public/index.php</span>Paste this into the file:<br />
  545. <pre>&lt;?php echo phpinfo(); ?&gt; </pre>
  546. First - create supporting wordpress-specific configuration files. 'wordpress_params.regular' - is basic wordpress config file that allows support for nice permalinks.<br />
  547. <span class="code_tag">sudo nano /usr/local/nginx/conf/wordpress_params.regular</span>...And paste into it the following contents:<br />
  548. <pre> # WordPress pretty URLs: (as per dominiek.com)
  549. if (-f $request_filename) {
  550. break;
  551. }
  552. if (-d $request_filename) {
  553. break;
  554. }
  555. rewrite ^(.+)$ /index.php?q=$1 last;
  556. # Enable nice permalinks for WordPress: (as per Yawn.it)
  557. error_page 404 = //index.php?q=$uri;
  558. </pre>
  559. Save and exit.<br />
  560. Next - create second version of NGinx-specific WordPress config file that allows support for nice permalinks + <a href="http://wordpress.org/extend/plugins/wp-super-cache/">WP Super Cache plugin</a>. WP Super Caching gives you extra horse power and juice to handle intense traffic and getting your portal seriously ready to be DIGG-ed.<br />
  561. <span class="code_tag">sudo nano /usr/local/nginx/conf/wordpress_params.super_cache</span>...And paste into it the following contents <a href="http://forum.slicehost.com/comments.php?DiscussionID=2087&amp;page=1">(Credits: Matt Stevens</a>):<br /><pre>
  562. # if the requested file exists, return it immediately
  563. if (-f $request_filename) {
  564. break;
  565. }
  566. set $supercache_file '';
  567. set $supercache_uri $request_uri;
  568. if ($request_method = POST) {
  569. set $supercache_uri '';
  570. }
  571. # Using pretty permalinks, so bypass the cache for any query string
  572. if ($query_string) {
  573. set $supercache_uri '';
  574. }
  575. if ($http_cookie ~* "comment_author_|wordpress|wp-postpass_" ) {
  576. set $supercache_uri '';
  577. }
  578. # if we haven't bypassed the cache, specify our supercache file
  579. if ($supercache_uri ~ ^(.+)$) {
  580. set $supercache_file /wp-content/cache/supercache/$http_host/$1index.html;
  581. }
  582. # only rewrite to the supercache file if it actually exists
  583. if (-f $document_root$supercache_file) {
  584. rewrite ^(.*)$ $supercache_file break;
  585. }
  586. # all other requests go to WordPress
  587. if (!-e $request_filename) {
  588. rewrite . /index.php last;
  589. }
  590. </pre>
  591. Create vhost for domain mydomain.com:<br />
  592. <span class="code_tag">sudo nano /usr/local/nginx/sites-available/mydomain.com</span>...And paste into it the following contents:<br />
  593. <pre>server {
  594. listen 80;
  595. server_name mydomain.com;
  596. rewrite ^/(.*) http://www.mydomain.com/$1 permanent;
  597. }
  598. server {
  599. listen 80;
  600. server_name www.mydomain.com;
  601. access_log /home/public_html/mydomain.com/log/access.log;
  602. error_log /home/public_html/mydomain.com/log/error.log;
  603. location / {
  604. root /home/public_html/mydomain.com/public/;
  605. index index.php index.html;
  606. # Basic version of WordPress parameters, supporting nice permalinks.
  607. # include /usr/local/nginx/conf/wordpress_params.regular;
  608. # Advanced version of WordPress parameters supporting nice permalinks and WP Super Cache plugin
  609. include /usr/local/nginx/conf/wordpress_params.super_cache;
  610. }
  611. # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  612. #
  613. location ~ \.php$ {
  614. fastcgi_pass 127.0.0.1:9000;
  615. fastcgi_index index.php;
  616. include /usr/local/nginx/conf/fastcgi_params;
  617. fastcgi_param SCRIPT_FILENAME /home/public_html/mydomain.com/public/$fastcgi_script_name;
  618. }
  619. }
  620. </pre>
  621. Above will append 'www' to all non-www requests - all requests for http://mydomain.com/dir/page will be redirected to -&gt; http://www.mydomain.com/dir/page.<br />
  622. As you can also see above we enabled 'wordpress_params.super_cache' settings. If for some reason you'll have problems - you may comment ' ....wordpress_params.super_cache' line out, disable wordpress WP Super Cache plugin via WordPress admin panel and uncomment '...wordpress_params.regular' settings (+restart Nginx). From my own test - they both works with or without WP Super Cache enabled and I'd definitely prefer WP Super Cache to be up and running.</li>
  623. </ul>
  624. <ul>
  625. <li>Enable site:<br />
  626. <span class="code_tag">sudo ln -s /usr/local/nginx/sites-available/mydomain.com /usr/local/nginx/sites-enabled/mydomain.com</span><br />
  627. </li>
  628. <li>Making NGinx to serve PHP and make it all start automatically after system restart (<a href="http://blog.zhekov.net/2007/8/15/nginx-php-fastcgi/">Credits</a>):<br />
  629. <span class="code_tag">sudo aptitude -y install libfcgi0<br />
  630. cd /etc/default/ <br />
  631. sudo wget -O php-fastcgi http://www.mensk.com/uploads/php-fastcgi.txt <br />
  632. cd /etc/init.d/ <br />
  633. sudo wget -O php-fastcgi http://www.mensk.com/uploads/php-fastcgi.rc.txt <br />
  634. sudo chmod +x php-fastcgi <br />
  635. sudo /usr/sbin/update-rc.d -f php-fastcgi defaults <br />
  636. sudo /etc/init.d/php-fastcgi start</span> Restart NGINX:<br />
  637. <span class="code_tag">n2r</span> (or <strong>sudo /etc/init.d/nginx stop</strong>, <strong>sudo /etc/init.d/nginx start</strong>)<br />
  638. <br />
  639. </li>
  640. <li>Navigate to your website: http://mydomain.com you should be redirected to http://www.mydomain.com and then see phpinfo() screen...</li>
  641. <li>Reboot your slice and make sure that after restart everything still works (NGINX &amp; Co restarts properly)
  642. <br />
  643. <span class="code_tag">sudo reboot</span></li>
  644. </ul>
  645. <span class="sub_heading">Install and configure WordPress + configure WP Super Cache WordPress plugin to work with NGINX</span>
  646. <ul><li>Install WordPress. Login to mysql console as mysql's root user:
  647. <span class="code_tag">mysql -u root -p</span></li>
  648. <li>Issue this command to create new username for WordPress database (replace username, password and database name with your values):<br />
  649. <span class="code_tag">mysql&gt; grant all privileges on *.* to wp_user@localhost identified by &quot;wp_pa55w0rd&quot;;<br />
  650. mysql&gt; create database wp_dbase;<br />
  651. mysql&gt; quit</span></li>
  652. <li>Get WordPress files directly from SVN repository. See this <a href="http://codex.wordpress.org/Installing/Updating_WordPress_with_Subversion">great article about using subversion to install and update WordPress</a>.<br />
  653. <span class="code_tag">cd /home/public_html/mydomain.com/public<br />
  654. sudo rm index.php<br />
  655. svn co http://svn.automattic.com/wordpress/tags/2.6 .<br />
  656. mv wp-config-sample.php wp-config.php<br />
  657. sudo nano wp-config.php<br />
  658. </span>Set database name, DB user name and password, Change DB prefix to something different (good security measure), save and exit.<strong><code><br />
  659. <br />
  660. </code></strong></li>
  661. <li>Adjust permissions:<br /><span class="code_tag">sudo chmod -R 777 /home/public_html/mydomain.com/public/wp-content<br />
  662. sudo chmod 666 /home/public_html/mydomain.com/public/wp-config.php</span></li>
  663. <li>Access your site: http://www.mydomain.com/<br />
  664. - Enter blog name, remember the password that wordpress gave you.<br />
  665. - Login as admin/password<br />
  666. - Click Users tab at upper right in admin panel<br />
  667. - Click on 'admin' user<br />
  668. - Change password to something secure and you'd remember.<br />
  669. - Logoff, Logon again with your new password.<br />
  670. - Goto Settings-&gt;Permalinks<br />
  671. - Set (x) &quot;Custom Structure&quot; -&gt; <span class="in_editor_tag">/%category%/%postname%/</span>, [Save Changes], ignore WordPress warning: &quot;You should update your .htaccess now.&quot; - it cannot find .htaccess - we are not running apache. <br />
  672. - Access your blog's &quot;About&quot; page - and voila - it should work just fine as this: http://www.mydomain.com/about/ (instead of default ugly: http://www.mydomain.com/?p=123)</li>
  673. <li>Download and unzip <a href="http://wordpress.org/extend/plugins/wp-super-cache/">WP Super Cache plugin</a> into '<strong>/home/public_html/mydomain.com/public/wp-content/plugins</strong>' directory. Activate it via Admin panel.<br />
  674. For FTP-ing purposes I use FileZilla configured to use SFTP. (I don't elaborate on specifics of installing and activating WordPress plugins in this document).<br />
  675. - Goto Plugins, activate &quot;WP Super Cache&quot;.<br />
  676. - Goto Settings-&gt;WP Super Cache and set (x) WP Super Cache Status to &quot;ON&quot;. [Update Status]. <br />
  677. You'll see bunch of warnings on this page regarding &quot;mod rewrite&quot; rules and &quot;.htaccess&quot; file. Just ignore these - we are not using Apache so WP Super Cache cannot find apache specific places to write settings. We did it for WP Super Cache already inside of 'wordpress_params.super_cache' - which contains &quot;translation&quot; of caching rules from Apache to Nginx.<br />
  678. Your WP Super Cache-ed blog should be up and running now at fullest speed.</li>
  679. <li>Make 'wp-content' directory a bit more secure:<span class="code_tag"> sudo chmod -R 755 /home/public_html/mydomain.com/public/wp-content</span> - Goto Manage-&gt;Categories. Create few categories with subcategories.<br />
  680. - Goto Write-&gt;Post - create few posts and assign them to subcategory, publish, save.<br />
  681. - Access your posts - and see that they all have nice SEO-friendly URLs, thanks to custom wordpress-specific setups we included in our '<strong>/usr/local/nginx/sites-available/mydomain.com</strong>' file.<br />
  682. - This also works just fine with <a href="http://urbangiraffe.com/plugins/redirection/">John Godley's excellent redirection plugin</a> that supports flexible custom redirects with regular expressions.</li>
  683. <li>Customize your theme and go wild! </li>
  684. </ul>
  685. <span class="sub_heading">Done!</span>
  686. <ul><li>Enjoy your fresh shiny new WordPress blog, with nice SEO friendly permalinks enabled, ready to utilize powerful caching capabilities of <a href="http://wordpress.org/extend/plugins/wp-super-cache/">WP Super Cache plugin</a>, running under cutting edge <a href="http://nginx.net/">NGINX</a> web server, powered by top of the line <a href="http://www.ubuntu.com/getubuntu/download">Long Term Supported (up to 2013) Ubuntu 8.04 Hardy</a>, hosted by great <a href="http://www.slicehost.com/">VPS hosting team at SliceHost.com</a>!<br />
  687. <br />
  688. </li>
  689. </ul>
  690. </div><p><script type="text/javascript">SHARETHIS.addEntry({ title: "Perfect Setup: Ubuntu Hardy+Nginx+MySQL5+PHP5+Wordress", url: "http://www.mensk.com/webmaster-toolbox/perfect-ubuntu-hardy-nginx-mysql5-php5-wordpress/" });</script></p><div style="clear:both;"></div>
  691. <div class="postmeta">
  692. Filed Under: <a href="http://www.mensk.com/category/webmaster-toolbox/" title="View all posts in Webmaster Toolbox" rel="category tag">Webmaster Toolbox</a><br />Tagged: <a href="http://www.mensk.com/tag/enginex/" rel="tag">enginex</a>, <a href="http://www.mensk.com/tag/mysql/" rel="tag">mysql</a>, <a href="http://www.mensk.com/tag/nginx/" rel="tag">nginx</a>, <a href="http://www.mensk.com/tag/php/" rel="tag">php</a>, <a href="http://www.mensk.com/tag/prefect-setup/" rel="tag">prefect setup</a>, <a href="http://www.mensk.com/tag/slicehost/" rel="tag">slicehost</a>, <a href="http://www.mensk.com/tag/ubuntu/" rel="tag">ubuntu</a>, <a href="http://www.mensk.com/tag/ubuntu-hardy/" rel="tag">ubuntu hardy</a>, <a href="http://www.mensk.com/tag/wordpress/" rel="tag">Wordpress</a>, <a href="http://www.mensk.com/tag/wp-super-cache-plugin/" rel="tag">wp super cache plugin</a> </div>
  693. <!--
  694. <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  695. xmlns:dc="http://purl.org/dc/elements/1.1/"
  696. xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  697. <rdf:Description rdf:about="http://www.mensk.com/webmaster-toolbox/perfect-ubuntu-hardy-nginx-mysql5-php5-wordpress/"
  698. dc:identifier="http://www.mensk.com/webmaster-toolbox/perfect-ubuntu-hardy-nginx-mysql5-php5-wordpress/"
  699. dc:title="Perfect Setup: Ubuntu Hardy+Nginx+MySQL5+PHP5+Wordress"
  700. trackback:ping="http://www.mensk.com/webmaster-toolbox/perfect-ubuntu-hardy-nginx-mysql5-php5-wordpress/trackback/" />
  701. </rdf:RDF> -->
  702. </div>
  703. <div class="adsense-post">
  704. <!--To activate your Google AdSense ad, go to your WP dashboard and go to Presentation -> Revolution Tech Options and enter your Google Adsense Code.-->
  705. </div>
  706. <div class="comments">
  707. <h4>Comments</h4>
  708. <!-- You can start editing here. -->
  709. <div id="commentblock">
  710. <p id="comments"><b>61 Responses to &#8220;Perfect Setup: Ubuntu Hardy+Nginx+MySQL5+PHP5+Wordress&#8221;</b></p>
  711. <ol class="commentlist">
  712. <li class="alt" id="comment-181">
  713. Tony on
  714. August 14th, 2008 12:07 pm
  715. <div class="commenttext">
  716. <div style="float:left;margin:0px 10px 10px 0px;"><img alt='' src='http://0.gravatar.com/avatar/00c43a6cc4e581649c4e3292951c7871?s=60&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&amp;r=G' class='avatar avatar-60 photo' height='60' width='60' /></div><p>How does one go about setting up the iptables to allow postfix to work for email?</p>
  717. <div style="clear:both;"></div>
  718. </div>
  719. </li>
  720. <li class="" id="comment-182">
  721. admin on
  722. August 14th, 2008 12:16 pm
  723. <div class="commenttext">
  724. <div style="float:left;margin:0px 10px 10px 0px;"><img alt='' src='http://0.gravatar.com/avatar/e303dc75e98569e785d014f77453c23a?s=60&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&amp;r=G' class='avatar avatar-60 photo' height='60' width='60' /></div><p>Here&#8217;s the SliceHost&#8217;s article on exactly this subject:<br />
  725. <a href="http://articles.slicehost.com/2008/8/1/postfix-mx-records-and-receiving-emails" rel="nofollow">http://articles.slicehost.com/2008/8/1/postfix-mx-records-and-receiving-emails</a><br />
  726. I think I might add this info to this article as well eventually.</p>
  727. <p>Gleb</p>
  728. <div style="clear:both;"></div>
  729. </div>
  730. </li>
  731. <li class="alt" id="comment-183">
  732. Tony on
  733. August 14th, 2008 1:07 pm
  734. <div class="commenttext">
  735. <div style="float:left;margin:0px 10px 10px 0px;"><img alt='' src='http://0.gravatar.com/avatar/00c43a6cc4e581649c4e3292951c7871?s=60&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&amp;r=G' class='avatar avatar-60 photo' height='60' width='60' /></div><p>When you have this line:</p>
  736. <p>- Replace: myorigin = /etc/mailname<br />
  737. - with this: myorigin = $mydomain</p>
  738. <p>Do you actually mean replace it with the variable &#8220;$mydomain&#8221; or to actually put &#8220;$yahoo.com&#8221; or even just &#8220;yahoo.com&#8221; without the $ if my domain is yahoo.com</p>
  739. <div style="clear:both;"></div>
  740. </div>
  741. </li>
  742. <li class="" id="comment-184">
  743. admin on
  744. August 14th, 2008 1:46 pm
  745. <div class="commenttext">
  746. <div style="float:left;margin:0px 10px 10px 0px;"><img alt='' src='http://0.gravatar.com/avatar/e303dc75e98569e785d014f77453c23a?s=60&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&amp;r=G' class='avatar avatar-60 photo' height='60' width='60' /></div><p>Good question &#8211; actually in this case it has to be used as is, no substitution needed. Regardless of your actual domain &#8211; this text line will have &#8220;$mydomain&#8221;.<br />
  747. I guess i should of come up with more clear &#8220;generic&#8221; domain, like: &#8216;myhotsite.com&#8217; or something.</p>
  748. <p>Here is the source for these detailed postfix configurations:<br />
  749. <a href="http://articles.slicehost.com/2008/7/31/postfix-basic-settings-in-main-cf" rel="nofollow">http://articles.slicehost.com/2008/7/31/postfix-basic-settings-in-main-cf</a></p>
  750. <p>Gleb</p>
  751. <div style="clear:both;"></div>
  752. </div>
  753. </li>
  754. <li class="alt" id="comment-186">
  755. <a href='http://pvillega.wordpress.com/2008/08/16/slicehost/' rel='external nofollow' class='url'>SliceHost &laquo; So be IT</a> on
  756. August 16th, 2008 11:56 am
  757. <div class="commenttext">
  758. <div style="float:left;margin:0px 10px 10px 0px;"></div><p>[...] hecho, he encontrado este manual sobre como instalar WordPress (usando nginx, una versión ligera de Apache muy eficiente) en Slicehost, incluyendo los pasos para [...]</p>
  759. <div style="clear:both;"></div>
  760. </div>
  761. </li>
  762. <li class="" id="comment-188">
  763. <a href='http://scottmotte.com/archives/253' rel='external nofollow' class='url'>Scott Motte &raquo; Blog Archive &raquo; Slicehost, nginx, mysql, php, wordpress setup</a> on
  764. August 17th, 2008 1:52 pm
  765. <div class="commenttext">
  766. <div style="float:left;margin:0px 10px 10px 0px;"></div><p>[...] Detailed tutorial on nginx, mysql, php, wordpress setup. [...]</p>
  767. <div style="clear:both;"></div>
  768. </div>
  769. </li>
  770. <li class="alt" id="comment-189">
  771. windexh8er on
  772. August 23rd, 2008 1:52 pm
  773. <div class="commenttext">
  774. <div style="float:left;margin:0px 10px 10px 0px;"><img alt='' src='http://0.gravatar.com/avatar/6f839f6c6b435872ca40b76334e7a44a?s=60&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&amp;r=G' class='avatar avatar-60 photo' height='60' width='60' /></div><p>So&#8230; I&#8217;m confused. Why do you do this:</p>
  775. <p>sudo ln -s /usr/local/nginx/sites-available/mydomain.com /usr/local/nginx/sites-enabled/mydomain.com</p>
  776. <p>When you&#8217;re not linking to anything at this point? Since there&#8217;s nothing in /usr/local/nginx/sites-available at that point in time you just end up with a broken symlink?!?!</p>
  777. <p>Thx&#8230;</p>
  778. <div style="clear:both;"></div>
  779. </div>
  780. </li>
  781. <li class="" id="comment-190">
  782. admin on
  783. August 23rd, 2008 2:47 pm
  784. <div class="commenttext">
  785. <div style="float:left;margin:0px 10px 10px 0px;"><img alt='' src='http://0.gravatar.com/avatar/e303dc75e98569e785d014f77453c23a?s=60&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&amp;r=G' class='avatar avatar-60 photo' height='60' width='60' /></div><p>I guess I have 2 places where I do that &#8211; first one is not necessary &#8211; second is done after mydomain.com files are created. So I guess you&#8217;re right &#8211; first one could be eliminated&#8230;</p>
  786. <p>Gleb</p>
  787. <div style="clear:both;"></div>
  788. </div>
  789. </li>
  790. <li class="alt" id="comment-191">
  791. windexh8er on
  792. August 23rd, 2008 2:50 pm
  793. <div class="commenttext">
  794. <div style="float:left;margin:0px 10px 10px 0px;"><img alt='' src='http://0.gravatar.com/avatar/6f839f6c6b435872ca40b76334e7a44a?s=60&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&amp;r=G' class='avatar avatar-60 photo' height='60' width='60' /></div><p>Also, can you post the actual files for the FastCGI? The host that you are referencing in the doc is not valid anymore&#8230;</p>
  795. <p>Thanks!</p>
  796. <p>( i.e. <a href="http://zhware.net/files/nginx/" rel="nofollow">http://zhware.net/files/nginx/</a>* )</p>
  797. <div style="clear:both;"></div>
  798. </div>
  799. </li>
  800. <li class="" id="comment-192">
  801. admin on
  802. August 23rd, 2008 3:01 pm
  803. <div class="commenttext">
  804. <div style="float:left;margin:0px 10px 10px 0px;"><img alt='' src='http://0.gravatar.com/avatar/e303dc75e98569e785d014f77453c23a?s=60&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&amp;r=G' class='avatar avatar-60 photo' height='60' width='60' /></div><p>&#8230;that&#8217;s why I never liked referring to too many other sites. It&#8217;s prone to get broken. I love having everything in one place.<br />
  805. Thanks for catch &#8211; fixed &#8211; files now at mensk.com &#8211; reload the page and check for new urls:<br />
  806. <a href="http://www.mensk.com/uploads/php-fastcgi.rc.txt" rel="nofollow">http://www.mensk.com/uploads/php-fastcgi.rc.txt</a><br />
  807. <a href="http://www.mensk.com/uploads/php-fastcgi.txt" rel="nofollow">http://www.mensk.com/uploads/php-fastcgi.txt</a></p>
  808. <p>Gleb</p>
  809. <div style="clear:both;"></div>
  810. </div>
  811. </li>
  812. <li class="alt" id="comment-193">
  813. windexh8er on
  814. August 23rd, 2008 4:12 pm
  815. <div class="commenttext">
  816. <div style="float:left;margin:0px 10px 10px 0px;"><img alt='' src='http://0.gravatar.com/avatar/6f839f6c6b435872ca40b76334e7a44a?s=60&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&amp;r=G' class='avatar avatar-60 photo' height='60' width='60' /></div><p>Thanks for the fast update! <img src='http://www.mensk.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
  817. <p>Another question for you&#8230; I thought it might be due to because of the locale stuff at the beginning, because I&#8217;ve never seen this before, but whenever I paste anything into vi / nano during following the instructions a quote (&#8220;) will appear as ( ?~@~\ ) in VI and as something else in nano. Very odd.. Even if I create the file locally on my Mac in something like TextMate (file encoding is UTF8 and LF for line endings) and SCP it over&#8230; I have never seen that and have no idea why it would be doing it.</p>
  818. <p>I&#8217;m using SliceHost as well with the 8.04.1 fresh build.</p>
  819. <p>Thoughts?<br />
  820. TIA!<br />
  821. &#8211;windexh8er</p>
  822. <div style="clear:both;"></div>
  823. </div>
  824. </li>
  825. <li class="" id="comment-194">
  826. windexh8er on
  827. August 23rd, 2008 5:12 pm
  828. <div class="commenttext">
  829. <div style="float:left;margin:0px 10px 10px 0px;"><img alt='' src='http://0.gravatar.com/avatar/6f839f6c6b435872ca40b76334e7a44a?s=60&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&amp;r=G' class='avatar avatar-60 photo' height='60' width='60' /></div><p>And one more thing you might want to update to the 2.6.1 trunk since it&#8217;s stable:</p>
  830. <p><a href="http://svn.automattic.com/wordpress/tags/2.6.1/" rel="nofollow">http://svn.automattic.com/wordpress/tags/2.6.1/</a></p>
  831. <div style="clear:both;"></div>
  832. </div>
  833. </li>
  834. <li class="alt" id="comment-195">
  835. Bob on
  836. August 25th, 2008 1:15 am
  837. <div class="commenttext">
  838. <div style="float:left;margin:0px 10px 10px 0px;"><img alt='' src='http://1.gravatar.com/avatar/bc5c10e8de6542756691d52ef47e0616?s=60&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&amp;r=G' class='avatar avatar-60 photo' height='60' width='60' /></div><p>Mersi boku. Good idea. I&#8217;ll become <a href="http://bride-makeup.ru" rel="nofollow"></a>your regular visitor and RSS subscriber.</p>
  839. <div style="clear:both;"></div>
  840. </div>
  841. </li>
  842. <li class="" id="comment-196">
  843. <a href='http://commandlineidiot.com' rel='external nofollow' class='url'>clidiot</a> on
  844. August 25th, 2008 3:50 am
  845. <div class="commenttext">
  846. <div style="float:left;margin:0px 10px 10px 0px;"><img alt='' src='http://1.gravatar.com/avatar/3d58c74e0d03f11079311d02dd0a77ef?s=60&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&amp;r=G' class='avatar avatar-60 photo' height='60' width='60' /></div><p>Thank you for putting this together. When I get a few hours to try it out, I&#8217;m going to grab a new 256 slice and give it a shot.</p>
  847. <div style="clear:both;"></div>
  848. </div>
  849. </li>
  850. <li class="alt" id="comment-198">
  851. <a href='http://php-cgikeepsdying' rel='external nofollow' class='url'>boni</a> on
  852. September 2nd, 2008 2:27 am
  853. <div class="commenttext">
  854. <div style="float:left;margin:0px 10px 10px 0px;"><img alt='' src='http://1.gravatar.com/avatar/d9c4b3a094b6b02ef5735272b2c404f4?s=60&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&amp;r=G' class='avatar avatar-60 photo' height='60' width='60' /></div><p>Hi,<br />
  855. Great tutorial. Followed your instruction and everythings worked fine for line 20 minutes and then php-cgi died. Tried reboot, but no success and when I restart it on the command line, still nginx does not pick it up. The only way am able to run it is more like in a debug mode. First kill all the php-cgi and then run</p>
  856. <p><b> /usr/bin/php-cgi -q -b localhost:9000 </b><b></p>
  857. <p>on the consoles. The site comes up, but again dies traffic start building up? </p>
  858. <p>What could I have missed?</p>
  859. <p>Thanks</b></p>
  860. <div style="clear:both;"></div>
  861. </div>
  862. </li>
  863. <li class="" id="comment-199">
  864. boni on
  865. September 2nd, 2008 5:41 am
  866. <div class="commenttext">
  867. <div style="float:left;margin:0px 10px 10px 0px;"><img alt='' src='http://1.gravatar.com/avatar/d9c4b3a094b6b02ef5735272b2c404f4?s=60&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&amp;r=G' class='avatar avatar-60 photo' height='60' width='60' /></div><p>Hi again,</p>
  868. <p>Finally solved my problem. The problem pointed <a href="http://www.mensk.com/uploads/php-fastcgi.rc.txt." rel="nofollow">http://www.mensk.com/uploads/php-fastcgi.rc.txt.</a>. Right at the end there is a <b>:</b> after last esac. I think this was causing the script not to execute properly. Removed it and now everything works fine. This could explain why my site would be up after manual start of php-cgi and then die. My theory is that php-cgi would shut down when there are no requests and then when a request comes it would try to be started using the script but fail. That is what I suspected happened. Hope that helps somebody. Great thanks to the guys in slicehost chat rooms who helped me walk through all these scripts. Its nice that you get real tech people there who can help when it really matters</p>
  869. <div style="clear:both;"></div>
  870. </div>
  871. </li>
  872. <li class="alt" id="comment-200">
  873. revelnick on
  874. September 3rd, 2008 2:59 pm
  875. <div class="commenttext">
  876. <div style="float:left;margin:0px 10px 10px 0px;"><img alt='' src='http://1.gravatar.com/avatar/55b802a238052bb3bb8561f7880908f0?s=60&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&amp;r=G' class='avatar avatar-60 photo' height='60' width='60' /></div><p>good tutorial, its like having a lot of great tutorials on a single page.</p>
  877. <p>where you have this {<br />
  878. Enable vhost by creating symlink:<br />
  879. sudo ln -s /usr/local/nginx/sites-available/mydomain.com /usr/local/nginx/sites-enabled/mydomain.com<br />
  880. }</p>
  881. <p>it should probably be {<br />
  882. Enable vhost by creating symlink:<br />
  883. sudo ln -s /usr/local/nginx/sites-available/default /usr/local/nginx/sites-enabled/default<br />
  884. }</p>
  885. <p>Then in the next step when you restart nginx, it will use the default configuration created in the previous step.</p>
  886. <p>@windexh8er &#8211; that&#8217;s the source of confusion</p>
  887. <div style="clear:both;"></div>
  888. </div>
  889. </li>
  890. <li class="" id="comment-206">
  891. windexh8er on
  892. September 9th, 2008 11:16 am
  893. <div class="commenttext">
  894. <div style="float:left;margin:0px 10px 10px 0px;"><img alt='' src='http://0.gravatar.com/avatar/6f839f6c6b435872ca40b76334e7a44a?s=60&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&amp;r=G' class='avatar avatar-60 photo' height='60' width='60' /></div><p>@revelnick &#8212; yeah, it just didn&#8217;t make any sense to me at the time because I didn&#8217;t go further down in the instructions.</p>
  895. <p>@admin &#8212; another question for you. With this setup if you enable:</p>
  896. <p>define(&#8216;FORCE_SSL_ADMIN&#8217;, true);</p>
  897. <p>&#8230;and then try to go to the wp-admin page you end up with an endless loop. Any thoughts on why this is? I tried a variety of changes to nginx to no avail. <img src='http://www.mensk.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
  898. <div style="clear:both;"></div>
  899. </div>
  900. </li>
  901. <li class="alt" id="comment-220">
  902. friebly on
  903. September 23rd, 2008 6:52 pm
  904. <div class="commenttext">
  905. <div style="float:left;margin:0px 10px 10px 0px;"><img alt='' src='http://0.gravatar.com/avatar/0add133c04b35d42249bda7f935fd0b2?s=60&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&amp;r=G' class='avatar avatar-60 photo' height='60' width='60' /></div><p>Could you use a similar method to install WordPress MU?</p>
  906. <div style="clear:both;"></div>
  907. </div>
  908. </li>
  909. <li class="" id="comment-222">
  910. admin on
  911. September 24th, 2008 1:01 am
  912. <div class="commenttext">
  913. <div style="float:left;margin:0px 10px 10px 0px;"><img alt='' src='http://0.gravatar.com/avatar/e303dc75e98569e785d014f77453c23a?s=60&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&amp;r=G' class='avatar avatar-60 photo' height='60' width='60' /></div><p>Not sure about MU. The main &#8220;issue&#8221; with using NGinx + WordPress in general is that some plugins that use redirection, rewriting or otherwise based on Apache functionality will stop working. This is something to consider before migrating business to Nginx-based setup.</p>
  914. <p>Gleb</p>
  915. <div style="clear:both;"></div>
  916. </div>
  917. </li>
  918. <li class="alt" id="comment-223">
  919. friebly on
  920. September 24th, 2008 1:59 pm
  921. <div class="commenttext">
  922. <div style="float:left;margin:0px 10px 10px 0px;"><img alt='' src='http://0.gravatar.com/avatar/0add133c04b35d42249bda7f935fd0b2?s=60&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&amp;r=G' class='avatar avatar-60 photo' height='60' width='60' /></div><p>I found a tutorial here <a href="http://wpmu.org/nginx-wordpress-26/" rel="nofollow">http://wpmu.org/nginx-wordpress-26/</a> that has a different nginx.conf file. Would I use it together with yours, or do you think I would put that into my websites vhost? It looks closer to what you said to put into the vhost but it says to put it in the nginx.conf.</p>
  923. <div style="clear:both;"></div>
  924. </div>
  925. </li>
  926. <li class="" id="comment-235">
  927. <a href='http://builder2.blogger.ph/2008/10/17/slicehost-vps-hosting/' rel='external nofollow' class='url'>builder2 &raquo; Slicehost VPS Hosting</a> on
  928. October 16th, 2008 1:39 pm
  929. <div class="commenttext">
  930. <div style="float:left;margin:0px 10px 10px 0px;"></div><p>[...] got my VPS running in just a few hours or so by using this excellent guide from MENSK Technologies Corporation, it was good enough for my needs with just the bare essentials: PHP, MySQL, Nginx. Yes, I opted to [...]</p>
  931. <div style="clear:both;"></div>
  932. </div>
  933. </li>
  934. <li class="alt" id="comment-237">
  935. <a href='http://www.motionstandingstill.com' rel='external nofollow' class='url'>Nahum Wild</a> on
  936. October 22nd, 2008 6:39 pm
  937. <div class="commenttext">
  938. <div style="float:left;margin:0px 10px 10px 0px;"><img alt='' src='http://1.gravatar.com/avatar/3b4f7d102f17b40c186134f8ae09d33e?s=60&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&amp;r=G' class='avatar avatar-60 photo' height='60' width='60' /></div><p>Great post thanks, saved me heaps of time. One thing I did different was update the ngnix site conf to add expire headers to static assets, like what they are doing at the site that friebly has posted about &#8211; but I didn&#8217;t see that until just now!</p>
  939. <p>I&#8217;ve posted the whole conf to my blog &#8211; <a href="http://www.motionstandingstill.com" rel="nofollow">http://www.motionstandingstill.com</a>, but all I really did was add the following location section and made sure that the &#8216;root&#8217; clause specified before this. </p>
  940. <p> location ~* i.+\.(css|js|jpg|jpeg|gif|png)$<br />
  941. {<br />
  942. expires 7d;<br />
  943. }</p>
  944. <div style="clear:both;"></div>
  945. </div>
  946. </li>
  947. <li class="" id="comment-238">
  948. <a href='http://www.dedman.com.au' rel='external nofollow' class='url'>Andrew Dedman</a> on
  949. October 23rd, 2008 7:54 am
  950. <div class="commenttext">
  951. <div style="float:left;margin:0px 10px 10px 0px;"><img alt='' src='http://0.gravatar.com/avatar/a78194e21a34bc12594c8dab7703a979?s=60&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&amp;r=G' class='avatar avatar-60 photo' height='60' width='60' /></div><p>Thanks very much, worked perfectly : )</p>
  952. <div style="clear:both;"></div>
  953. </div>
  954. </li>
  955. <li class="alt" id="comment-242">
  956. <a href='http://commandlineidiot.com' rel='external nofollow' class='url'>clidiot</a> on
  957. November 2nd, 2008 9:59 pm
  958. <div class="commenttext">
  959. <div style="float:left;margin:0px 10px 10px 0px;"><img alt='' src='http://1.gravatar.com/avatar/3d58c74e0d03f11079311d02dd0a77ef?s=60&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&amp;r=G' class='avatar avatar-60 photo' height='60' width='60' /></div><p>PHEW!</p>
  960. <p>After hours and hours of running this around and around, I tracked down a problem that was driving me insane. The config file posted has a redirect to add the www to every incoming request. My existing blog database, however, has the blog home URL listed without the www. When I got everything up and running, every incoming request would head into an infinite redirect loop between domain.com and <a href="http://www.domain.com" rel="nofollow">http://www.domain.com</a>.</p>
  961. <p>Thank you for dropping this all together in one place. Very useful.</p>
  962. <div style="clear:both;"></div>
  963. </div>
  964. </li>
  965. <li class="" id="comment-245">
  966. grradmin on
  967. November 5th, 2008 4:02 pm
  968. <div class="commenttext">
  969. <div style="float:left;margin:0px 10px 10px 0px;"><img alt='' src='http://0.gravatar.com/avatar/a2267fee2c13bf78ab1da540f5b52048?s=60&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&amp;r=G' class='avatar avatar-60 photo' height='60' width='60' /></div><p>I&#8217;m having possibly the same issue as clidiot above me was talking about. Everything is fine as long as I have Apache + WordPress on the same slice. But as soon as I use the config on this page and through nginx into the mix it results in a redirect loop. Firefox says &#8220;Redirect Loop &#8211; Firefox has detected that the server is redirecting the request for this address in a way that will never complete&#8221;. I don&#8217;t use <a href="http://www.domain.com" rel="nofollow">http://www.domain.com</a> as my blog&#8217;s URL, it is <a href="http://domain.com" rel="nofollow">http://domain.com</a> instead. I&#8217;ve gone through the redirect rules and I don&#8217;t see where it&#8217;s adding that www. though <img src='http://www.mensk.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
  970. <div style="clear:both;"></div>
  971. </div>
  972. </li>
  973. <li class="alt" id="comment-254">
  974. <a href='http://philwilson.org/blog/2008/11/mai-blog-it-is-back' rel='external nofollow' class='url'>philwilson.org &raquo; Blog Archive &raquo; Mai blog! It is back!</a> on
  975. November 18th, 2008 6:49 pm
  976. <div class="commenttext">
  977. <div style="float:left;margin:0px 10px 10px 0px;"></div><p>[...] being served from Apache+mod_php to Nginx+fastcgi (in particular I followed these instructions: Perfect Setup: Ubuntu Hardy+Nginx+MySQL5+PHP5+Wordress). I learnt a few things, although I&#8217;m sure most lessons will become apparent over the coming [...]</p>
  978. <div style="clear:both;"></div>
  979. </div>
  980. </li>
  981. <li class="" id="comment-262">
  982. <a href='http://www.railsgeek.com' rel='external nofollow' class='url'>Mikhailov Anatoly</a> on
  983. December 6th, 2008 12:28 pm
  984. <div class="commenttext">
  985. <div style="float:left;margin:0px 10px 10px 0px;"><img alt='' src='http://0.gravatar.com/avatar/cffe91a6cc6e6ce8213ed575821dadf7?s=60&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&amp;r=G' class='avatar avatar-60 photo' height='60' width='60' /></div><p>It&#8217;s wonderful article.! Great Thanks</p>
  986. <div style="clear:both;"></div>
  987. </div>
  988. </li>
  989. <li class="alt" id="comment-295">
  990. <a href='http://paulmwatson.wordpress.com/2009/01/16/handy-guide-for-getting-php-working-unde/' rel='external nofollow' class='url'>Handy guide for getting PHP working unde &#8230; &laquo; Paul M. Watson</a> on
  991. January 16th, 2009 3:38 pm
  992. <div class="commenttext">
  993. <div style="float:left;margin:0px 10px 10px 0px;"></div><p>[...] pm on January 16, 2009 | # | Tags: dev Handy guide for getting PHP working under NGINX. Needed this page though to get the fastcgi_params file. [...]</p>
  994. <div style="clear:both;"></div>
  995. </div>
  996. </li>
  997. <li class="" id="comment-296">
  998. <a href='http://www.thinknext.net/archives/2345' rel='external nofollow' class='url'>SliceHost 迁移完毕 &laquo; 刀枪Blue</a> on
  999. January 17th, 2009 5:07 am
  1000. <div class="commenttext">
  1001. <div style="float:left;margin:0px 10px 10px 0px;"></div><p>[...] 经历了点波折,不过总算完成。绝大部分 setup 可以参考 Ubuntu Hardy+Nginx+MySQL5+PHP5+Wordress。 [...]</p>
  1002. <div style="clear:both;"></div>
  1003. </div>
  1004. </li>
  1005. <li class="alt" id="comment-304">
  1006. <a href='http://agan.net' rel='external nofollow' class='url'>John Agan</a> on
  1007. January 30th, 2009 11:32 pm
  1008. <div class="commenttext">
  1009. <div style="float:left;margin:0px 10px 10px 0px;"><img alt='' src='http://0.gravatar.com/avatar/6324730e2b2736a8358731ab936743d8?s=60&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&amp;r=G' class='avatar avatar-60 photo' height='60' width='60' /></div><p>I love you man!!</p>
  1010. <p>Thank you so much for this!</p>
  1011. <div style="clear:both;"></div>
  1012. </div>
  1013. </li>
  1014. <li class="" id="comment-306">
  1015. Chris on
  1016. February 3rd, 2009 9:14 pm
  1017. <div class="commenttext">
  1018. <div style="float:left;margin:0px 10px 10px 0px;"><img alt='' src='http://1.gravatar.com/avatar/97c17d2586ffc4e174040f451d1b5101?s=60&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&amp;r=G' class='avatar avatar-60 photo' height='60' width='60' /></div><p>THANKS!!!!!!!</p>
  1019. <p>Although for some reason I couldn&#8217;t get the same configuration to work with php-fpm, and for the life of me didn&#8217;t know why. This works just as well though so am stoked. Thanks for taking the time to document it all.</p>
  1020. <div style="clear:both;"></div>
  1021. </div>
  1022. </li>
  1023. <li class="alt" id="comment-307">
  1024. Chris on
  1025. February 3rd, 2009 11:17 pm
  1026. <div class="commenttext">
  1027. <div style="float:left;margin:0px 10px 10px 0px;"><img alt='' src='http://1.gravatar.com/avatar/97c17d2586ffc4e174040f451d1b5101?s=60&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&amp;r=G' class='avatar avatar-60 photo' height='60' width='60' /></div><p>You could also add xcache to speed things up even more:</p>
  1028. <p>cd ~/sources<br />
  1029. wget <a href="http://xcache.lighttpd.net/pub/Releases/1.2.2/xcache-1.2.2.tar.gz" rel="nofollow">http://xcache.lighttpd.net/pub/Releases/1.2.2/xcache-1.2.2.tar.gz</a><br />
  1030. tar xzvf xcache-1.2.2.tar.gz<br />
  1031. cd xcache-1.2.2<br />
  1032. phpize<br />
  1033. ./configure –with-php-config=/usr/local/bin/php-config –enable-xcache<br />
  1034. make install</p>
  1035. <p>sudo nano /etc/php5/cgi/php.ini</p>
  1036. <p>Add line </p>
  1037. <p>extension=xcache.so</p>
  1038. <p>to the end of the file.</p>
  1039. <p>You can also edit /etc/php5/cli/php.ini as well.</p>
  1040. <div style="clear:both;"></div>
  1041. </div>
  1042. </li>
  1043. <li class="" id="comment-308">
  1044. Chris on
  1045. February 3rd, 2009 11:32 pm
  1046. <div class="commenttext">
  1047. <div style="float:left;margin:0px 10px 10px 0px;"><img alt='' src='http://1.gravatar.com/avatar/97c17d2586ffc4e174040f451d1b5101?s=60&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&amp;r=G' class='avatar avatar-60 photo' height='60' width='60' /></div><p>Last comment &#8211; </p>
  1048. <p>php.ini edits possibly more like this:</p>
  1049. <p>[xcache-common]<br />
  1050. zend_extension = /usr/lib/php5/20060613+lfs/xcache.so<br />
  1051. [xcache]<br />
  1052. xcache.shm_scheme = &#8220;mmap&#8221;<br />
  1053. xcache.size = 64M</p>
  1054. <p>The directory to xcache.so is output when you run make install above.</p>
  1055. <p>You can check it is running using phpinfo() in a script or &#8220;php -v&#8221; from command line (you need to edit the cli php.ini also) if you run php -v you should see:</p>
  1056. <p>Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies<br />
  1057. with XCache v1.2.2, Copyright (c) 2005-2007, by mOo</p>
  1058. <div style="clear:both;"></div>
  1059. </div>
  1060. </li>
  1061. <li class="alt" id="comment-309">
  1062. <a href='http://www.agan.net/uncategorized/setting-up-the-blog-on-slicehost/' rel='external nofollow' class='url'>Setting Up The Blog On SliceHost | Agan</a> on
  1063. February 3rd, 2009 11:43 pm
  1064. <div class="commenttext">
  1065. <div style="float:left;margin:0px 10px 10px 0px;"></div><p>[...] so you can setup anything you want. Me personally, I needed a WordPress / Rails slice. I found this article by MENSK Technologies a very useful starting [...]</p>
  1066. <div style="clear:both;"></div>
  1067. </div>
  1068. </li>
  1069. <li class="" id="comment-311">
  1070. <a href='http://happybelly.me/uncategorized/wordpress-nginx-xcache-php5-mysql-on-ubuntu-hardy-804lts' rel='external nofollow' class='url'>Wordpress / NGINX / XCACHE / PHP5 / MYSQL on Ubuntu Hardy 8.04LTS - happybelly</a> on
  1071. February 5th, 2009 2:28 am
  1072. <div class="commenttext">
  1073. <div style="float:left;margin:0px 10px 10px 0px;"></div><p>[...] Great documentation for nginx setup suitable for small VPS. See my comments at bottom to add xcache as well. Added by happybelly, on February 3, 2009.Sections: Uncategorized. Post a comment or leave a trackback: Trackback URL. &laquo; NGINX + PHP-FPM + XCACHE on Ubuntu 8.04 LTS [...]</p>
  1074. <div style="clear:both;"></div>
  1075. </div>
  1076. </li>
  1077. <li class="alt" id="comment-312">
  1078. <a href='http://nielsvz.com/2009/02/nginx-awesomeness/' rel='external nofollow' class='url'>Nielsvz.com &raquo; Blog Archive &raquo; Nginx awesomeness</a> on
  1079. February 5th, 2009 7:17 am
  1080. <div class="commenttext">
  1081. <div style="float:left;margin:0px 10px 10px 0px;"></div><p>[...] Perfect Setup: Ubuntu Hardy+Nginx+MySQL5+Wordpress [...]</p>
  1082. <div style="clear:both;"></div>
  1083. </div>
  1084. </li>
  1085. <li class="" id="comment-319">
  1086. <a href='http://the.spacewaster.net' rel='external nofollow' class='url'>Gunnar</a> on
  1087. February 21st, 2009 1:17 pm
  1088. <div class="commenttext">
  1089. <div style="float:left;margin:0px 10px 10px 0px;"><img alt='' src='http://0.gravatar.com/avatar/ca52e48e0878968b6bbf1ccc64a5e88b?s=60&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&amp;r=G' class='avatar avatar-60 photo' height='60' width='60' /></div><p>Btw, if you just want to use postfix to send mail from PHP, there&#8217;s no need to install it, just use gmail <img src='http://www.mensk.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
  1090. <div style="clear:both;"></div>
  1091. </div>
  1092. </li>
  1093. <li class="alt" id="comment-320">
  1094. <a href='http://blog.abstrakce.com/uncategorized/setting-up-wordpress-on-slicehost/' rel='external nofollow' class='url'>Setting up Wordpress on Slicehost | Abstrakce</a> on
  1095. February 23rd, 2009 3:44 pm
  1096. <div class="commenttext">
  1097. <div style="float:left;margin:0px 10px 10px 0px;"></div><p>[...] And I would not have succeded without this extremely helpful article : <a href="http://www.mensk.com/webmaster-toolbox/perfect-ubuntu-hardy-nginx-mysql5-php5-wordpress/" rel="nofollow">http://www.mensk.com/webmaster-toolbox/perfect-ubuntu-hardy-nginx-mysql5-php5-wordpress/</a> [...]</p>
  1098. <div style="clear:both;"></div>
  1099. </div>
  1100. </li>
  1101. <li class="" id="comment-322">
  1102. <a href='http://marcrue.com' rel='external nofollow' class='url'>MarcRue</a> on
  1103. February 25th, 2009 11:28 am
  1104. <div class="commenttext">
  1105. <div style="float:left;margin:0px 10px 10px 0px;"><img alt='' src='http://0.gravatar.com/avatar/8090392a6b09ee1600658f49b43ca295?s=60&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&amp;r=G' class='avatar avatar-60 photo' height='60' width='60' /></div><p>I&#8217;m curious about how many connections or petitions/second can handle your setup in slicehost, did anyone try how well it performances?</p>
  1106. <div style="clear:both;"></div>
  1107. </div>
  1108. </li>
  1109. <li class="alt" id="comment-323">
  1110. <a href='http://guvnr.com' rel='external nofollow' class='url'>the_guv</a> on
  1111. March 11th, 2009 7:41 pm
  1112. <div class="commenttext">
  1113. <div style="float:left;margin:0px 10px 10px 0px;"><img alt='' src='http://0.gravatar.com/avatar/af2e1bf2e01a2006ba79706ebf7d80cb?s=60&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&amp;r=G' class='avatar avatar-60 photo' height='60' width='60' /></div><p>@MarcRue &#8211; &#8220;50,000 simultaneous connections have been reported,&#8221; according to the nginx wiki, <a href="http://wiki.codemongers.com/NginxGettingStarted" rel="nofollow">http://wiki.codemongers.com/NginxGettingStarted</a>.</p>
  1114. <p>Admin &#8211; why hide behind a title? You&#8217;re a ruddy hero! And a big cheers to PickedOnion too, John, Matt, the blessed Russian and everyone who made my week so much fun doing this.</p>
  1115. <p>Wow &#8211; can&#8217;t wait to get off the shared host&#8230;just the email to go&#8230;</p>
  1116. <div style="clear:both;"></div>
  1117. </div>
  1118. </li>
  1119. <li class="" id="comment-326">
  1120. Cal on
  1121. March 21st, 2009 11:00 am
  1122. <div class="commenttext">
  1123. <div style="float:left;margin:0px 10px 10px 0px;"><img alt='' src='http://0.gravatar.com/avatar/c71c09633e07acb63cfbbcf72117d749?s=60&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&amp;r=G' class='avatar avatar-60 photo' height='60' width='60' /></div><p>amazing!!<br />
  1124. thanks for this intro!! i would never every have figured out how to do this by myself!&#8221;!</p>
  1125. <div style="clear:both;"></div>
  1126. </div>
  1127. </li>
  1128. <li class="alt" id="comment-327">
  1129. <a href='http://sonnygill.net' rel='external nofollow' class='url'>Sonny</a> on
  1130. March 23rd, 2009 10:10 am
  1131. <div class="commenttext">
  1132. <div style="float:left;margin:0px 10px 10px 0px;"><img alt='' src='http://0.gravatar.com/avatar/040fb172b3f13cfa310fc5989f301c51?s=60&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&amp;r=G' class='avatar avatar-60 photo' height='60' width='60' /></div><p>When you do -</p>
  1133. <p>sudo ln -s /usr/local/nginx/sites-available/mydomain.com /usr/local/nginx/sites-enabled/mydomain.com</p>
  1134. <p>the first time, did you instead mean to create a symlink to /usr/local/nginx/sites-available/default ?</p>
  1135. <p>Because, otherwise navigating to the slice IP after that point results in a connection refused error.</p>
  1136. <p>I can&#8217;t thank you enough for writing this guide. It made my day. Getting the Nginx up and running the very first time was a beautiful feeling <img src='http://www.mensk.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
  1137. <p>Cheers.</p>
  1138. <div style="clear:both;"></div>
  1139. </div>
  1140. </li>
  1141. <li class="" id="comment-330">
  1142. <a href='http://erlanged.com/?p=45' rel='external nofollow' class='url'>Wordpress @ Slicehost - Sudarshan Acharya</a> on
  1143. March 25th, 2009 11:47 pm
  1144. <div class="commenttext">
  1145. <div style="float:left;margin:0px 10px 10px 0px;"></div><p>[...] get it up and running in about an hour with all the content migrated. When there are documents like Mensk.com and Slicehost Articles, you really don&#8217;t have anything left to [...]</p>
  1146. <div style="clear:both;"></div>
  1147. </div>
  1148. </li>
  1149. <li class="alt" id="comment-331">
  1150. <a href='http://builder2.blogger.ph/2009/03/27/linux-tips/' rel='external nofollow' class='url'>Linux tips | builder2</a> on
  1151. March 26th, 2009 12:49 pm
  1152. <div class="commenttext">
  1153. <div style="float:left;margin:0px 10px 10px 0px;"></div><p>[...] Perfect Setup: Ubuntu Hardy+Nginx+MySQL5+PHP5+WordPress [...]</p>
  1154. <div style="clear:both;"></div>
  1155. </div>
  1156. </li>
  1157. <li class="" id="comment-337">
  1158. <a href='http://devezine.com/perfect-setup-ubuntu-hardynginxmysql5php5wordress-mensk-technologies-corporation/' rel='external nofollow' class='url'>Perfect Setup: Ubuntu Hardy+Nginx+MySQL5+PHP5+Wordress | MENSK Technologies Corporation</a> on
  1159. April 28th, 2009 9:25 am
  1160. <div class="commenttext">
  1161. <div style="float:left;margin:0px 10px 10px 0px;"></div><p>[...] More: Perfect Setup: Ubuntu Hardy+Nginx+MySQL5+PHP5+Wordress | MENSK Technologies Corporation [...]</p>
  1162. <div style="clear:both;"></div>
  1163. </div>
  1164. </li>
  1165. <li class="alt" id="comment-340">
  1166. <a href='http://www.vinodlive.com' rel='external nofollow' class='url'>Vinod</a> on
  1167. May 26th, 2009 9:23 am
  1168. <div class="commenttext">
  1169. <div style="float:left;margin:0px 10px 10px 0px;"><img alt='' src='http://0.gravatar.com/avatar/2ec6a4450673a58848f470b80cef5808?s=60&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&amp;r=G' class='avatar avatar-60 photo' height='60' width='60' /></div><p>Thank you very much for the detailed instructions. I could move my blog faster to slicehost with your instructions.<br />
  1170. Cheers.</p>
  1171. <div style="clear:both;"></div>
  1172. </div>
  1173. </li>
  1174. <li class="" id="comment-346">
  1175. <a href='http://test.flapdrol.com/habari/nginx-awesomeness' rel='external nofollow' class='url'>Nginx awesomeness - Flapdrol.com</a> on
  1176. June 30th, 2009 5:37 pm
  1177. <div class="commenttext">
  1178. <div style="float:left;margin:0px 10px 10px 0px;"></div><p>[...] up Nginx, PHP5, MySQL5 and WordPress was pretty easy after reading these articles:Perfect Setup: Ubuntu Hardy+Nginx+MySQL5+WordpressInstalling Nginx with PHP5 and MySQL support on Ubuntu 8.10ApacheBenchUsing ApacheBench i&#8217;ve tested [...]</p>
  1179. <div style="clear:both;"></div>
  1180. </div>
  1181. </li>
  1182. <li class="alt" id="comment-347">
  1183. <a href='http://www.mikecann.co.uk/?p=607' rel='external nofollow' class='url'>MikeCann.co.uk &raquo; Blog Archive &raquo; Panic over, nginx comes to the rescue</a> on
  1184. July 3rd, 2009 2:58 pm
  1185. <div class="commenttext">
  1186. <div style="float:left;margin:0px 10px 10px 0px;"></div><p>[...] I would like to give a big thank you to this article which was invaluable: <a href="http://www.mensk.com/webmaster-toolbox/perfect-ubuntu-hardy-nginx-mysql5-php5-wordpress/" rel="nofollow">http://www.mensk.com/webmaster-toolbox/perfect-ubuntu-hardy-nginx-mysql5-php5-wordpress/</a> [...]</p>
  1187. <div style="clear:both;"></div>
  1188. </div>
  1189. </li>
  1190. <li class="" id="comment-348">
  1191. <a href='http://www.dlpeterson.com/' rel='external nofollow' class='url'>Luke</a> on
  1192. July 4th, 2009 4:04 pm
  1193. <div class="commenttext">
  1194. <div style="float:left;margin:0px 10px 10px 0px;"><img alt='' src='http://0.gravatar.com/avatar/813a73d7279efdda53dc8cd61a2348a2?s=60&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&amp;r=G' class='avatar avatar-60 photo' height='60' width='60' /></div><p>I started following your steps but had an issue when setting up the iptables. I copied the contents of the file you mentioned and changed the port number, saved and exited, but when I apply the new iptables rules:</p>
  1195. <p>iptables-restore &lt; /etc/iptables.test.rules</p>
  1196. <p>It responds:<br />
  1197. iptables-restore: line 43 failed.</p>
  1198. <p>Line 43 is the last line of the file iptables.test.rules, it has the COMMIT statement on it.</p>
  1199. <p>Any suggestions on how to fix this problem?</p>
  1200. <p>Thanks,<br />
  1201. ~Luke</p>
  1202. <div style="clear:both;"></div>
  1203. </div>
  1204. </li>
  1205. <li class="alt" id="comment-349">
  1206. <a href='http://www.dlpeterson.com/' rel='external nofollow' class='url'>Luke</a> on
  1207. July 4th, 2009 4:14 pm
  1208. <div class="commenttext">
  1209. <div style="float:left;margin:0px 10px 10px 0px;"><img alt='' src='http://0.gravatar.com/avatar/813a73d7279efdda53dc8cd61a2348a2?s=60&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&amp;r=G' class='avatar avatar-60 photo' height='60' width='60' /></div><p>On further investigation, it seems like the format of the file that is generated by iptables-save is very different from the format of the file that you provide:<br />
  1210. # Generated by iptables-save v1.4.1.1 on Sat Jul 4 23:35:15 2009<br />
  1211. *mangle<br />
  1212. <img src='http://www.mensk.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> REROUTING ACCEPT [992112:108459671]<br />
  1213. :INPUT ACCEPT [992112:108459671]<br />
  1214. :FORWARD ACCEPT [0:0]<br />
  1215. :OUTPUT ACCEPT [1134182:178798272]<br />
  1216. <img src='http://www.mensk.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> OSTROUTING ACCEPT [1134182:178798272]<br />
  1217. COMMIT<br />
  1218. # Completed on Sat Jul 4 23:35:15 2009<br />
  1219. # Generated by iptables-save v1.4.1.1 on Sat Jul 4 23:35:15 2009<br />
  1220. *filter<br />
  1221. :INPUT ACCEPT [992112:108459671]<br />
  1222. :FORWARD ACCEPT [0:0]<br />
  1223. :OUTPUT ACCEPT [1134182:178798272]<br />
  1224. COMMIT<br />
  1225. # Completed on Sat Jul 4 23:35:15 2009<br />
  1226. # Generated by iptables-save v1.4.1.1 on Sat Jul 4 23:35:15 2009<br />
  1227. *nat<br />
  1228. <img src='http://www.mensk.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> REROUTING ACCEPT [79601:4588901]<br />
  1229. <img src='http://www.mensk.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> OSTROUTING ACCEPT [114638:8397610]<br />
  1230. :OUTPUT ACCEPT [114638:8397610]<br />
  1231. COMMIT<br />
  1232. # Completed on Sat Jul 4 23:35:15 2009</p>
  1233. <p>Did the format of the file change or something? Is there a tool to convert the file that you provide to the format that that is above?</p>
  1234. <p>Thanks,<br />
  1235. ~Luke</p>
  1236. <div style="clear:both;"></div>
  1237. </div>
  1238. </li>
  1239. <li class="" id="comment-350">
  1240. <a href='http://www.dlpeterson.com/' rel='external nofollow' class='url'>Luke</a> on
  1241. July 4th, 2009 4:28 pm
  1242. <div class="commenttext">
  1243. <div style="float:left;margin:0px 10px 10px 0px;"><img alt='' src='http://0.gravatar.com/avatar/813a73d7279efdda53dc8cd61a2348a2?s=60&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&amp;r=G' class='avatar avatar-60 photo' height='60' width='60' /></div><p>Sorry to flood this place with comments, but I think I&#8217;m close to figuring it out. I exectued each line in the file you provide by doing &#8216;iptables ***&#8217; at the command line. Each command has worked fine up to this one:<br />
  1244. $ iptables -A INPUT -m limit &#8211;limit 5/min -j LOG &#8211;log-prefix &#8220;iptables denied: &#8221; &#8211;log-level 7</p>
  1245. <p>iptables: No chain/target/match by that name</p>
  1246. <p>Any ideas what this means / what to do next?</p>
  1247. <p>Thanks,<br />
  1248. ~Luke</p>
  1249. <div style="clear:both;"></div>
  1250. </div>
  1251. </li>
  1252. <li class="alt" id="comment-353">
  1253. <a href='http://millarian.com/random/switching-to-wordpress/' rel='external nofollow' class='url'>Millarian | Switching to Wordpress</a> on
  1254. July 9th, 2009 9:25 pm
  1255. <div class="commenttext">
  1256. <div style="float:left;margin:0px 10px 10px 0px;"></div><p>[...] WordPress on Ubuntu, Nginx and MySQL [...]</p>
  1257. <div style="clear:both;"></div>
  1258. </div>
  1259. </li>
  1260. <li class="" id="comment-355">
  1261. Vito Botta on
  1262. July 22nd, 2009 7:20 am
  1263. <div class="commenttext">
  1264. <div style="float:left;margin:0px 10px 10px 0px;"><img alt='' src='http://0.gravatar.com/avatar/6ced8db448201dd29d8e7aca1d7d8998?s=60&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&amp;r=G' class='avatar avatar-60 photo' height='60' width='60' /></div><p>I have a similar configuration, but I am having an issue with PHP-FPM (which is why I found this post by googling).<br />
  1265. For some reasons, after a reboot or after manually start PHP-FPM, the website syays up for a while but then dies after some time of inactivity.</p>
  1266. <p>Now I am testing with this init.d script you have posted, and have removed the &#8220;:&#8221; at the end of the script as suggested by boni. A big thank you to you and boni if this works! <img src='http://www.mensk.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
  1267. <p>One thing that I am not sure is, this doesn&#8217;t use PHP-FPM, does it? How does it exactly work and, in case it doesn&#8217;t use the PHP-FPM patch, are there any differences in performance?</p>
  1268. <p>Thanks!</p>
  1269. <div style="clear:both;"></div>
  1270. </div>
  1271. </li>
  1272. <li class="alt" id="comment-363">
  1273. <a href='http://buffered.io/' rel='external nofollow' class='url'>OJ</a> on
  1274. September 10th, 2009 12:20 am
  1275. <div class="commenttext">
  1276. <div style="float:left;margin:0px 10px 10px 0px;"><img alt='' src='http://1.gravatar.com/avatar/f0f2ee087377182b1e7bb0057dcee4e0?s=60&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&amp;r=G' class='avatar avatar-60 photo' height='60' width='60' /></div><p>Hi there,</p>
  1277. <p>Thanks for your tutorial. It has been very helpful.</p>
  1278. <p>One thing that I would like to point out, after chatting to the helpful guys in #nginx on freenode is that there&#8217;s a slight inefficiency in one of your examples:</p>
  1279. <p>rewrite ^/(.*) <a href="http://www.mydomain.com/$1" rel="nofollow">http://www.mydomain.com/$1</a> permanent;</p>
  1280. <p>This uses an unnecessary match/extract regex. Nginx already pulls the URL apart, and hence it&#8217;s already accessible directly via a variable. The above line should be changed to:</p>
  1281. <p>rewrite ^ <a href="http://www.mydomain.com$request_uri" rel="nofollow">http://www.mydomain.com$request_uri</a> permanent;</p>
  1282. <p>Hope that helps people squeeze that extra bit of perf out of nginx.<br />
  1283. Cheers<br />
  1284. OJ</p>
  1285. <div style="clear:both;"></div>
  1286. </div>
  1287. </li>
  1288. <li class="" id="comment-364">
  1289. brutus on
  1290. September 10th, 2009 8:40 am
  1291. <div class="commenttext">
  1292. <div style="float:left;margin:0px 10px 10px 0px;"><img alt='' src='http://0.gravatar.com/avatar/237ad6c7531e02a03a6f5eed31a15112?s=60&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&amp;r=G' class='avatar avatar-60 photo' height='60' width='60' /></div><p>Hi there , </p>
  1293. <p>Having a problem that is quite literally driving me mad, and I&#8217;ve found nothing out there that has solved my problem. Its quite simple really, I just need to change my php.ini settings for my MAX_UPLOAD_SETTINGS, currently set to 2M. When I change the value in /etc/php5/cgi/php.ini it quite simply doesnt take effect. Restarting nginx does nothing. Any ideas folks ??</p>
  1294. <p>Brutus</p>
  1295. <div style="clear:both;"></div>
  1296. </div>
  1297. </li>
  1298. <li class="alt" id="comment-366">
  1299. shadow on
  1300. September 24th, 2009 3:34 pm
  1301. <div class="commenttext">
  1302. <div style="float:left;margin:0px 10px 10px 0px;"><img alt='' src='http://1.gravatar.com/avatar/77fffc386f7110a554d1e2b7f79c8a12?s=60&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&amp;r=G' class='avatar avatar-60 photo' height='60' width='60' /></div><p>Hello there, thanks for the wonderful guide. However, I need some help here.<br />
  1303. Can&#8217;t seem to get it to point to wordpress install.<br />
  1304. It keeps going to the Welcome to Nginx page instead of the wordpress install.<br />
  1305. Any clue why?</p>
  1306. <div style="clear:both;"></div>
  1307. </div>
  1308. </li>
  1309. <li class="" id="comment-367">
  1310. <a href='http://www.bentow.com.br' rel='external nofollow' class='url'>Bentow</a> on
  1311. September 26th, 2009 11:45 am
  1312. <div class="commenttext">
  1313. <div style="float:left;margin:0px 10px 10px 0px;"><img alt='' src='http://1.gravatar.com/avatar/5973206f8cce9e94d5ed5015bc00f2fe?s=60&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&amp;r=G' class='avatar avatar-60 photo' height='60' width='60' /></div><p>You are the man.</p>
  1314. <p>Everything I&#8217;ve needed.</p>
  1315. <div style="clear:both;"></div>
  1316. </div>
  1317. </li>
  1318. <li class="alt" id="comment-374">
  1319. <a href='http://www.vinodlive.com/' rel='external nofollow' class='url'>Vinod</a> on
  1320. November 30th, 2009 4:20 pm
  1321. <div class="commenttext">
  1322. <div style="float:left;margin:0px 10px 10px 0px;"><img alt='' src='http://0.gravatar.com/avatar/2ec6a4450673a58848f470b80cef5808?s=60&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&amp;r=G' class='avatar avatar-60 photo' height='60' width='60' /></div><p>Thank you so much. I couldn&#8217;t have moved my blog to nginx without this excellent article. Thanks again.</p>
  1323. <div style="clear:both;"></div>
  1324. </div>
  1325. </li>
  1326. <li class="" id="comment-403">
  1327. <a href='http://www.artfilmus.ru/' rel='external nofollow' class='url'>FrankieFilm</a> on
  1328. April 29th, 2010 12:28 pm
  1329. <div class="commenttext">
  1330. <div style="float:left;margin:0px 10px 10px 0px;"><img alt='' src='http://0.gravatar.com/avatar/c08078c3acfcf997eabd28cf08fa2d2a?s=60&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&amp;r=G' class='avatar avatar-60 photo' height='60' width='60' /></div><p>Долго, долго искал и вот оно&#8230; случайно наткнулся на Вашу изумительную статью</p>
  1331. <div style="clear:both;"></div>
  1332. </div>
  1333. </li>
  1334. <li class="alt" id="comment-411">
  1335. <a href='http://alexsmith.im' rel='external nofollow' class='url'>Alex</a> on
  1336. May 24th, 2010 5:54 am
  1337. <div class="commenttext">
  1338. <div style="float:left;margin:0px 10px 10px 0px;"><img alt='' src='http://1.gravatar.com/avatar/9ab9799c6a90bade73d3769f0c5bd6fe?s=60&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&amp;r=G' class='avatar avatar-60 photo' height='60' width='60' /></div><p>With 10.04 Ubuntu you need to add one other step to this. Due to &#8220;localhost&#8221; now reffering to both 127.0.0.1 and ::1 php-fastcgi will die with the following:</p>
  1339. <p>&#8220;Host &#8216;localhost&#8217; has multiple addresses. You must choose one explicitly!&#8221;</p>
  1340. <p>Quickly open /etc/init.d/php-fastcgi and change<br />
  1341. FCGI_HOST=localhost<br />
  1342. to<br />
  1343. FCGI_HOST=127.0.0.1</p>
  1344. <p>Starting and restarting should now work without too many issues now.</p>
  1345. <p>Also, you should now use</p>
  1346. <p>sudo aptitude -y install libfcgi</p>
  1347. <p>instead of</p>
  1348. <p>sudo aptitude -y install libfcgi0</p>
  1349. <div style="clear:both;"></div>
  1350. </div>
  1351. </li>
  1352. </ol>
  1353. <p id="respond"><b>Feel free to leave a comment... <br />and oh, if you want a pic to show with your comment, go get a <a href="http://en.gravatar.com" >gravatar</a>!</b></p>
  1354. <form action="http://www.mensk.com/wp-comments-post.php" method="post" id="commentform">
  1355. <p><label for="name">Name (required)</label><br />
  1356. <input type="text" name="author" id="name" value="" size="50" tabindex="1" /></p>
  1357. <p><label for="email">Email Address (required)</label><br />
  1358. <input type="text" name="email" id="email" value="" size="50" tabindex="2" /></p>
  1359. <p><label for="url">Website</label><br />
  1360. <input type="text" name="url" id="url" value="" size="50" tabindex="3" /></p>
  1361. <!--<p><small><strong>XHTML:</strong> You can use these tags: &lt;a href=&quot;&quot; title=&quot;&quot;&gt; &lt;abbr title=&quot;&quot;&gt; &lt;acronym title=&quot;&quot;&gt; &lt;b&gt; &lt;blockquote cite=&quot;&quot;&gt; &lt;cite&gt; &lt;code&gt; &lt;del datetime=&quot;&quot;&gt; &lt;em&gt; &lt;i&gt; &lt;q cite=&quot;&quot;&gt; &lt;strike&gt; &lt;strong&gt; </small></p>-->
  1362. <p><label for="words">Speak your mind</label><br /><textarea name="comment" id="words" cols="40" rows="10" tabindex="4"></textarea></p>
  1363. <p><input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" />
  1364. <input type="hidden" name="comment_post_ID" value="89" /></p>
  1365. </form>
  1366. </div>
  1367. </div>
  1368. </div>
  1369. <!-- begin sidebar -->
  1370. <div id="sidebar">
  1371. <div align="center" style="background:#ffd;margin: 0 0 10px;padding:0 0 5px;">
  1372. <p style="padding:2px;font-weight:bold;">Sign up for updates<br /><span style="color:red;font-size:120%;">Don't Miss a TIP!</span></p>
  1373. <form method="post" action="http://www.aweber.com/scripts/addlead.pl">
  1374. <input type="hidden" name="meta_web_form_id" value="1391534197">
  1375. <input type="hidden" name="meta_split_id" value="">
  1376. <input type="hidden" name="unit" value="mensk-updates">
  1377. <input type="hidden" name="redirect" value="http://www.aweber.com/form/thankyou_vo.html" id="redirect_3778436059463a2e6520b50490a74996">
  1378. <input type="hidden" name="meta_redirect_onlist" value="">
  1379. <input type="hidden" name="meta_adtracking" value="">
  1380. <input type="hidden" name="meta_message" value="1">
  1381. <input type="hidden" name="meta_required" value="from">
  1382. <input type="hidden" name="meta_forward_vars" value="0">
  1383. <table>
  1384. <tr><td colspan=2><center></center></td></tr>
  1385. <tr><td>Name:</td><td><input type="text" name="name" value="" size="20"></td></tr>
  1386. <tr><td>Email:</td><td><input type="text" name="from" value="" size="20"></td></tr>
  1387. <tr><td colspan=2><center></center></td></tr>
  1388. <tr><td align="center" colspan="2"><input type="submit" name="submit" value="Keep me Updated!"></td></tr>
  1389. </table>
  1390. </form>
  1391. </div>
  1392. <div align="center" style="background:#ffd;margin: 0 0 10px;padding:0 0 5px;">Supported by:<br />
  1393. <a href="http://www.loachat.com/" title="Law of Attraction Chat Room" target="_blank">Law of Attraction Chat</a>
  1394. <br />
  1395. <a href="http://www.idreamcatcher.com/hooponopono/" title="Ho'oponopono" target="_blank">Hooponopono</a>
  1396. <br />
  1397. <a href="http://www.onepagecheckout.com/" title="One Page Checkout" target="_blank">One Page Checkout</a>
  1398. <br />
  1399. <a href="http://www.poodleit.com/products/dog-coats/" title="Dog Coats" target="_blank">Dog Coats</a>
  1400. and
  1401. <a href="http://www.poodleit.com/" title="Dog Rain Coats" target="_blank">Dog Raincoats</a>
  1402. <br />
  1403. <a href="http://www.lovetalkforum.com/" title="Love and Relationships Forum" target="_blank">Love and Relationships Forum</a>
  1404. <br />
  1405. <a href="http://www.hooponopono.co/" title="Ho'oponopono" target="_blank">Ho'oponopono</a>
  1406. </div>
  1407. <div class="widgetarea">
  1408. <ul id="sidebarwidgeted">
  1409. </ul>
  1410. </div>
  1411. <!-- begin r_sidebar -->
  1412. <div id="r_sidebar">
  1413. <ul id="r_sidebarwidgeted">
  1414. <li id="text-364724621" class="widget widget_text"> <div class="textwidget"><a target="_blank" style="position:relative;top:-10px;left:-10px;text-decoration:none;" href="http://www.memberwing.com/webdev/"><img style="border:0 none;" src="http://www.memberwing.com/webdev/MW_Web_Services_200x.png" /></a>
  1415. <!-- 25PIX.COM WIDGET CODE START -->
  1416. <div id="XXV_1_3926_wrapper"><div class="XXV_1_3926_widget_strict XXV_1_3926_widget_tbh" style="font-size:8px;" id="N6aa4419ea02aee8d"><a href="http://www.idreamcatcher.com/hooponopono/">Hooponopono</a><a href="http://www.25pix.com/">Web Widgets</a></div></div><script type="text/javascript" src="http://widgets.25pix.com/getwidget/?wid=1&wsn=3926"></script>
  1417. <!-- 25PIX.COM WIDGET CODE END --></div>
  1418. </li>
  1419. </ul>
  1420. </div>
  1421. <!-- end r_sidebar -->
  1422. </div>
  1423. <!-- end sidebar -->
  1424. </div>
  1425. <!-- The main column ends -->
  1426. <!-- begin footer -->
  1427. <div style="clear:both;"></div>
  1428. <div id="footer">
  1429. <div id="footerleft">
  1430. <p>&middot; Copyright &copy; 2008 <a href="http://www.mensk.com/">MENSK Technologies Corporation</a> &middot; </p>
  1431. </div>
  1432. <div id="footerright">
  1433. </div>
  1434. </div>
  1435. <div id="bottom">
  1436. <img src="http://www.mensk.com/wp-content/themes/revolution_tech-30/images/bottom.gif" alt="Bottom" />
  1437. </div>
  1438. </div>
  1439. <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
  1440. </script>
  1441. <script type="text/javascript">
  1442. _uacct = "UA-443802-2";
  1443. urchinTracker();
  1444. </script>
  1445. </body>
  1446. </html>