Your Own Server: Difference between revisions

m
(Updated wiki page for MX changes since 3.6.0 when page was created)
 
(5 intermediate revisions by the same user not shown)
# web server – there are various options listed below; beware "apache2" is huge as it is very complicated, but secure; other options consume fewer resources, and may be easier to use, but they will also be more restrictive
# PHP script - from [https://windows.php.net/download/] - this provides a way of controlling what SQL is run depending on other factors
# Database server - MySQL Community edition from [mysql.com] or MariaSQLMariaDB from [https://downloads.mariadb.org/].
# Integrating components like ‘’’phpMyAdmin’’ (there are alternatives) from [https://www.phpmyadmin.net/downloads/] which combines PHP and MySQL
 
There are a number of packages that combine all of these:
*If designed for Microsoft Windows and including Apache2, PHP, and either MariaSQLMariaDB or MySQL, the package is often described as ‘’’WAMP’’’
*If designed for UNIX (including Linux), then XAMP will include Apache2, PHP, and either MariaSQLMariaDB or MySQL
 
Obviously, there are other web servers, some come on their own, others come as a package.
I will first mention 3 possible web servers than can run on a Microsoft Windows personal computer (or server box):
#You might choose '''Apache 2''' as it is probably the most comprehensive, so if you have enough space on your PC, install it following instructions at the official site [https://httpd.apache.org/download.cgi] (or one of many other web sites that give instructions for installing apache2 on Microsoft Windows).
#You might choose ‘’’Uniform Server’’’, which is extremely simple as it comes as a package including PHP script, and MariaSQLMariaDB database in one package from [http://www.uniformserver.com/], although you may need to update to a newer release of PHP from [https://windows.php.net/download/] and a newer phpMyAdmin from [https://www.phpmyadmin.net/downloads/] as Uniform Server tends to issue upgrades very rarely.
#You might choose to install the Abyss web server from [aprelium.com]
 
 
 
=== Install MariaMariaDB database ===
 
MySQL database software is controlled by Oracle and not made available for inclusion in Raspberry Pi repository.
 
MariaSQLMariaDB is an alternative that has largely similar command syntax so is likely to work with code (like MX) designed to work with MySQL. Since the MX developer (Mark Crossley) actually uses Maria DBMariaDB, we can have plenty of confidence it is suitable.
 
To install this database server, we type <code>sudo apt install mariadb-server php-mysql -y</code>.
===Getting web and database servers ready for use===
 
We need to create a user for PhpMyAdmin (or adMiner or whatever) to access our database and another for Cumulus to use to access the database tables. At the moment our database access has the single '''root@localhost''' user we created when we installed MariaDB. The initial password was set then, and we need to use it to get access to MariDBMariaDB monitor where we can insert some SQL commands to create these two users.
 
Most tools, like PhpMyAdmin, on first start up will ask for username (here I choose "admin") and password, thereafter the tool should use same log-in (by default you see log-in screen each time you restart or if it is left idle for a long time), let us create a user called 'admin' for it.
 
As I type this, Cumulus MX has no exception handling if the username and password defined in the settings do not exist in the database, therefore in this situation it will crash out (with message press Enter to close).
 
 
=== Installing Adminer, or PhpMyAdmin ===
=== Restarting Web Server ===
 
After all these installs, we need to restart your web server (so it loads the PHP and MariaDB), if you have installed apache 2 do this by typing <code>sudo service apache2systemctl restart apache2</code> or (if we just want the Apache configuration reloaded) by typing <code>sudo systemctl reload apache2</code>. Similar commands apply for other web servers.
 
We will need to restart Apache (or whichever web server we installed) any time we change our php.ini files, database passwords, and anything else that is checked when the web server starts.