sudo apt install mariadb-server mariadb-client<\/pre>\nOnce MariaDB is installed on your server, you can use the commands below to stop, start, and enable the MariaDB service.<\/p>\n
sudo systemctl stop mariadb.service\r\nsudo systemctl start mariadb.service\r\nsudo systemctl enable mariadb.service<\/pre>\nThe next command is optional. You can run the command if you want to secure your MariaDB server by disallowing remote root access, removing the test database, and setting a root password.<\/p>\n
sudo mysql_secure_installation<\/pre>\nWhen prompted, answer the questions below by following this guide.<\/p>\n
Enter current password for root (enter for none): Since no password is currently set, just press Enter once.<\/strong>\r\nSet root password? [Y\/n]: Y<\/strong>\r\nNew password: Enter your password<\/strong>\r\nRe-enter new password: Repeat your password<\/strong>\r\nRemove anonymous users? [Y\/n]: Y<\/strong>\r\nDisallow root login remotely? [Y\/n]: Y<\/strong>\r\nRemove test database and access to it? [Y\/n]: Y<\/strong>\r\nReload privilege tables now? [Y\/n]: Y<\/strong><\/pre>\nRestart the MariaDB server, so the changes will take effect.<\/p>\n
sudo systemctl restart mariadb.service<\/pre>\nYou should now be able to log in to your MariaDB server with the command:<\/p>\n
sudo mysql -u root -p<\/pre>\nThen type the password you created above to sign in. Once you are in the MariaDB shell, you can use the following command and create a database called owa_db<\/code> for the OWA application.<\/p>\nCREATE DATABASE owa_db;<\/pre>\nThen create a database user called owa_user<\/code> and replace Str0n9Pas$worD<\/code> with your own password.<\/p>\nCREATE USER 'owa_user'@'localhost' IDENTIFIED BY 'Str0n9Pas$worD';<\/pre>\nTo grant the user owa_user<\/code> with full access to the database owa_db<\/code>, run this command:<\/p>\nGRANT ALL ON owa_db.* TO 'owa_user'@'localhost' IDENTIFIED BY 'Str0n9Pas$worD' WITH GRANT OPTION;<\/pre>\nAgain, remember to change\u00a0Str0n9Pas$worD<\/code>\u00a0with the password that you used in the previous command.<\/p>\nNow you can use the flush privileges<\/code> command to reload the grant tables – after that is done, you can then exit from the MariaDB shell.<\/p>\nFLUSH PRIVILEGES;\r\nEXIT;<\/pre>\n<\/span>3. Install Apache2 HTTP Server on Ubuntu<\/span><\/h2>\nIn order to run OWA, you need a web server that will serve the webpages. Apache2 is among the most popular web servers in use, and in this tutorial, Apache2 is our choice of web server.<\/p>\n
Execute the following command to install Apache2:<\/p>\n
sudo apt install apache2<\/pre>\nUse the commands below to start, stop, and enable the Apache service:<\/p>\n
sudo systemctl stop apache2.service\r\nsudo systemctl start apache2.service\r\nsudo systemctl enable apache2.service<\/pre>\nTo confirm that Apache2 is installed properly, you can open your preferred web browser and type your server’s IP address or your domain (we assume that it is already pointed to your server) and you should be able to view the default welcome page of the Apache2 web server.<\/p>\n
<\/span>4. Install PHP 7.2 and Related Modules<\/span><\/h2>\nOWA requires PHP 5.2.x or higher – so, in this tutorial, we chose to use PHP version 7.2. However, PHP 7.2 may not be available in the pre-installed Ubuntu repositories – therefore, if you want to install and use this version of PHP, you will need to get it from a third-party repository. By running the commands below, you will add Ond\u0159ej Sur\u00fd\u2019s PPA, which has the version of PHP that we need:<\/p>\n
sudo apt-get install software-properties-common\r\nsudo add-apt-repository ppa:ondrej\/php<\/pre>\nThen, update and upgrade the PHP packages to PHP 7.2<\/p>\n
sudo apt update<\/pre>\nIf you want to install PHP 7.2 together with the modules that are required for running the OWA, then run this command:<\/p>\n
sudo apt install php7.2 libapache2-mod-php7.2 php7.2-common php7.2-curl php7.2-mbstring php7.2-xmlrpc php7.2-mysql php7.2-gd php7.2-xml php7.2-cli<\/pre>\n<\/span>5. Download and Install Open Web Analytics<\/span><\/h2>\nUse the commands below to change the directory to \/opt<\/code><\/strong> and download Open Web Analytics.<\/p>\ncd \/opt\r\nwget https:\/\/github.com\/padams\/Open-Web-Analytics\/archive\/1.6.2.zip<\/pre>\nUnzip the contents and move the files to the \/var\/www\/html\/owa<\/code><\/strong> directory:<\/p>\nunzip 1.6.2.zip\r\nsudo mv Open-Web-Analytics-1.6.2 \/var\/www\/html\/owa<\/pre>\nChange the permissions:<\/p>\n
sudo chown -R www-data:www-data \/var\/www\/html\/owa\/\r\nsudo chmod 755 \/var\/www\/html\/owa\/<\/pre>\n