{"id":78,"date":"2020-03-20T21:21:27","date_gmt":"2020-03-21T04:21:27","guid":{"rendered":"http:\/\/junsun.net\/wordpress\/?p=78"},"modified":"2020-03-20T21:21:27","modified_gmt":"2020-03-21T04:21:27","slug":"install-wordpress-on-ubuntu-18-04","status":"publish","type":"post","link":"https:\/\/junsun.net\/wordpress\/2020\/03\/install-wordpress-on-ubuntu-18-04\/","title":{"rendered":"Install WordPress on Ubuntu 18.04"},"content":{"rendered":"\n<p>As I said in my Home Page, I finally spent some time and migrated my ancient homepage to WordPress, the most popular web hosting platform (>60% of web sites).<\/p>\n\n\n\n<p>However, quite contrarily to my expectations, the process is rather complicated.  I went through quite a few hiccups, taking more than a couple of days, to reach today&#8217;s state.  So I decide to write my experience down to hopefully save someone&#8217;s else pain.<\/p>\n\n\n\n<h2>For the Inpatients<\/h2>\n\n\n\n<ul><li>Don&#8217;t follow the <a href=\"https:\/\/help.ubuntu.com\/lts\/serverguide\/wordpress.html\">official instructions<\/a>.  It looks easy and simple, but WordPress is too old and does not seem to be easily updateable.<\/li><li>Don&#8217;t use <a href=\"https:\/\/hub.docker.com\/_\/wordpress\/\">WordPress docker container<\/a>.  A lot of trouble to get MySQL setup and connected.  You still have a broken environment that many plug-in&#8217;s don&#8217;t work. In my case, I need to send emails (who don&#8217;t?), and that is VERY HARD to do with container.<\/li><li>I suppose <a href=\"https:\/\/docs.bitnami.com\/aws\/how-to\/get-started-wordpress-aws-marketplace-beginner\/\">Bitnami WordPress on AWS<\/a> might be a fine choice.  But I find more flexibility in just doing it myself, and it is actually not that hard, with a good instruction.<\/li><li>I ended up installing WordPress directory on Ubuntu 18.04<ul><li>I install WordPress as a subdrectory of WWW root (wordpress\/).  This way I can migrate my original web site (in classic HTML) to WWW directory and co-exist with new shiny WordPress pages.<\/li><\/ul><ul><li>I chose Apache2 and MySQL.  You can use Niginx and Mariabdb as well.<\/li><\/ul><\/li><\/ul>\n\n\n\n<h2>Installation<\/h2>\n\n\n\n<ul><li>install required packages<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">apt update\napt install apache2 mysql php php-mysql\napt install php-curl php-gd php-mbstring php-xml php-xmlrpc php-soap php-intl php-zip php-gd<\/pre>\n\n\n\n<ul><li>configure mysql<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">create database wordpress;\ngrant SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER on wordpress.* to 'wp_admin'@'localhost' identified by 'somepasswordofyourown';<\/pre>\n\n\n\n<ul><li>install wordpress<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">cd \/tmp &amp;&amp; wget https:\/\/wordpress.org\/latest.tar.gz\ntar xzf latest.tar.gz -C \/var\/www\/html\/\nmkdir \/var\/www\/html\/wordpress\/uploads\nchown -R www-data.www-data \/var\/www\/html\/wordpress\/<\/pre>\n\n\n\n<ul><li>create \/etc\/apache2\/sites-available\/wordpress.conf file:<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;Directory \/var\/www\/html\/wordpress>\n    Options FollowSymLinks\n    AllowOverride Limit Options FileInfo\n    DirectoryIndex index.php\n    Order allow,deny\n    Allow from all\n&lt;\/Directory>\n&lt;Directory \/var\/www\/html\/wordpress\/wp-content>\n    Options FollowSymLinks\n    Order allow,deny\n    Allow from all\n&lt;\/Directory><\/pre>\n\n\n\n<ul><li>enable WordPress in apache2<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo apache2ctl configtest      # test syntax<\/code>\n<code>sudo a2ensite wordpress<\/code>\n<code>sudo a2enmod rewrite<\/code>\n<code>sudo systemctl restart apache2<\/code><\/pre>\n\n\n\n<ul><li>Initialize WordPress<ul><li>Open a browser and go to &#8220;http:\/\/&lt;server ip\/name>\/wordpress&#8221;<\/li><li>Enter site name, database name (&#8220;wordpress&#8221;), database user (&#8220;wp_admin&#8221;) and password.<\/li><li>You are done! Well, sort of.  The rest is about WordPress itself, which is another topic.<\/li><\/ul><\/li><\/ul>\n\n\n\n<h2>References<\/h2>\n\n\n\n<ul><li>Great one by Pankaj.  I discovered a little late.  Otherwise it would save me some trouble<ul><li> <a href=\"https:\/\/www.journaldev.com\/24954\/install-wordpress-on-ubuntu\">https:\/\/www.journaldev.com\/24954\/install-wordpress-on-ubuntu<\/a> <\/li><\/ul><\/li><li>By  <a href=\"https:\/\/www.digitalocean.com\/community\/users\/bboucheron\">Brian Boucheron<\/a>.  A little bit convoluted and confusing.  This is what I followed at the beginning<ul><li> <a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-wordpress-with-lamp-on-ubuntu-18-04\">https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-wordpress-with-lamp-on-ubuntu-18-04<\/a> <\/li><\/ul><\/li><\/ul>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>As I said in my Home Page, I finally spent some time and migrated my ancient homepage to WordPress, the most popular web hosting platform (>60% of web sites). However, quite contrarily to my expectations, the process is rather complicated. I went through quite a few hiccups, taking more than a couple of days, to &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/junsun.net\/wordpress\/2020\/03\/install-wordpress-on-ubuntu-18-04\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Install WordPress on Ubuntu 18.04&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[3],"tags":[29,30,16,28,27],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/junsun.net\/wordpress\/wp-json\/wp\/v2\/posts\/78"}],"collection":[{"href":"https:\/\/junsun.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/junsun.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/junsun.net\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/junsun.net\/wordpress\/wp-json\/wp\/v2\/comments?post=78"}],"version-history":[{"count":1,"href":"https:\/\/junsun.net\/wordpress\/wp-json\/wp\/v2\/posts\/78\/revisions"}],"predecessor-version":[{"id":79,"href":"https:\/\/junsun.net\/wordpress\/wp-json\/wp\/v2\/posts\/78\/revisions\/79"}],"wp:attachment":[{"href":"https:\/\/junsun.net\/wordpress\/wp-json\/wp\/v2\/media?parent=78"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/junsun.net\/wordpress\/wp-json\/wp\/v2\/categories?post=78"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/junsun.net\/wordpress\/wp-json\/wp\/v2\/tags?post=78"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}