Question
Course : Unix system administration
Please review the history snippet of code and make suggestions as to what went wrong (10pts ) - After the server reboots both SSH and Apache are unavailable. root@ubuntu. ~ # ufw status root@ubuntu. ~ # apt-get install apache2 root@ubuntu : ~# systemct1 start apache2 root@ubuntu.~# echo hello > /var/www/html/index.html root@ubuntu. ~# ufw allow 80/tcp root@ubuntu. ~# ufw-force enable root@ubuntu. ~ # ufw status Status: active Action From 80/tcp 80/tcp (v6) ALLOW Anywhere Anywhere (v6) ALLOW root@ubuntu.~# reboot
0 0
Add a comment Improve this question Transcribed image text
Answer #1

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.

Add a comment
Know the answer?
Add Answer to:
Course : Unix system administration Please review the history snippet of code and make suggestions as...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT