The App

Enter min and max numbers for generation

Retrieve a number by id

Generate numbers

How it works

You need to enter the minimum and maximum values for generating random numbers and click on ‘Generate numbers’.

For example, if you enter 2 and 10 respectively, nine random numbers will be generated and nine rows will be written to the table, where 'id' will be from 1 to 9. The previous generation will be removed.

To get a number, you need to enter any 'id' from 1 to 9 in the 'Retrieve a number by id' field. The script will start working if you enter at least one digit.

Web server set up process

Set Up apache2
sudo apt update sudo apt install apache2

Enable Firewall management tool sudo apt install ufw sudo ufw enable

Allow Apache Full (opens 80 и 443 ports) sudo ufw allow 'Apache Full'

Open SSH sudo ufw allow 'OpenSSH'

Disable directory listing and enable AllowOverride sudo nano /etc/apache2/apache2.conf In /etc/apache2/apache2.conf set as follows Options FollowSymLinks AllowOverride All Require all granted

Restart apache sudo systemctl restart apache2

Turn on mod_rewrite sudo a2enmod rewrite sudo systemctl restart apache2

Set Up MySQL Server sudo apt install mysql-server sudo systemctl restart apache2

Check if MySQL Server is active sudo systemctl status mysq

Set Up PHP sudo apt install php libapache2-mod-php php-mysql sudo systemctl restart apache2

Check PHP version php -v

Set Up phpMyAdmin sudo apt install php-mbstring -y sudo apt install phpmyadmin -y Or sudo apt install phpmyadmin php-mbstring php-zip php-gd php-json php-curl

To show phpMyAdmin page in browser sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf sudo a2enconf phpmyadmin.conf sudo systemctl restart apache2

Check if OK http://your_domain_or_IP/phpmyadmin

Configuring Password Access for the MySQL Root Account sudo mysql SELECT user,authentication_string,plugin,host FROM mysql.user; ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'your_password';

Check if OK http://your_domain_or_IP/