{"id":8632,"date":"2017-11-29T04:00:44","date_gmt":"2017-11-29T08:00:44","guid":{"rendered":"https:\/\/blog.litespeedtech.com\/?p=8632"},"modified":"2017-11-29T04:00:44","modified_gmt":"2017-11-29T08:00:44","slug":"wpw-installing-openlitespeed-wordpress-and-lscache","status":"publish","type":"post","link":"https:\/\/lswp.store\/index.php\/2017\/11\/29\/wpw-installing-openlitespeed-wordpress-and-lscache\/","title":{"rendered":"WpW: Installing OpenLiteSpeed, WordPress, and LSCache"},"content":{"rendered":"<p><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone\" src=\"https:\/\/lswp.store\/wp-content\/uploads\/2017\/11\/null-19.png\" alt=\"WordPress Wednesday: Installing OpenLiteSpeed WordPress and LSCache\" width=\"640\" height=\"320\" \/><\/p>\n<p>Welcome to another installment of <a href=\"http:\/\/blog.litespeedtech.com\/tag\/wordpress-wednesday\">WordPress Wednesday<\/a>!<br \/>\nToday&#8217;s Topic:\u00a0<strong>Installing OpenLiteSpeed WordPress and LSCache<\/strong><\/p>\n<p>So, you want to self-host a WordPress site, and you want to accelerate it with LiteSpeed Cache. That\u2019s great news! LiteSpeed Cache for WordPress can easily be installed through your WordPress Dashboard. However, it requires a LiteSpeed web server in order to function. <strong>This guide will walk you through the installation of three free and open source pieces of software: OpenLiteSpeed, WordPress, and LiteSpeed Cache for WordPress<\/strong>.<\/p>\n<p>When we\u2019re done, you\u2019ll have your own brand new, self-hosted WordPress site, powered by LiteSpeed.<\/p>\n<p><em>Please note the versions of everything we are talking about today:<\/em><\/p>\n<p><em>OpenLiteSpeed: 1.4.28<\/em><br \/>\n<em>WordPress: 4.9<\/em><br \/>\n<em>LiteSpeed Cache for WordPress: 1.6.4<\/em><\/p>\n<p><em>If you are using different versions of any of this software, your experiences with this tutorial may vary.<\/em><\/p>\n<h2>Why OpenLiteSpeed?<\/h2>\n<p>LiteSpeed Cache is a server-level cache. The WordPress plugin provides an easy way for site admins to communicate with the server, but it does not implement any of the caching functionality itself. For this reason, you are required to have a LiteSpeed web server. Without one, the plugin has nothing to talk to.<\/p>\n<p>You may choose between LiteSpeed Enterprise and OpenLiteSpeed. We\u2019ll be focusing on the latter today, but if you\u2019re wondering which server is right for you, you can <a href=\"https:\/\/lswp.store\/2017\/08\/03\/which-litespeed-server-powers-you\/\">compare editions (and take a little quiz, if you like) here<\/a>.<\/p>\n<p>Please note: not all LSCache functions are supported by OpenLiteSpeed. If you will be using ESI, for instance, you will need LiteSpeed Enterprise.<\/p>\n<h2>OpenLiteSpeed One-click installation<\/h2>\n<p><code>ols1clk<\/code> is a one-click installation script for OpenLiteSpeed. Using this script, you can quickly and easily install OpenLiteSpeed with it\u2019s default settings. By adding different parameters, you can use it to install WordPress and the LiteSpeed Cache.<\/p>\n<p>Currently one click installation only supports Centos(5-7), Debian(7-9) and Ubuntu(12,14,16)<\/p>\n<p><code>ols1clk<\/code> must be run with superuser access, You can either switch to superuser (root) with the su command or you may run it as root using the sudo command. How you do this will depend upon which distribution you use. Some distributions enable the root user (such as CentOS), while others do not (such as Ubuntu and Debian).<\/p>\n<p>There are two different one-click methods: Direct Download and Command Line Interface.<\/p>\n<h3>Direct Download<\/h3>\n<ol>\n<li>Download <code>ols1clk<\/code> from <a href=\"https:\/\/raw.githubusercontent.com\/litespeedtech\/ols1clk\/master\/ols1clk.sh\">GitHub<\/a>.<\/li>\n<li>Run the <code>ols1clk<\/code> script on your server command line with <code>.\/ols1clk.sh or bash ols1clk.sh;<\/code><\/li>\n<\/ol>\n<h3>CLI Installation<\/h3>\n<p>Run the following from the command line:<\/p>\n<pre>wget --no-check-certificate https:\/\/raw.githubusercontent.com\/litespeedtech\/ols1clk\/master\/ols1clk.sh; bash ols1clk.sh;\n<\/pre>\n<p>OR, run the following from the command line:<\/p>\n<pre>bash &lt;( curl -k https:\/\/raw.githubusercontent.com\/litespeedtech\/ols1clk\/master\/ols1clk.sh ) [options] [options] \u2026\n<\/pre>\n<p>The above methods will install OpenLiteSpeed and the <code>lsphp<\/code> module. For additional options, examples, and a FAQ, see <a href=\"http:\/\/open.litespeedtech.com\/mediawiki\/index.php\/Help:1-Click_Install\">the OpenLiteSpeed wiki<\/a>.<\/p>\n<h2>WordPress Installation<\/h2>\n<p><img decoding=\"async\" class=\"alignnone\" src=\"https:\/\/lswp.store\/wp-content\/uploads\/2017\/11\/null-4.jpeg\" alt=\"Installing OpenLiteSpeed, WordPress, and LSCache\" width=\"672\" height=\"448\" \/><\/p>\n<p>To install WordPress along with a MySQL database, run the following from the command line:<\/p>\n<pre> .\/ols1clk.sh -w.\n<\/pre>\n<p>Answer any prompts within the script and you&#8217;re done!<\/p>\n<h2>LSCache for WordPress Installation<\/h2>\n<ol>\n<li>Download the LSCWP plugin from our <a href=\"https:\/\/wordpress.org\/plugins\/litespeed-cache\/\">WordPress Plugin Directory<\/a> page.<\/li>\n<li>Log in to your WordPress Dashboard, navigate to <strong>Plugins &gt; Add New<\/strong> and click on <strong>Upload Plugin<\/strong>.<\/li>\n<li>Select the LSCWP zip file and click <strong>Install Now<\/strong>. Activate the plugin.<\/li>\n<li>Navigate to <strong>LiteSpeed Cache &gt; Settings &gt; General<\/strong> and set <strong>Enable LiteSpeed Cache<\/strong> to <code>Enable<\/code>.<\/li>\n<\/ol>\n<p>OR<\/p>\n<ol>\n<li>Search for <code>LiteSpeed Cache<\/code> in the search box. Our plugin should be the first search result to come up.<\/li>\n<li>Press <strong>Install Now<\/strong>. Activate the plugin.<\/li>\n<li>Navigate to <strong>LiteSpeed Cache &gt; Settings &gt; General<\/strong> and set <strong>Enable LiteSpeed Cache<\/strong> to <code>Enable<\/code>.<\/li>\n<\/ol>\n<h2>Testing<\/h2>\n<p>Once you have installed LiteSpeed Cache for WordPress, you\u2019ll want to run a few tests to be sure that it\u2019s working as expected.<\/p>\n<p>You can verify a page is being served from LSCWP through the following steps using your browser\u2019s developer tools:<\/p>\n<p><strong>Step 1<\/strong>: Open the developer tools on a <em>non-logged-in browser<\/em> and navigate to your site. Open the <strong>Network<\/strong> tab.<\/p>\n<p><strong>Step 2<\/strong>: Refresh the page.<\/p>\n<p><strong>Step 3<\/strong>: Click the first resource (this should be an HTML file and the resource&#8217;s headers should appear as in the image below). For example, if your page is <code>http:\/\/example.com\/wordpress\/<\/code>, your first resource should either be something like <code>example.com\/wordpress\/<\/code> or <code>wordpress\/<\/code>.<\/p>\n<p><strong>Step 4<\/strong>: In a different,<em> logged-in browser<\/em>, in your WordPress Dashboard, navigate to <strong>LiteSpeed Cache &gt; Manage<\/strong> and click the <strong>Purge All<\/strong> button.<\/p>\n<p><a href=\"https:\/\/lswp.store\/wp-content\/uploads\/2017\/11\/wpw29c.png\"><img decoding=\"async\" class=\"alignnone wp-image-8652 size-large\" src=\"https:\/\/lswp.store\/wp-content\/uploads\/2017\/11\/wpw29c-1024x724.png\" alt=\"Installing OpenLiteSpeed, WordPress, and LSCache\" width=\"1024\" height=\"724\" srcset=\"https:\/\/lswp.store\/wp-content\/uploads\/2017\/11\/wpw29c-1024x724.png 1024w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/11\/wpw29c-300x212.png 300w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/11\/wpw29c-768x543.png 768w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/11\/wpw29c-600x424.png 600w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/11\/wpw29c.png 1226w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<p><strong>Step 5<\/strong>: Reload the page in the first (non-logged-in) browser and select the same resource again. If you see headings similar to<\/p>\n<pre>X-LiteSpeed-Cache: miss\nX-LiteSpeed-Cache-Control:public,max-age=1800\nX-LiteSpeed-Tag:B1_F,B1_\n<\/pre>\n<p>(for example), this means the page had not yet been cached, but that LiteSpeed has now stored it for future use.<\/p>\n<p><a href=\"https:\/\/lswp.store\/wp-content\/uploads\/2017\/11\/wpw29b.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-8656 size-large\" src=\"https:\/\/lswp.store\/wp-content\/uploads\/2017\/11\/wpw29b-1024x707.png\" alt=\"Installing OpenLiteSpeed, WordPress, and LSCache\" width=\"1024\" height=\"707\" srcset=\"https:\/\/lswp.store\/wp-content\/uploads\/2017\/11\/wpw29b-1024x707.png 1024w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/11\/wpw29b-300x207.png 300w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/11\/wpw29b-768x530.png 768w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/11\/wpw29b-600x414.png 600w, https:\/\/lswp.store\/wp-content\/uploads\/2017\/11\/wpw29b.png 1229w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<p><strong>Step 6<\/strong>: Reload the page a second time and you should see <code>X-LiteSpeed-Cache: hit<\/code> in the response header. This means the page is being served by the cache and LSCWP is configured correctly.<\/p>\n<p><strong>Note:<\/strong> If your first refresh after purging returns <code>X-LiteSpeed-Cache: hit<\/code> in the response header, this may be because someone else visited the page after you purged but before you refreshed it yourself. Try again from step 4.<\/p>\n<h3>Finding Errors<\/h3>\n<p>To check the debug log, enter the following at the command line:<\/p>\n<pre>tail -f wp-content\/debug.log\n<\/pre>\n<h3>How to report problems you can\u2019t fix<\/h3>\n<p>If you run across a problem you can\u2019t solve on your own, we are here to assist! If you take the time to gather a few of the following things before contacting us, it will help us to help you better:<\/p>\n<ul>\n<li>Screenshots: If there are any error messages, grab a screenshot so we can see where it happens.<\/li>\n<li>Environment Report: Navigate to <strong>LiteSpeed Cache &gt; Environment Report<\/strong> &gt; and press the <strong>Send to LiteSpeed<\/strong> button. You\u2019ll be given a report number. Save the number.<\/li>\n<li>Debug Log: Capture any relevant lines of the debug log as described above.<\/li>\n<\/ul>\n<p>Once you have your screenshots, environment report number, and\/or debug log, you can share them with us through the <a href=\"https:\/\/wordpress.org\/support\/plugin\/litespeed-cache\">WordPress Support Forum<\/a> for our plugin, or you can <a href=\"https:\/\/store.litespeedtech.com\/store\/clientarea.php\">submit a ticket<\/a> to our ticket system.<\/p>\n<h2>Congratulations!<\/h2>\n<p>You are now the proud owner of a self-hosted, LiteSpeed-powered, WordPress site. Enjoy it!<\/p>\n<p>&#8212;<br \/>\nHave some of your own ideas for future <a href=\"http:\/\/blog.litespeedtech.com\/tag\/wordpress-wednesday\">WordPress Wednesday<\/a> topics? Leave us a comment!<\/p>\n<p>Don\u2019t forget to meet us back here next week for the next installment. In the meantime, here are a few other things you can do:<\/p>\n<ul>\n<li>Subscribe to the <a href=\"http:\/\/blog.litespeedtech.com\/tag\/wordpress-wednesday\/feed\/\">WordPress Wednesday RSS feed<\/a><\/li>\n<li>Download <a href=\"https:\/\/wordpress.org\/plugins\/litespeed-cache\/\">LiteSpeed Cache for WordPress plugin<\/a><\/li>\n<li>Learn more about the plugin <a href=\"https:\/\/www.litespeedtech.com\/products\/cache-plugins\/wordpress-acceleration\">on our website<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>This guide will walk you through the installation of three free and open source pieces of software: OpenLiteSpeed, WordPress, and LiteSpeed Cache for WordPress<\/p>\n","protected":false},"author":1,"featured_media":8634,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[28,29],"tags":[210,316,317],"class_list":["post-8632","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cache","category-openlitespeed","tag-open-source","tag-wordpress","tag-wordpress-wednesday"],"jetpack_featured_media_url":"https:\/\/lswp.store\/wp-content\/uploads\/2017\/11\/null-19.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/posts\/8632","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/comments?post=8632"}],"version-history":[{"count":0,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/posts\/8632\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/media\/8634"}],"wp:attachment":[{"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/media?parent=8632"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/categories?post=8632"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/tags?post=8632"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}