1. First I downloaded pwgen to help generate passwords.
sudo apt-get update && sudo apt-get install pwgen
2. Then I installed the LAMP stack
sudo apt-get install apache2 mysql-server
I input a password for the root user of the MySQL database, as per recommendation.
I checked if my version of Ubuntu (16.04) had php, because some versions come prepackaged with it:
This yielded no result, so I then installed php as well:
sudo apt-get install php
After this I checked again with which php and this time it yielded a result.
I restarted Apache and then checked to see if it was operational by going to localhost
3. Next I installed the SSH demon
sudo apt-get install ssh
I made sure there’s a firewall rule to allow access through port 22:
sudo ufw allow 22/tcp
sudo ufw enable
Opening a remote connection through Putty to test that SSH works.
4. Time to create some users!
First I generated some passwords
sudo pwgen 20 10
20 character passwords for 10 people, a few extras in case I need them.
I created the users using command:
sudo adduser maime
(3 letters from first name, 2 from surname, example here being Maika Meikäläinen)
Then I created one admin user.
5. Next I created some example webpages for all my non-privileged users.
6. Next one of my users wants to practice using LAMP so I made them a database.
I first logged into MySQL as root user:
mysql -u root -p
Then I granted privileges to my user:
GRANT ALL PRIVILEGES ON *.* TO ‘pekhu’@’localhost’ IDENTIFIED BY ‘strongpassword’;
Then I quit using \q and logged in as the user I just gave access to:
mysql -u pekhu -p
I proceeded to create the database:
CREATE DATABASE potaato;
I tried creating a few tables for the database using following examples:
CREATE TABLE pet (name VARCHAR(20), owner VARCHAR(20));
CREATE TABLE customers (id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, company VARCHAR(20), contact VARCHAR(20), phone VARCHAR(20));
Both of these went through but I could not find the tables with the ‘describe ‘tablename” command.
7. Next I made a command ‘wowstats’ like so:
Now I can access information about the computer cpu and and memory usage by typing ‘wowstats’. This will open htop, which I previously installed.