> For the complete documentation index, see [llms.txt](https://paul-gleason.gitbook.io/champlain-college-classes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://paul-gleason.gitbook.io/champlain-college-classes/sys-360-cloud-admin/labs/lab-2-2-ec2-web-server.md).

# Lab 2-2: EC2 Web Server

### When making VM:

When making VM make sure 80 and 443 are available to your ip in the security group you make.

**Submit: Screenshot of successful SSH connection to instance**

### Install httpd

```
sudo yum install httpd
sudo systemctl start httpd
```

**Submit: Screenshot of successful connection to web service from your workstation browser**

<figure><img src="/files/MAVophqKKo8zAZBXmAUO" alt=""><figcaption><p>Accidentally customized the webpage before taking this screenshot</p></figcaption></figure>

### Customize httpd:

customize httpd homepage at /var/www/index.html

**Submit: Screenshot of successful connection to your custom web page**

<figure><img src="/files/mitFzVfFPPbqWblyphgw" alt=""><figcaption></figcaption></figure>

### Creating new user:

```
sudo useradd paul
sudo passwd paul

# Allow non-key authentication ssh
# https://docs.aws.amazon.com/workspaces/latest/adminguide/connect-to-linux-workspaces-with-ssh.html
sudo sed -E -i 's|^#?(PasswordAuthentication)\s.*|\1 yes|' /etc/ssh/sshd_config
sudo sed -i '/^\s*ssh_pwauth:.*$/d' /etc/cloud/cloud.cfg
```

**Submit: Screenshot of successful ssh auth to server from your new user**

<figure><img src="/files/qM8ivz9cD2lGs8h2C5kC" alt=""><figcaption></figcaption></figure>

**Submit: Screenshot showing terminated instance**

<figure><img src="/files/m6SJIKtOsNSgGvrieKgS" alt=""><figcaption></figcaption></figure>
