We can Start, Restart, or Stop apache web server by using service, systemctl or apache2ctl commands. Below given point needed to be consideration
1. service command works with most of the linux distributions including Ubuntu.
2. systemctl command is used to start Apache2 on Ubuntu Linux LTS 16.04 LTS or the latest system based Ubuntu Linux
We use below commands
a) $ sudo systemctl start apache2.service for starting the apache2 web server
b) $ sudo systemctl stop apache2.service for stoping the apache2 web server
But in the given snippet of code command used to start apache2 is wrong
root@ubuntu:~# systemctl start apache2
instead of
root@ubuntu:~# systemctl start apache2.service
3. In case of SSH acording to given snippet of code ufw enabled for receiving the request from port no 80/tcp and both for ipv4 and ipv6 protocol, we used the port no 80 for receiving the request from http protocol only. For enable SSH run the below command in terminal for allow SSH connection.
sudo ufw allow 22/tcp
*Make sure if SSH default port is not chaged. Otherwise use the changed port number instead of 22.
After doing the above changes in the above snippet the SSH and apache will be available.
Course : Unix system administration Please review the history snippet of code and make suggestions as...