{"id":1983,"date":"2020-11-22T17:06:07","date_gmt":"2020-11-22T17:06:07","guid":{"rendered":"https:\/\/sp2hari.com\/?p=1983"},"modified":"2020-11-22T17:08:18","modified_gmt":"2020-11-22T17:08:18","slug":"wordpress-setup","status":"publish","type":"post","link":"https:\/\/sp2hari.com\/index.php\/2020\/11\/22\/wordpress-setup\/","title":{"rendered":"WordPress Setup"},"content":{"rendered":"\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/sp2hari.com\/wp-content\/uploads\/2020\/11\/how-to-install-WordPress-manually.png\" alt=\"\" class=\"wp-image-1986\" width=\"600\" height=\"311\" srcset=\"https:\/\/sp2hari.com\/wp-content\/uploads\/2020\/11\/how-to-install-WordPress-manually.png 600w, https:\/\/sp2hari.com\/wp-content\/uploads\/2020\/11\/how-to-install-WordPress-manually-300x156.png 300w, https:\/\/sp2hari.com\/wp-content\/uploads\/2020\/11\/how-to-install-WordPress-manually-579x300.png 579w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">I set up my first website using WordPress way back around 2007 or 2008. I was amazed by the simplicity to install WordPress. My website was up and running within 2 minutes. Even now, the setup process remains the same. In this post, I&#8217;m sharing my WordPress setup. <\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Hosting<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">This entire website is hosted at Linode.com. Linode gives a 2GB RAM with a 50GB SSD and 2TB transfer for $10 per month.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/sp2hari.com\/wp-content\/uploads\/2020\/11\/linode-logo_standard_light_medium1.png\" alt=\"\" class=\"wp-image-2005\" width=\"300\" height=\"119\" srcset=\"https:\/\/sp2hari.com\/wp-content\/uploads\/2020\/11\/linode-logo_standard_light_medium1.png 600w, https:\/\/sp2hari.com\/wp-content\/uploads\/2020\/11\/linode-logo_standard_light_medium1-300x119.png 300w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/figure><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">Webserver<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Since I don&#8217;t expect huge traffic to my website, I&#8217;ve preferred Apache to Nginx. Setting up a PHP application is a lot easier than setting up under Nginx. Nginx comes up with the weird fpm setup. While Nginx would&#8217;ve been my first preference for a high-scale web application, apache + php is still the best for small and simple web applications.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/sp2hari.com\/wp-content\/uploads\/2020\/11\/1200px-Apache_HTTP_server_logo_2016.svg_.png\" alt=\"\" class=\"wp-image-2001\" width=\"450\" height=\"172\" srcset=\"https:\/\/sp2hari.com\/wp-content\/uploads\/2020\/11\/1200px-Apache_HTTP_server_logo_2016.svg_.png 600w, https:\/\/sp2hari.com\/wp-content\/uploads\/2020\/11\/1200px-Apache_HTTP_server_logo_2016.svg_-300x115.png 300w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\" \/><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">This is the simple Apache configuration I maintain for every single instance of the website I maintain.<\/p>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">&lt;IfModule mod_ssl.c>\n&lt;VirtualHost *:443>\n\tServerAdmin webmaster@localhost\n\tDocumentRoot \/var\/www\/sp2hari\/html\n\tServerName sp2hari.com\n\tServerAlias www.sp2hari.com\n\n\t&lt;Directory \/var\/www\/sp2hari\/html>\n\t\tOptions Indexes FollowSymLinks MultiViews\n\t\tAllowOverride All\n\t\tOrder allow,deny\n\t\tAllow from All\n\t&lt;\/Directory>\n\n\tErrorLog \/var\/log\/apache2\/error.log\n\tLogLevel warn\n\tCustomLog \/var\/log\/apache2\/access.log combined\n\n\tInclude \/etc\/letsencrypt\/options-ssl-apache.conf\n\tSSLCertificateFile \/etc\/letsencrypt\/live\/sp2hari.com\/fullchain.pem\n\tSSLCertificateKeyFile \/etc\/letsencrypt\/live\/sp2hari.com\/privkey.pem\n&lt;\/VirtualHost>\n&lt;\/IfModule><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">SSL Setup<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s Encrypt for the win. All the website I host in my website (multiple WordPress servers) use lets encrypt for their SSL. <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/sp2hari.com\/wp-content\/uploads\/2020\/11\/le-logo-twitter-noalpha.png\" alt=\"\" class=\"wp-image-1999\" width=\"320\" height=\"320\" srcset=\"https:\/\/sp2hari.com\/wp-content\/uploads\/2020\/11\/le-logo-twitter-noalpha.png 640w, https:\/\/sp2hari.com\/wp-content\/uploads\/2020\/11\/le-logo-twitter-noalpha-300x300.png 300w, https:\/\/sp2hari.com\/wp-content\/uploads\/2020\/11\/le-logo-twitter-noalpha-150x150.png 150w\" sizes=\"auto, (max-width: 320px) 100vw, 320px\" \/><\/figure><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">Managing Installation<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">wp-cli is a huge blessing. Before wp-cli, one of the biggest challenges with WordPress is that to install\/upgrade plugins and themes,  you had two choices. <\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Make the wp-content (or just the plugins &amp; themes) folder apache writable<\/li><li>Install an FTP server and provide the FTP credentials. <\/li><\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Both of them are equally horrible and had lots of security concerns. WordPress CLI solved this in the best way possible. These days all the WordPress instances (including the home page of hackerrank.com) are WordPress managed by wp-cli.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"311\" height=\"160\" src=\"https:\/\/sp2hari.com\/wp-content\/uploads\/2020\/11\/wp-cli-logo.png\" alt=\"\" class=\"wp-image-2003\" srcset=\"https:\/\/sp2hari.com\/wp-content\/uploads\/2020\/11\/wp-cli-logo.png 311w, https:\/\/sp2hari.com\/wp-content\/uploads\/2020\/11\/wp-cli-logo-300x154.png 300w\" sizes=\"auto, (max-width: 311px) 100vw, 311px\" \/><\/figure><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">Plugins<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">These are the set of plugins I have in the WordPress setup I have. <\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Akismet Anti-Spam &#8211; Reduce the spam content in the contents. <\/li><li>Captcha &#8211; Avoid brute-force logins<\/li><li>Comet Cache &#8211; The best cache plugin with the best configurable options. <\/li><li>Fonts Plugin &#8211; Easy way to configure custom fonts from Google Fonts<\/li><li>Foobox Image Lightbox &#8211; The default image upload of WordPress isn&#8217;t the best.<\/li><li>FooGallery &#8211; Ability to add multiple images in a grid, slideshow, or gallery view.<\/li><li>Gist Github Shortcode &#8211; Ability so how Github gist in WordPress<\/li><li>Smush &#8211; Plugin to compress image<\/li><li>SyntaxHighligher Evolved &#8211; Automated syntax highlighter for the code displayed in the blog<\/li><\/ol>\n\n\n\n<h4 class=\"wp-block-heading\">Themes<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Along with the default template, I&#8217;ve used the Fluida template. While I don&#8217;t recommend the same theme for everyone, different people like different themes based on their personal choice. I recommend choosing a good template which is responsive, good widgets\/components. I recommend installing the theme via wp-cli. <\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Code<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Apart from the setup, WordPress is a great example for programmers to learn and understand code, design and architecture. Some of the core technical decisions of HackerRank are inspired from WordPress.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"400\" height=\"300\" src=\"https:\/\/sp2hari.com\/wp-content\/uploads\/2020\/11\/code-is-poetry.png\" alt=\"\" class=\"wp-image-2009\" srcset=\"https:\/\/sp2hari.com\/wp-content\/uploads\/2020\/11\/code-is-poetry.png 400w, https:\/\/sp2hari.com\/wp-content\/uploads\/2020\/11\/code-is-poetry-300x225.png 300w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I set up my first website using WordPress way back around 2007 or 2008. I was amazed by the simplicity to install WordPress. My website was up and running within 2 minutes. Even now, the setup process remains the same. In this post, I&#8217;m sharing my WordPress setup. Hosting This &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"class_list":["post-1983","post","type-post","status-publish","format-standard","hentry","category-code"],"_links":{"self":[{"href":"https:\/\/sp2hari.com\/index.php\/wp-json\/wp\/v2\/posts\/1983","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sp2hari.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sp2hari.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sp2hari.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sp2hari.com\/index.php\/wp-json\/wp\/v2\/comments?post=1983"}],"version-history":[{"count":19,"href":"https:\/\/sp2hari.com\/index.php\/wp-json\/wp\/v2\/posts\/1983\/revisions"}],"predecessor-version":[{"id":2010,"href":"https:\/\/sp2hari.com\/index.php\/wp-json\/wp\/v2\/posts\/1983\/revisions\/2010"}],"wp:attachment":[{"href":"https:\/\/sp2hari.com\/index.php\/wp-json\/wp\/v2\/media?parent=1983"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sp2hari.com\/index.php\/wp-json\/wp\/v2\/categories?post=1983"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sp2hari.com\/index.php\/wp-json\/wp\/v2\/tags?post=1983"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}