Server Ubuntu – III – PHPMyAdmin

What is PHPMyAdmin?

PhpMyAdmin is an open software source programmed in PHP and to manage MySQL databases, we will remember the name says it all, that in the chapter previous install MariaDB, but not passing anything, they were compatible. The reason why we install PHPMyAdmin is easy to manage our databases in a virtual way.

Databases are scheduled using SQL structures (not all, but if the majority) with PHPMyAdmin management is visual, and can also enter SQL commands, view tables as if it were a sheet of Excel and even export the data. It is a great tool to start working with them or even to be able to visualize the data and structures.

phpMyAdmin
phpMyAdmin

Installation

As up to now install the software is simple, a single command:

sudo apt-get install phpmyadmin

The first thing will indicate that server we are using, click on Apache and is continuing.

Then he tells us the password of the database (logical to be able to interact with it)

And finally asked us for a password to access and the confirmation of the same.

Modifying Apache for your operating

We must add a line in Apache.conf

sudo nano /etc/apache2/apache2.conf

As we all know nano is the Ubuntu text editor (one of them)

And add the following line

Include /etc/phpmyadmin/apache.conf

To let know you that we have installed this tool, finally reseteamos Apache.

sudo service apache2 restart
PhpMyAdmin example
PhpMyAdmin example

Security

Updating Apache

PhpMyAdmin has certain security problems which we will “tune” to make it a little safer.

First we will require installing some applications additional of Apache.

sudo apt-get install apache2-utils

Then we are going to configure Apache, recalls:

sudo nano /etc/phpmyadmin/apache.conf

And we seek the following sequence and add AllowOverrideAll

<Directory sr/share/phpmyadmin=""></Directory>
        Options FollowSymLinks
        DirectoryIndex index.php
        AllowOverride All
...
...

Configuring .htaccess

Configure the .htaccess file used to configure features in that directory.

sudo nano /usr/share/phpmyadmin/.htaccess

And add the following

AuthType Basic
AuthName "Restricted Files"
AuthUserFile /etc/apache2/.phpmyadmin.htpasswd
Require valid-user

Where:

  • AuthType: This directive selects the type of user authentication that you will use for a directory. Only Basic and Digest options are implemented currently. In order to function properly, this directive has to be accompanied by AuthName and Require directives, and directives such as AuthUserFile and AuthGroupFile to work.
  • AuthName: This directive specifies the domain name that is displayed to request authorization to access a directory. This domain name is shown to the client so that the user knows which user name and password to enter. AuthName takes only one argument; If the domain name contains a space, you must write in quotation marks. To work correctly, this directive must be used together with AuthType and Require directives, and directives such as AuthUserFile and AuthGroupFile to work.
  • AuthUserFile: The directory where the file is located.
  • Require valid-user: indicates that only registered users will have access to this place.

Create htpasswd

We are going to create the password file, to do this use the following command.

sudo htpasswd - c /etc/apache2/.phpmyadmin.htpasswd username

Instead of username the name you want.

It will ask you to enter the password for that user and we repeat it.

We restore Apache, remember

sudo service apache2 restart

We enjoy phpMyAdmin

The last us is simply access

http://Direcci on/phpmyadmin /

In my case

http://192.168.1.3/phpmyadmin/

More Info

 Previous  Index Top

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This site uses Akismet to reduce spam. Learn how your comment data is processed.