{"id":5372,"date":"2016-01-18T20:25:29","date_gmt":"2016-01-18T18:25:29","guid":{"rendered":"http:\/\/www.karadere.com\/blog\/?p=5372"},"modified":"2016-01-18T20:25:29","modified_gmt":"2016-01-18T18:25:29","slug":"raspberry-pi-veya-ubuntu-phpmyadmin-kurulumu","status":"publish","type":"post","link":"https:\/\/www.karadere.com\/blog\/raspberry-pi-veya-ubuntu-phpmyadmin-kurulumu.html","title":{"rendered":"Raspberry pi veya ubuntu PHPMyAdmin kurulumu"},"content":{"rendered":"<div class=\"container\">\u00a0Raspberry pi veya ubuntu PHPMyAdmin kurulumu<\/div>\n<div class=\"container\"><\/div>\n<div class=\"container\">\n<h5><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-and-secure-phpmyadmin-on-ubuntu-14-04\" target=\"_blank\"><img decoding=\"async\" class=\"tutorial-image\" title=\"How To Install and Secure phpMyAdmin on Ubuntu 14.04\" src=\"https:\/\/community-cdn-digitalocean-com.global.ssl.fastly.net\/assets\/tutorials\/images\/large\/phpmyadmin_twitter.png?1433429495\" alt=\"How To Install and Secure phpMyAdmin on Ubuntu 14.04\" \/><\/a><\/h5>\n<h5 class=\"content-title\">Kaynak :\u00a0<a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-and-secure-phpmyadmin-on-ubuntu-14-04\" target=\"_blank\">https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-and-secure-phpmyadmin-on-ubuntu-14-04<\/a><\/h5>\n<h1 class=\"content-title\">How To Install and Secure phpMyAdmin on Rasperry Pi and\u00a0\u00a0Ubuntu 14.04<\/h1>\n<\/div>\n<div class=\"content-body tutorial-content tutorial-content-legacy\" data-growable-markdown=\"\">\n<h3 id=\"introduction\">Introduction<\/h3>\n<p>While many users need the functionality of a database management system like MySQL, they may not feel comfortable interacting with the system solely from the MySQL prompt.<\/p>\n<p><strong>phpMyAdmin<\/strong> was created so that users can interact with MySQL through a web interface. In this guide, we&#8217;ll discuss how to install and secure phpMyAdmin so that you can safely use it to manage your databases on Ubuntu 14.04.<\/p>\n<p><span class=\"note\"><strong>Note:<\/strong> phpMyAdmin can be installed automatically on your Droplet by adding <a href=\"http:\/\/do.co\/1Nt7AKT\">this script<\/a> to its User Data when launching it. Check out <a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/an-introduction-to-droplet-metadata\">this tutorial<\/a> to learn more about Droplet User Data.<br \/>\n<\/span><\/p>\n<div data-unique=\"prerequisites\"><\/div>\n<h2 id=\"prerequisites\">Prerequisites<\/h2>\n<p>Before you get started with this guide, you need to have some basic steps completed.<\/p>\n<p>First, we&#8217;ll assume that you are using a non-root user with sudo privileges, as described in steps 1-4 in the<a href=\"https:\/\/digitalocean.com\/community\/articles\/initial-server-setup-with-ubuntu-14-04\">initial server setup of Ubuntu 14.04<\/a>.<\/p>\n<p>We&#8217;re also going to assume that you&#8217;ve completed a LAMP (Linux, Apache, MySQL, and PHP) installation on your Ubuntu 14.04 server. If this is not completed yet, you can follow this guide on <a href=\"https:\/\/digitalocean.com\/community\/articles\/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-14-04\">installing a LAMP stack on Ubuntu 14.04<\/a>.<\/p>\n<p>Once you are finished with these steps, you&#8217;re ready to get started with this guide.<\/p>\n<div data-unique=\"step-one-\u2014-install-phpmyadmin\"><\/div>\n<h2 id=\"step-one-\u2014-install-phpmyadmin\">Step One \u2014 Install phpMyAdmin<\/h2>\n<p>To get started, we can simply install phpMyAdmin from the default Ubuntu repositories.<\/p>\n<p>We can do this by updating our local package index and then using the <code>apt<\/code> packaging system to pull down the files and install them on our system:<\/p>\n<pre class=\"code-pre \"><code>sudo apt-get update\nsudo apt-get install phpmyadmin\n<\/code><\/pre>\n<p>This will ask you a few questions in order to configure your installation correctly.<\/p>\n<div class=\"code-label notes-and-warnings warning\" title=\"Warning\">Warning<\/div>\n<p><span class=\"warning\">When the first prompt appears, apache2 is highlighted, but <strong>not<\/strong> selected. If you do not hit &#8220;SPACE&#8221; to select Apache, the installer will <em>not<\/em> move the necessary files during installation. Hit &#8220;SPACE&#8221;, &#8220;TAB&#8221;, and then &#8220;ENTER&#8221; to select Apache.<br \/>\n<\/span><\/p>\n<ul>\n<li>For the server selection, choose <strong>apache2<\/strong>.<\/li>\n<li>Select <strong>yes<\/strong> when asked whether to use <code>dbconfig-common<\/code> to set up the database<\/li>\n<li>You will be prompted for your database administrator&#8217;s password<\/li>\n<li>You will then be asked to choose and confirm a password for the <code>phpMyAdmin<\/code> application itself<\/li>\n<\/ul>\n<p>The installation process actually adds the phpMyAdmin Apache configuration file into the<code>\/etc\/apache2\/conf-enabled\/<\/code> directory, where it is automatically read.<\/p>\n<p>The only thing we need to do is explicitly enable the <code>php5-mcrypt<\/code> extension, which we can do by typing:<\/p>\n<pre class=\"code-pre \"><code>sudo php5enmod mcrypt\n<\/code><\/pre>\n<p>Afterwards, you&#8217;ll need to restart Apache for your changes to be recognized:<\/p>\n<pre class=\"code-pre \"><code>sudo service apache2 restart\n<\/code><\/pre>\n<p>You can now access the web interface by visiting your server&#8217;s domain name or public IP address followed by <code>\/phpmyadmin<\/code>:<\/p>\n<pre>http:\/\/<span class=\"highlight\">domain_name_or_IP<\/span>\/phpmyadmin\n<\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/assets.digitalocean.com\/articles\/phpmyadmin_1404\/login_screen.png\" alt=\"phpmyadmin login screen\" \/><\/p>\n<p>You can now log into the interface using the <code>root<\/code> username and the administrative password you set up during the MySQL installation.<\/p>\n<p>When you log in, you&#8217;ll see the user interface, which will look something like this:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/assets.digitalocean.com\/articles\/phpmyadmin_1404\/user_interface.png\" alt=\"phpmyadmin user interface\" \/><\/p>\n<div data-unique=\"step-two-\u2014-secure-your-phpmyadmin-instance\"><\/div>\n<h2 id=\"step-two-\u2014-secure-your-phpmyadmin-instance\">Step Two \u2014 Secure your phpMyAdmin Instance<\/h2>\n<p>We were able to get our phpMyAdmin interface up and running fairly easily. However, we are not done yet. Because of its ubiquity, phpMyAdmin is a popular target for attackers. We need to secure the application to help prevent unauthorized use.<\/p>\n<p>One of the easiest way of doing this is to place a gateway in front of the entire application. We can do this using Apache&#8217;s built-in <code>.htaccess<\/code> authentication and authorization functionalities.<\/p>\n<h3 id=\"configure-apache-to-allow-htaccess-overrides\">Configure Apache to Allow .htaccess Overrides<\/h3>\n<p>First, we need to enable the use of <code>.htaccess<\/code> file overrides by editing our Apache configuration file.<\/p>\n<p>We will edit the linked file that has been placed in our Apache configuration directory:<\/p>\n<pre class=\"code-pre \"><code>sudo nano \/etc\/apache2\/conf-available\/phpmyadmin.conf\n<\/code><\/pre>\n<p>We need to add an <code>AllowOverride All<\/code> directive within the <code>&lt;Directory \/usr\/share\/phpmyadmin&gt;<\/code>section of the configuration file, like this:<\/p>\n<pre>&lt;Directory \/usr\/share\/phpmyadmin&gt;\n    Options FollowSymLinks\n    DirectoryIndex index.php\n    <span class=\"highlight\">AllowOverride All<\/span>\n    . . .\n<\/pre>\n<p>When you have added this line, save and close the file.<\/p>\n<p>To implement the changes you made, restart Apache:<\/p>\n<pre class=\"code-pre \"><code>sudo service apache2 restart\n<\/code><\/pre>\n<h3 id=\"create-an-htaccess-file\">Create an .htaccess File<\/h3>\n<p>Now that we have enabled <code>.htaccess<\/code> use for our application, we need to create one to actually implement some security.<\/p>\n<p>In order for this to be successful, the file must be created within the application directory. We can create the necessary file and open it in our text editor with root privileges by typing:<\/p>\n<pre class=\"code-pre \"><code>sudo nano \/usr\/share\/phpmyadmin\/.htaccess\n<\/code><\/pre>\n<p>Within this file, we need to enter the following information:<\/p>\n<pre class=\"code-pre \"><code>AuthType Basic\nAuthName \"Restricted Files\"\nAuthUserFile \/etc\/phpmyadmin\/.htpasswd\nRequire valid-user\n<\/code><\/pre>\n<p>Let&#8217;s go over what each of these lines mean:<\/p>\n<ul>\n<li><strong>AuthType Basic<\/strong>: This line specifies the authentication type that we are implementing. This type will implement password authentication using a password file.<\/li>\n<li><strong>AuthName<\/strong>: This sets the message for the authentication dialog box. You should keep this generic so that unauthorized users won&#8217;t gain any information about what is being protected.<\/li>\n<li><strong>AuthUserFile<\/strong>: This sets the location of the password file that will be used for authentication. This should be outside of the directories that are being served. We will create this file shortly.<\/li>\n<li><strong>Require valid-user<\/strong>: This specifies that only authenticated users should be given access to this resource. This is what actually stops unauthorized users from entering.<\/li>\n<\/ul>\n<p>When you are finished, save and close the file.<\/p>\n<h3 id=\"create-the-htpasswd-file-for-authentication\">Create the .htpasswd file for Authentication<\/h3>\n<p>Now that we have specified a location for our password file through the use of the <code>AuthUserFile<\/code>directive within our <code>.htaccess<\/code> file, we need to create this file.<\/p>\n<p>We actually need an additional package to complete this process. We can install it from our default repositories:<\/p>\n<pre class=\"code-pre \"><code>sudo apt-get install apache2-utils\n<\/code><\/pre>\n<p>Afterward, we will have the <code>htpasswd<\/code> utility available.<\/p>\n<p>The location that we selected for the password file was &#8220;<code>\/etc\/phpmyadmin\/.htpasswd<\/code>&#8220;. Let&#8217;s create this file and pass it an initial user by typing:<\/p>\n<pre>sudo htpasswd -c \/etc\/phpmyadmin\/.htpasswd <span class=\"highlight\">username<\/span>\n<\/pre>\n<p>You will be prompted to select and confirm a password for the user you are creating. Afterwards, the file is created with the hashed password that you entered.<\/p>\n<p>If you want to enter an additional user, you need to do so <strong>without<\/strong> the <code>-c<\/code> flag, like this:<\/p>\n<pre>sudo htpasswd \/etc\/phpmyadmin\/.htpasswd <span class=\"highlight\">additionaluser<\/span>\n<\/pre>\n<p>Now, when you access your phpMyAdmin subdirectory, you will be prompted for the additional account name and password that you just configured:<\/p>\n<pre>http:\/\/<span class=\"highlight\">domain_name_or_IP<\/span>\/phpmyadmin\n<\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/assets.digitalocean.com\/articles\/phpmyadmin_1404\/apache_auth.png\" alt=\"phpMyAdmin apache password\" \/><\/p>\n<p>After entering the Apache authentication, you&#8217;ll be taken to the regular phpMyAdmin authentication page to enter your other credentials. This will add an additional layer of security since phpMyAdmin has suffered from vulnerabilities in the past.<\/p>\n<div data-unique=\"conclusion\">\u00a0Conclusion<\/div>\n<p>You should now have phpMyAdmin configured and ready to use on your Ubuntu 14.04 server. Using this interface, you can easily create databases, users, tables, etc., and perform the usual operations like deleting and modifying structures and data.<\/p>\n<p>To learn how to further secure your interactions with the server by encrypting your communication with SSL, check out our article on <a href=\"https:\/\/digitalocean.com\/community\/articles\/how-to-set-up-ssl-certificates-with-phpmyadmin-on-an-ubuntu-12-04-vps\">setting up SSL certificates with phpMyAdmin<\/a>.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u00a0Raspberry pi veya ubuntu PHPMyAdmin kurulumu Kaynak :\u00a0https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-and-secure-phpmyadmin-on-ubuntu-14-04 How To Install and Secure phpMyAdmin on Rasperry Pi and\u00a0\u00a0Ubuntu 14.04 Introduction While many users need the functionality of a database management system like MySQL, they may not feel comfortable interacting with the system solely from the MySQL prompt. phpMyAdmin was created so that users can interact [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":"","_links_to":"","_links_to_target":""},"categories":[2],"tags":[1343,1679,1680,1763,2120,2198],"class_list":["post-5372","post","type-post","status-publish","format-standard","hentry","category-2015-2016","tag-kurulumu","tag-phpmyadmin","tag-pi","tag-raspberry","tag-ubuntu","tag-veya","has-post-title","has-post-date","has-post-category","has-post-tag","has-post-comment","has-post-author",""],"aioseo_notices":[],"views":2095,"_links":{"self":[{"href":"https:\/\/www.karadere.com\/blog\/wp-json\/wp\/v2\/posts\/5372","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.karadere.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.karadere.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.karadere.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.karadere.com\/blog\/wp-json\/wp\/v2\/comments?post=5372"}],"version-history":[{"count":0,"href":"https:\/\/www.karadere.com\/blog\/wp-json\/wp\/v2\/posts\/5372\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.karadere.com\/blog\/wp-json\/wp\/v2\/media?parent=5372"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.karadere.com\/blog\/wp-json\/wp\/v2\/categories?post=5372"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.karadere.com\/blog\/wp-json\/wp\/v2\/tags?post=5372"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}