Making a server - JuniperRios/Sec-260-Notes GitHub Wiki

Connecting VMs

New VMs may not have a network adapter included. Without, the VM cannot connect.

While powered off, please select a VM > select Hardware > if there is no Network Device, then click Add & use its drop-down to select a Network Device. A config window appears.

For Bridge, use its drop-down to select the current Network Connection: i.e. choose SEC-260-01-WAN if you are in section 01 of SEC-260. For the Network Adapter Model, I recommend the E1000, and then click Add. Once the configure windows closes, then plz power on the VM.

=====

Installing a Simple Rocky OS Web Server

In Proxmox, select the Rocky VM (Proxmox Guide on Canvas Homepage) Power on VM, then login using default Champuser credentials (Canvas Homepage) To tidy up the OS a bit after logging in: Create a new user with its own password, which you will not forget: sudo useradd -m YourFirstName && sudo passwd YourFirstName

Add your new user to the wheel group (Rocky's "admin" group): sudo usermod -aG wheel YourFirstName

Change your root account's default password & do not forget it: sudo passwd root

Change your system's hostname permanently: sudo hostnamectl set-hostname YourLastNameVM

Moment of Truth … Type "exit" to close the login session and log out

Log back in with your new user account, and you should see your something similar to [NewAccount@Hostname ~]$ Set-up Apache/HTTPD

Via CLI, run “ip addr” to confirm you have an non-loopback IPv4 address (We'll use this IPv4 in a bit.) "ping -c1 google.com" to validate 0% packet lost for good measure #ZeroTrust

IF network connectivity was successful, then install Apache/httpd: dnf install -y httpd (may take a moment)

Enable the HTTP DaemonLinks to an external site. to start on boot && start the Apache service && check its status (1-liner!): sudo systemctl enable httpd && sudo systemctl start httpd && sudo systemctl status httpd | grep -i “active”

Look for the created symlink & the active (running) ... it's now ALIVE

Allow HTTP through the firewall: sudo firewall-cmd --permanent --add-port=80/tcp

Reload firewall config: sudo firewall-cmd --reload

Verify that firewall is open: sudo firewall-cmd --query-port=80/tcp (should report "yes")

Should you encounter issues, check Apache error logs for clues: sudo journalctl -u httpd

Testing your server

On the web server, let's curlLinks to an external site. it: curl -s http://Your_IP_Here | grep -i "powered by rocky linux"

Embracing our CLILinks to an external site. prowess further, let’s prepare Rocky to use applications like a web browser by installing some needed packages:

dnf install -y dnf-plugins-coreLinks to an external site.

dnf install -y epel-releaseLinks to an external site.

dnf config-managerLinks to an external site. --set-enabled crb

dnf update -y (this will take a bit, so launch and enjoy snack time)

dnf install -y lynxLinks to an external site.

Launch your Lynx web browser using your IPv4 address discovered earlier

lynx http://Your_IP_Here

Parse through the text, particularly the first two sentences

You should see an Apache default test page, via Lynx