Skip to content

Basic Information

Username in the environment Your HAMK username in Google format username@student.hamk.fi

Meaning Password
Username for the database dbadmin
Database phpmyadmin password root007-jsFcTe4u27FGZe4KpeYff
Database admin password root007-jsFcTe4u27FGZe4KpeYff
----------- -----------
Database name wordpress
Database username wordpress
Database password wordpress007-jsFcTe4u27FGZe4KpeYff
Database server localhost
----------- -----------
Wordpress username student
Wordpress Password root007-jsFcTe4u27FGZe4KpeYff
----------- -----------
Nextcloud username student
Nextcloud Password Read it from Mysql


SSH connection (already installed)

Bash
sudo apt install openssh-server
Update your linux system

Bash
sudo apt-get update 
sudo apt-get upgrade
sudo reboot

Alternative way : sudo apt update && sudo apt upgrade -y

Make sure that Google VM has all needed installations for the project. Note NANO is missing if you have a minimal installation.

Bash
sudo apt install nano cron bzip2 
sudo apt install lamp-server^

Checking the status of the Apache service


Bash
systemctl status apache2
Bash
Output:

 apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2022-03-01 16:08:19 UTC; 3 days ago
     Docs: https://httpd.apache.org/docs/2.4/
 Main PID: 2369 (apache2)
    Tasks: 2 (limit: 1153)
   Memory: 3.5M
   CGroup: /system.slice/apache2.service
           ├─2369 apache2: master process /usr/sbin/apache2 -k start
           └─2380 apache2: worker process

As this confirms, the service has started successfully. However, the best way to test this is to actually request a page from Apache.



Creating an admin user for the database, which allows us to log in to phpmyadmin.

Bash
sudo mysql
SELECT user,authentication_string,plugin,host FROM mysql.user;
CREATE USER 'dbadmin'@'localhost' IDENTIFIED BY 'root007-jsFcTe4u27FGZe4KpeYff';
--
GRANT ALL PRIVILEGES ON *.* TO 'dbadmin'@'localhost' WITH GRANT OPTION;

--
SELECT user,authentication_string,plugin,host FROM mysql.user;
FLUSH PRIVILEGES;
exit

Administration tools, i.e. phpmyadmin installation, if you don't create databases in the terminal

Bash
sudo apt install phpmyadmin


Note Fixing phpmyadmin **if** the apache2 configuration **was not** installed during the installation. DO NOT run for nothing, but understand what these commands do!!!

Bash
sudo cp /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf
sudo a2enconf phpmyadmin.conf
sudo service apache2 restart


Let's create a database for Wordpress

Creating a database from the command line (a example that doesn't work!!!)

Bash
< -------- I'm a model, you don't use me --------->

sudo mysql
SELECT user,authentication_string,plugin,host FROM mysql.user;                     

CREATE DATABASE databasename;
CREATE USER 'USER’'@'localhost' IDENTIFIED BY 'password';

GRANT ALL PRIVILEGES ON databasename.* TO "wordpressusername"@"hostname" -> IDENTIFIED BY "password";

FLUSH PRIVILEGES;
EXIT


Our installation

Bash
sudo mysql
SELECT user,authentication_string,plugin,host FROM mysql.user;

CREATE DATABASE wordpress;
CREATE USER 'wordpress'@'localhost' IDENTIFIED BY 'wordpress007-jsFcTe4u27FGZe4KpeYff';

GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpress'@'localhost' WITH GRANT OPTION;

SELECT user,authentication_string,plugin,host FROM mysql.user;
FLUSH PRIVILEGES;
exit