Installing PHP MyAdmin and MyWeb SQL

102 views
Skip to first unread message

hdig...@gmail.com

unread,
Jun 4, 2019, 11:48:51 AM6/4/19
to AtoM Users
Hello :

I'm a recent user of AtoM, and at work we faced with the need of manipulate the database with something more user-friendly than a commandline. For example, making backups.
For the non-sysadmins, this can be a bit complicated, so obvious candidates are PHP MYAdmin and MyWebSQL.

Many people have troubles running this together with an AtoM installation, so i want to share my experience with this community.


Enviroment :

Ubuntu server 16.04 LTS
Atom 2.4 running on nginx

It is possible to install these database managers within the same server that AtoM uses, but it is preferable to leave that server "clean" to run the system exclusively.
In our particular case, we use nginx as a server for AtoM.
The solution is to install in parallel another web server (Apache2) where PHP MyAdmin and MyWeb SQL will reside
For this, we need to install the Apache2 package but with the mod made to interpret PHP.
Prior to installation, uninstall the Apache server that Ubuntu brings by default if we decide to install it, and important point, STOP the nginx service. This is to avoid generating conflicts when starting the Apache2 service since both DEFAULT servers use port 80.


Once this is done, we install this package:

sudo apt-get install apache2 php libapache2-mod-php

(Remember that we are running PHP 7.2, so we do not specify any PHP version settings)

The next step is to change the Apache2 server port for another, to avoid overlapping with the nginx server that hosts our AtoM.
We edit the file /etc/apache2/ports.conf:

 sudo nano /etc/apache2/ports.conf

 And we change in the line where it says "Listen" the port to our liking, in this case we use the 333:




# If you just change the port or add more ports here, you will likely also

# have to change the VirtualHost statement in

# /etc/apache2/sites-enabled/000-default.conf

 

Listen 333

 

<IfModule ssl_module>

      Listen 443

</IfModule>

 

<IfModule mod_gnutls.c>

      Listen 443

</IfModule>

 

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet



We save the file and proceed to edit the following:

 sudo nano /etc/apache2/sites-enabled/000-default.conf

And we change the port also in the first line:



<VirtualHost _default_:333>

      # The ServerName directive sets the request scheme, hostname and port that

      # the server uses to identify itself. This is used when creating

      # redirection URLs. In the context of virtual hosts, the ServerName

      # specifies what hostname must appear in the request's Host: header to

      # match this virtual host. For the default virtual host (this file) this

      # value is not decisive as it is used as a last resort host regardless.

      # However, you must set it for any further virtual host explicitly.

      #ServerName www.example.com

 

      ServerAdmin webmaster@localhost

        DocumentRoot /var/www/html

 

      # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,

      # error, crit, alert, emerg.

      # It is also possible to configure the loglevel for particular

      # modules, e.g.

      #LogLevel info ssl:warn

 

      ErrorLog ${APACHE_LOG_DIR}/error.log

      CustomLog ${APACHE_LOG_DIR}/access.log combined

ServerName AtoM

 

      # For most configuration files from conf-available/, which are

      # enabled or disabled at a global level, it is possible to

      # include a line for only one particular virtual host. For example the

      # following line enables the CGI configuration for this host only

      # after it has been globally disabled with "a2disconf".

      #Include conf-available/serve-cgi-bin.conf

</VirtualHost>

 

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet



Once this is done, we proceed to restart the service:

sudo systemctl restart apache2.service


Now, we only need to download the PHP MY Admin package from its official site, and using Win SCP copy it to the path / var / www / html having previously decompressed it.
We do not use the option to install using sudo apt-get install phpmyadmin since for different reasons it is not functional.
Once these files are copied, we restart the Apache2 server again:

sudo systemctl restart apache2.service

And we can access PHP My Admin from any browser of any workstation in the local network using:

http: // (ip of my server): 333

(let's modify the port for which we had chosen when configuring the Apache if it is different)


We can optionally install My Web SQL that presents some functionalities different from PHP MY Admin.
We simply download the package, unzip it and copy it to the same PHP My Admin directory.
We do this instead of creating a Virtual Host in Apache for convenience, since it will be accessible under the same port as PHP My Admin but another directory, therefore, to access we use:

http: // ip-server: 333 / MyWebSQL /

Once this is done, we proceed to restart the nginx service that we had stopped:

sudo systemctl restart nginx

That's all!

Mario Villar-Corbo
SysAdmin
Radiodifusión Nacional
Uruguay

David at Artefactual

unread,
Jun 5, 2019, 1:27:08 PM6/5/19
to AtoM Users
Hi Mario,

Thanks for sharing this with the community!  I'm sure many institutions will find it interesting and helpful.

Best regards,
David Juhasz
Senior Developer

Artefactual Systems Inc.
www.artefactual.com

Reply all
Reply to author
Forward
0 new messages