PageRenderTime 63ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/content/98bdbbc023d58582046a04e417e88139

https://github.com/tzmartin/gitmarks_tzm
#! | 1838 lines | 1446 code | 392 blank | 0 comment | 0 complexity | 5267c972ceca14f5105e2c74f91e113b MD5 | raw file

Large files files are truncated, but you can click here to view the full 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. <…

Large files files are truncated, but you can click here to view the full file