Final challenge: your first server
Your coding club just got its own Linux server, and you're the one in charge. Nobody has touched it yet. By the end of today the club wants a website, an account for the new member, and a folder the team can share.
No step-by-step instructions this time. The objectives say what should be true when you're done, not which commands to type. Use anything from Linux Basics; the cheat sheet and the search (press /) are fair game. If you get stuck, the hints are below the terminal. Try it on Rocky and on Ubuntu: the goals are the same, the commands aren't.
The brief
- A website. The web server is installed, running right now, and starts by itself after a reboot.
- Reachable. The firewall lets web visitors in. (On Ubuntu, don't lock yourself out of SSH!)
- A welcome. The home page,
/var/www/html/index.html, greets visitors with the word Welcome. - A new member. Maria joined the club: she needs an account called
maria, with a home folder and a password so she can log in, and she's allowed to usesudo. - A team folder.
/srv/teambelongs to a group calledteam, with you and Maria in it. The team can create files there; everybody else can't even look inside.
Stuck? Hints
Open only as many as you need.
1. A website
The web server is called httpd on Rocky and apache2 on Ubuntu. Install it with the family's package manager, then look at systemctl status. One command can both start a service and make it start at boot.
2. Reachable
Rocky uses firewall-cmd (don't forget --permanent and --reload). Ubuntu uses ufw: allow SSH before you enable it, and allow Apache too.
Still stuck: lesson 14.
3. A welcome
Only root may write in /var/www/html. echo … | sudo tee FILE is one way; sudo nano FILE is another. Check your work with curl localhost.
4. A new member
Make sure the account gets a home folder, then give it a password (passwd, as root). The admin group is wheel on Rocky and sudo on Ubuntu; add Maria to it without removing her other groups (-aG).
5. A team folder
Create the group, add both of you, make the folder, then give it to the group. The permissions you want are: owner and group can do everything, others nothing. In numbers that's three digits, the last one a 0.
Still stuck: lesson 10.