{"id":1937,"date":"2016-06-15T13:17:14","date_gmt":"2016-06-15T17:17:14","guid":{"rendered":"https:\/\/www.globo.tech\/learning-center\/?p=1937"},"modified":"2017-04-19T15:59:02","modified_gmt":"2017-04-19T19:59:02","slug":"install-secure-phpmyadmin-ubuntu-16","status":"publish","type":"post","link":"https:\/\/www.globo.tech\/learning-center\/install-secure-phpmyadmin-ubuntu-16\/","title":{"rendered":"How to Install &#038; Secure PHPMyAdmin on Ubuntu 16"},"content":{"rendered":"<p>Most PHP applications use the MySQL database. Direct database access is particularly helpful when developing or upgrading a Website, but the default command line interface can be tricky to use. PHPMyAdmin is a great web-based database administration tool, but installing it securely is imperative to its use, since it gives complete access to a database&#8217;s contents.<\/p>\n<h2>Getting Started with PHPMyAdmin<\/h2>\n<p>To complete this guide, you will need the following:<br \/>\n\u2022 1 Node (<a href=\"https:\/\/www.globo.tech\/cloud-server-pricing\" target=\"_blank\">Cloud Server<\/a> or <a href=\"http:\/\/www.globo.tech\/dedicated-server-hosting\" target=\"_blank\">Dedicated Server<\/a>) with Ubuntu 16.04 and a LAMP stack previously installed.<\/p>\n<h2>Tutorial<\/h2>\n<p>Use the following commands to install and update PHPMyAdmin.<\/p>\n<p><code> apt-get update<br \/>\n apt-get install phpmyadmin<\/code><\/p>\n<p>During this process, a window will appear asking you to choose between Apache2 or Lighttpd. Choose Apache2.<\/p>\n<p>You&#8217;ll also be asked for your MySQL root password. This was set when you configured the initial LAMP stack. If you don&#8217;t remember it, you&#8217;ll need to rerun the MySQL server configuration and set a new password.<\/p>\n<p>You&#8217;ll also be prompted for a PHPMyAdmin password. This should differ from your MySQL and server passwords, and will grant access to the application itself.<\/p>\n<p>We next need to enable some additional PHP modules.<\/p>\n<p><code> phpenmod mcrypt<br \/>\n phpenmod mbstring<\/code><\/p>\n<p>Once done, restart the Apache server so the configuration changes go into effect.<\/p>\n<p><code> systemctl restart apache2<\/code><\/p>\n<p>Your installation should now be available at http:\/\/your_ip\/phpmyadmin. We&#8217;re not quite done, however.<\/p>\n<p>It is necessary to secure the directory against a few common attacks. To start, let&#8217;s edit \/etc\/apache2\/conf-available\/phpmyadmin.conf, adding the following directive:<\/p>\n<p><code> nano \/etc\/apache2\/conf-available\/phpmyadmin.conf<br \/>\n <Directory \/usr\/share\/phpmyadmin><br \/>\n    Options FollowSymLinks<br \/>\n    DirectoryIndex index.php<br \/>\n    AllowOverride All <--------------- The line you need to add<\/code><\/p>\n<p>After saving the file and exiting the editor, restart the Apache server once more.<\/p>\n<p><code> systemctl restart apache2<\/code><\/p>\n<p>A .htaccess file is also required to secure the installation. Edit \/usr\/share\/phpmyadmin\/.htaccess with the following content:<\/p>\n<p><code> nano \/usr\/share\/phpmyadmin\/.htaccess<br \/>\nAuthType Basic<br \/>\nAuthName \"Restricted Files\"<br \/>\nAuthUserFile \/etc\/phpmyadmin\/.htpasswd<br \/>\nRequire valid-user<\/code><\/p>\n<p>Save and exit.<\/p>\n<p>If you're on Ubuntu 14, you have one additional step to perform. Type the following to install the necessary package:<\/p>\n<p><code> apt-get install apache2-utils<\/code><\/p>\n<p>Then use this command to set the authentication password for the user named \"admin\":<\/p>\n<p><code> htpasswd -c \/etc\/phpmyadmin\/.htpasswd admin<\/code><\/p>\n<p>Use the same command to add additional users.<\/p>\n<p>Your new installation can be found at http:\/\/your_ip\/phpmyadmin. Enter your username and password when the browser window prompts for it. You'll then be redirected to a setup screen where you will log into MySQL.<\/p>\n<h2>Conclusion<\/h2>\n<p>You now have an easy, secure way of administering MySQL databases. MySQL is used heavily in the PHP ecosystem, and a good PHPMyAdmin installation is invaluable to any PHP administrator. If this guide was helpful to you, kindly share it with others who may also be interested. <\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>Most PHP applications use the MySQL database. Direct database access is particularly helpful when developing or upgrading a Website, but the default command line interface can be tricky to use. PHPMyAdmin is a great web-based database administration tool, but installing it securely is imperative to its use, since it gives complete access to a database&#8217;s<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":3,"featured_media":2156,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[61,50],"tags":[],"class_list":["post-1937","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-database","category-tutorials","operating_system-ubuntu-16-04"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Install &amp; Secure PHPMyAdmin on Ubuntu 16 - Globo.Tech<\/title>\n<meta name=\"description\" content=\"This tutorial will show you how to install and secure PHPMyAdmin on your Ubuntu 16.04 server. Read now &amp; Enjoy this database administration tool !\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.globo.tech\/learning-center\/install-secure-phpmyadmin-ubuntu-16\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Install &amp; Secure PHPMyAdmin on Ubuntu 16 - Globo.Tech\" \/>\n<meta property=\"og:description\" content=\"This tutorial will show you how to install and secure PHPMyAdmin on your Ubuntu 16.04 server. Read now &amp; Enjoy this database administration tool !\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.globo.tech\/learning-center\/install-secure-phpmyadmin-ubuntu-16\/\" \/>\n<meta property=\"og:site_name\" content=\"Globo.Tech\" \/>\n<meta property=\"article:published_time\" content=\"2016-06-15T17:17:14+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-04-19T19:59:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/06\/Code.png\" \/>\n\t<meta property=\"og:image:width\" content=\"500\" \/>\n\t<meta property=\"og:image:height\" content=\"333\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"GloboTech Communications\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"GloboTech Communications\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/install-secure-phpmyadmin-ubuntu-16\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/install-secure-phpmyadmin-ubuntu-16\\\/\"},\"author\":{\"name\":\"GloboTech Communications\",\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/#\\\/schema\\\/person\\\/e17784b37f4a4f49b7bc611847912e87\"},\"headline\":\"How to Install &#038; Secure PHPMyAdmin on Ubuntu 16\",\"datePublished\":\"2016-06-15T17:17:14+00:00\",\"dateModified\":\"2017-04-19T19:59:02+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/install-secure-phpmyadmin-ubuntu-16\\\/\"},\"wordCount\":413,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/install-secure-phpmyadmin-ubuntu-16\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/wp-content\\\/uploads\\\/2016\\\/06\\\/Code.png\",\"articleSection\":[\"Database\",\"Tutorials\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/install-secure-phpmyadmin-ubuntu-16\\\/\",\"url\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/install-secure-phpmyadmin-ubuntu-16\\\/\",\"name\":\"How to Install & Secure PHPMyAdmin on Ubuntu 16 - Globo.Tech\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/install-secure-phpmyadmin-ubuntu-16\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/install-secure-phpmyadmin-ubuntu-16\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/wp-content\\\/uploads\\\/2016\\\/06\\\/Code.png\",\"datePublished\":\"2016-06-15T17:17:14+00:00\",\"dateModified\":\"2017-04-19T19:59:02+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/#\\\/schema\\\/person\\\/e17784b37f4a4f49b7bc611847912e87\"},\"description\":\"This tutorial will show you how to install and secure PHPMyAdmin on your Ubuntu 16.04 server. Read now & Enjoy this database administration tool !\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/install-secure-phpmyadmin-ubuntu-16\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/install-secure-phpmyadmin-ubuntu-16\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/install-secure-phpmyadmin-ubuntu-16\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/wp-content\\\/uploads\\\/2016\\\/06\\\/Code.png\",\"contentUrl\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/wp-content\\\/uploads\\\/2016\\\/06\\\/Code.png\",\"width\":500,\"height\":333,\"caption\":\"PHPMyAdmin Ubuntu 16.04\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/install-secure-phpmyadmin-ubuntu-16\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Install &#038; Secure PHPMyAdmin on Ubuntu 16\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/#website\",\"url\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/\",\"name\":\"Globo.Tech\",\"description\":\"Welcome to the Official Globo.Tech Learning Center\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/#\\\/schema\\\/person\\\/e17784b37f4a4f49b7bc611847912e87\",\"name\":\"GloboTech Communications\",\"sameAs\":[\"http:\\\/\\\/www.gtcomm.net\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Install & Secure PHPMyAdmin on Ubuntu 16 - Globo.Tech","description":"This tutorial will show you how to install and secure PHPMyAdmin on your Ubuntu 16.04 server. Read now & Enjoy this database administration tool !","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.globo.tech\/learning-center\/install-secure-phpmyadmin-ubuntu-16\/","og_locale":"en_US","og_type":"article","og_title":"How to Install & Secure PHPMyAdmin on Ubuntu 16 - Globo.Tech","og_description":"This tutorial will show you how to install and secure PHPMyAdmin on your Ubuntu 16.04 server. Read now & Enjoy this database administration tool !","og_url":"https:\/\/www.globo.tech\/learning-center\/install-secure-phpmyadmin-ubuntu-16\/","og_site_name":"Globo.Tech","article_published_time":"2016-06-15T17:17:14+00:00","article_modified_time":"2017-04-19T19:59:02+00:00","og_image":[{"width":500,"height":333,"url":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/06\/Code.png","type":"image\/png"}],"author":"GloboTech Communications","twitter_misc":{"Written by":"GloboTech Communications","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.globo.tech\/learning-center\/install-secure-phpmyadmin-ubuntu-16\/#article","isPartOf":{"@id":"https:\/\/www.globo.tech\/learning-center\/install-secure-phpmyadmin-ubuntu-16\/"},"author":{"name":"GloboTech Communications","@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87"},"headline":"How to Install &#038; Secure PHPMyAdmin on Ubuntu 16","datePublished":"2016-06-15T17:17:14+00:00","dateModified":"2017-04-19T19:59:02+00:00","mainEntityOfPage":{"@id":"https:\/\/www.globo.tech\/learning-center\/install-secure-phpmyadmin-ubuntu-16\/"},"wordCount":413,"commentCount":0,"image":{"@id":"https:\/\/www.globo.tech\/learning-center\/install-secure-phpmyadmin-ubuntu-16\/#primaryimage"},"thumbnailUrl":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/06\/Code.png","articleSection":["Database","Tutorials"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.globo.tech\/learning-center\/install-secure-phpmyadmin-ubuntu-16\/","url":"https:\/\/www.globo.tech\/learning-center\/install-secure-phpmyadmin-ubuntu-16\/","name":"How to Install & Secure PHPMyAdmin on Ubuntu 16 - Globo.Tech","isPartOf":{"@id":"https:\/\/www.globo.tech\/learning-center\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.globo.tech\/learning-center\/install-secure-phpmyadmin-ubuntu-16\/#primaryimage"},"image":{"@id":"https:\/\/www.globo.tech\/learning-center\/install-secure-phpmyadmin-ubuntu-16\/#primaryimage"},"thumbnailUrl":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/06\/Code.png","datePublished":"2016-06-15T17:17:14+00:00","dateModified":"2017-04-19T19:59:02+00:00","author":{"@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87"},"description":"This tutorial will show you how to install and secure PHPMyAdmin on your Ubuntu 16.04 server. Read now & Enjoy this database administration tool !","breadcrumb":{"@id":"https:\/\/www.globo.tech\/learning-center\/install-secure-phpmyadmin-ubuntu-16\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.globo.tech\/learning-center\/install-secure-phpmyadmin-ubuntu-16\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.globo.tech\/learning-center\/install-secure-phpmyadmin-ubuntu-16\/#primaryimage","url":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/06\/Code.png","contentUrl":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/06\/Code.png","width":500,"height":333,"caption":"PHPMyAdmin Ubuntu 16.04"},{"@type":"BreadcrumbList","@id":"https:\/\/www.globo.tech\/learning-center\/install-secure-phpmyadmin-ubuntu-16\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.globo.tech\/learning-center\/"},{"@type":"ListItem","position":2,"name":"How to Install &#038; Secure PHPMyAdmin on Ubuntu 16"}]},{"@type":"WebSite","@id":"https:\/\/www.globo.tech\/learning-center\/#website","url":"https:\/\/www.globo.tech\/learning-center\/","name":"Globo.Tech","description":"Welcome to the Official Globo.Tech Learning Center","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.globo.tech\/learning-center\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87","name":"GloboTech Communications","sameAs":["http:\/\/www.gtcomm.net"]}]}},"_links":{"self":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/1937","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/comments?post=1937"}],"version-history":[{"count":7,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/1937\/revisions"}],"predecessor-version":[{"id":2820,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/1937\/revisions\/2820"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/media\/2156"}],"wp:attachment":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/media?parent=1937"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/categories?post=1937"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/tags?post=1937"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}