Cloud infrastructure · Linux administration · DNS

Building and configuring the LinuxCat server.

A practical project documenting the deployment of an Ubuntu server on AWS EC2, secure SSH administration, domain integration, DNS investigation with BIND9, web-server configuration and cloud cost monitoring.

Ubuntu ServerAWS EC2SSH / ED25519 Namecheap DNSBIND9Nginx
linuxcat.siteProject domain
AWS EC2Cloud compute platform
UbuntuServer operating system
$10 / monthTarget budget
01 / OVERVIEW

Project overview

LinuxCat is a hands-on Linux and cloud infrastructure project. Its goal is to operate an Ubuntu server in AWS and make it accessible through a registered domain, while documenting the administration and troubleshooting process.

Primary objectives

Provision a cloud server, secure remote access, connect a domain, investigate DNS hosting and publish a website.

Learning objectives

Practise Linux service management, network diagnostics, DNS records, web-server configuration and AWS cost awareness.

Documentation note: This page separates confirmed observations from proposed configuration examples. A command or configuration shown here does not, by itself, prove that it was successfully deployed.
02 / DESIGN

Target architecture

Visitor / Administrator
↓
Internet
↓
Namecheap BasicDNS · linuxcat.site
↓ A record
AWS Elastic IP · 54.195.229.213
↓
AWS EC2 · Ubuntu Server
↓
SSH · TCP 22
DNS · UDP/TCP 53*
HTTP · TCP 80
HTTPS · TCP 443
↓
Administrator shell
BIND9*
Nginx / website

*BIND9 public authoritative service is a proposed/verification item. Namecheap BasicDNS is the DNS service confirmed in the project history.

03 / COMPUTE

AWS EC2 Ubuntu deployment

Ubuntu Server was launched as an Amazon EC2 instance. The instance provides the Linux environment for administration, DNS experimentation and web hosting.

  1. Sign in to the AWS Management Console and open EC2.
  2. Select Launch instances and name the instance LinuxCat.
  3. Choose an Ubuntu Server AMI and an appropriate instance type.
  4. Configure the key pair, VPC, subnet and security group.
  5. Allow only the required inbound traffic and launch the instance.
  6. Connect using the Ubuntu account and the configured SSH private key.

IP addresses encountered

AddressContext
54.195.229.213Elastic IP selected as the intended stable public endpoint.
172.31.30.183Private IPv4 address observed in the AWS environment.
3.249.193.58Earlier public IP observed during setup.
54.74.135.207Public IP used in an SSH connection attempt.
172.31.18.18Private address used in a connection attempt that timed out.

Other public IPs appeared in earlier troubleshooting. Public addresses can change when an instance is stopped and started unless an Elastic IP is attached. Confirm the current instance and address in AWS before using them.

04 / ACCESS

Secure SSH administration

Generate an ED25519 key pair

ssh-keygen -t ed25519 -f ~/.ssh/aws-ubuntu

The private key is ~/.ssh/aws-ubuntu; the public key is ~/.ssh/aws-ubuntu.pub. Keep the private key secret and copy only the public key to the server.

Configure server-side permissions

mkdir -p ~/.ssh
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
sudo chown -R ubuntu:ubuntu /home/ubuntu/.ssh

Connect to the EC2 instance

ssh -i ~/.ssh/aws-ubuntu ubuntu@54.195.229.213

Create a convenient SSH alias

vim ~/.ssh/config
Host linuxcat
    HostName 54.195.229.213
    User ubuntu
    Port 22
    IdentityFile ~/.ssh/aws-ubuntu
chmod 600 ~/.ssh/config
ssh linuxcat

The same private key must be securely available to the client machine (for example, the Ubuntu UTM VM) if it is to connect using this method.

SSH troubleshooting: Permission denied (publickey) usually points to a username, key, permissions or authorized_keys issue. A timeout usually points to reachability, routing or security-group rules rather than an incorrect key.

Password authentication investigation

sudo passwd ubuntu
sudo vim /etc/ssh/sshd_config
PasswordAuthentication yes
PubkeyAuthentication yes
sudo sshd -t
sudo systemctl restart ssh

Password login was explored, but successful password-based access was not confirmed. Prefer SSH keys and avoid enabling password authentication unless there is a clear operational need.

05 / NETWORK SECURITY

AWS security group

Security groups act as stateful virtual firewalls for EC2. The intended inbound rules are:

ServiceProtocolPortRecommended source
SSHTCP22Administrator public IP /32
HTTPTCP800.0.0.0/0 (public website)
HTTPSTCP4430.0.0.0/0 (public website)
DNSUDP + TCP53Only if intentionally operating public DNS

In the AWS Console: EC2 → Instances → select LinuxCat → Security → security group → Edit inbound rules.

Do not expose SSH to the whole internet unless necessary. Restrict port 22 to a trusted source address. DNS port 53 should only be opened if BIND9 is intentionally configured to serve external clients.
06 / STABLE ADDRESS

Elastic IP allocation

An Elastic IP provides a stable public IPv4 address for the EC2 instance. The project recorded 54.195.229.213 as the intended LinuxCat endpoint.

  1. Open EC2 → Network & Security → Elastic IPs.
  2. Choose Allocate Elastic IP address.
  3. Select the allocated address and choose Associate Elastic IP address.
  4. Select the LinuxCat instance and the appropriate private IP, then associate it.
  5. Verify the address in the EC2 instance details and test connectivity.

An allocated but unused Elastic IP may incur charges. Review current AWS public IPv4 pricing and release addresses that are no longer needed.

07 / DOMAIN

Connecting linuxcat.site

The domain was registered through Namecheap and used Namecheap BasicDNS. The nameservers observed were:

dns1.registrar-servers.com
dns2.registrar-servers.com

Configure the root A record

TypeHostValue
A@54.195.229.213

In Namecheap: Domain List → Manage → Advanced DNS → Host Records. Set the root host (@) to the Elastic IP.

Optional www alias

TypeHostValue
CNAMEwwwlinuxcat.site

Verify DNS records

dig @8.8.8.8 linuxcat.site A
dig @8.8.8.8 linuxcat.site NS
dig @8.8.8.8 www.linuxcat.site
nslookup linuxcat.site
nslookup linuxcat.site 8.8.8.8

A successful public DNS response was observed for the root domain, returning 54.195.229.213 from Google's resolver. The NS lookup returned the Namecheap registrar nameservers.

A successful A-record lookup proves that DNS resolves to the configured IP. It does not prove that the EC2 server is reachable or that a website is running on ports 80/443.
08 / DNS SERVICE

BIND9 installation and zone configuration

BIND9 was investigated as DNS server software for hosting an authoritative zone. Installing BIND9 on EC2 does not automatically make it authoritative for linuxcat.site; public DNS delegation must also point to the BIND nameservers.

Install packages

sudo apt update
sudo apt install bind9 bind9-utils dnsutils -y
named -v
sudo systemctl status bind9

Important configuration files

FilePurpose
/etc/bind/named.confMain BIND configuration
/etc/bind/named.conf.optionsGlobal options and access policy
/etc/bind/named.conf.localLocal zone declarations
/etc/bind/db.linuxcat.siteLinuxCat zone data file

Declare the zone

sudo vim /etc/bind/named.conf.local
zone "linuxcat.site" {
    type master;
    file "/etc/bind/db.linuxcat.site";
};

Example zone file

sudo vim /etc/bind/db.linuxcat.site
$TTL 86400

@ IN SOA ns1.linuxcat.site. admin.linuxcat.site. (
    2026110801
    3600
    1800
    604800
    86400
)

@   IN NS    ns1.linuxcat.site.
ns1 IN A     54.195.229.213
@   IN A     54.195.229.213
www IN CNAME linuxcat.site.

This is an illustrative starting point, not evidence that the zone was deployed. A production authoritative setup needs suitable nameserver hostnames, glue records where required, delegation at the registrar, correct firewall rules, and a reliable DNS design. Do not point public delegation at this server until it is correctly configured and tested.

Validate and test

sudo named-checkconf
sudo named-checkzone linuxcat.site /etc/bind/db.linuxcat.site
sudo systemctl restart bind9
sudo systemctl status bind9
dig @127.0.0.1 linuxcat.site A

systemd enable error encountered

sudo systemctl enable bind9
Failed to enable unit: Refusing to operate on linked unit file bind9.service

Investigate the installed unit and alias rather than forcing the operation:

systemctl list-unit-files | grep -E 'bind|named'
systemctl status bind9
systemctl status named
09 / WEB HOSTING

Apache2 and Nginx

Nginx was reported as running. Apache2 was also investigated, including its environment configuration. Both commonly listen on TCP port 80, so they should not compete for the same address and port.

Apache2

Configuration directory: /etc/apache2/
Environment file: /etc/apache2/envvars

Nginx

Main config: /etc/nginx/nginx.conf
Default site: /etc/nginx/sites-available/default

Install and inspect Apache2

sudo apt update
sudo apt install apache2 -y
sudo systemctl status apache2
sudo apache2ctl configtest
sudo apache2ctl -S

Inspect Apache environment variables

sudo vim /etc/apache2/envvars

Variables such as APACHE_RUN_DIR, APACHE_PID_FILE, APACHE_RUN_USER, APACHE_RUN_GROUP and APACHE_LOG_DIR define Apache's runtime and logging environment. On Ubuntu, manage Apache through systemd and the packaged control utilities rather than launching the daemon manually without its expected environment.

Manage Nginx

sudo systemctl status nginx
sudo systemctl start nginx
sudo systemctl enable nginx
sudo nginx -t
sudo systemctl restart nginx

Example LinuxCat Nginx server block

server {
    listen 80;
    listen [::]:80;

    server_name linuxcat.site www.linuxcat.site;

    root /var/www/linuxcat;
    index index.html index.htm;

    location / {
        try_files $uri $uri/ =404;
    }
}

Create a simple test website

sudo mkdir -p /var/www/linuxcat
sudo vim /var/www/linuxcat/index.html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>LinuxCat</title>
</head>
<body>
  <h1>Welcome to LinuxCat</h1>
  <p>LinuxCat Linux Server Project</p>
</body>
</html>
sudo chown -R www-data:www-data /var/www/linuxcat
sudo find /var/www/linuxcat -type d -exec chmod 755 {} \;
sudo find /var/www/linuxcat -type f -exec chmod 644 {} \;
sudo nginx -t
sudo systemctl restart nginx

If using a separate site file, create it under /etc/nginx/sites-available/linuxcat and enable it with a symlink in /etc/nginx/sites-enabled/. The example above is a suggested configuration, not a verified deployed site.

Check for port conflicts

sudo ss -tulpn | grep ':80'
sudo systemctl stop apache2
sudo systemctl disable apache2

Only stop and disable Apache2 if Nginx is the chosen web server and Apache2 is not needed. Alternatively, configure a deliberate reverse-proxy arrangement.

10 / OPERATIONS

Network and service troubleshooting

Observed symptomLikely area to investigateUseful checks
Permission denied (publickey)SSH username, private key, key permissions, authorized_keysssh -v, chmod, server auth logs
Connection timed outSecurity group, route, public/private IP, network ACLnc -zv, ip route, AWS console
Connection refusedService not listening, wrong port, local firewallss -tulpn, systemctl status
DNS NXDOMAINRecord missing, wrong zone or delegationdig, dig NS
DNS timeoutResolver connectivity, firewall, DNS servicedig @8.8.8.8, ss -tulpn
Web server won't startPort conflict or invalid configurationnginx -t, apache2ctl configtest

General diagnostic commands

ip addr
ip route
hostname -I
ping -c 4 8.8.8.8
ping -c 4 linuxcat.site
traceroute linuxcat.site
curl -4 ifconfig.me
sudo ufw status
sudo journalctl -xe

Check listening ports

sudo ss -tulpn

-t TCP · -u UDP · -l listening · -p process · -n numeric output.

11 / COST CONTROL

AWS billing and monitoring

The project target is to keep AWS expenditure visible and aim for a monthly budget of $10. This is a budget target, not a guaranteed maximum charge.

Create a monthly AWS budget

  1. Open Billing and Cost Management → Budgets.
  2. Create a cost budget with a monthly period.
  3. Set the budget amount to 10 USD.
  4. Configure alert thresholds, for example 50%, 80% and 100%.
  5. Add an email notification recipient and create the budget.

Suggested daily review metrics

MetricWhat to monitor
EC2 usageInstance state and running hours
Compute costEstimated EC2 charges
Elastic IP / public IPv4Allocation, association and applicable charges
Data transferOutbound traffic and related charges
Budget consumptionActual and forecast spend against $10

Useful AWS services include Cost Explorer, AWS Budgets and CloudWatch. A daily dashboard or report requires additional configuration; creating a budget alone does not create a complete daily report.

AWS Budgets sends alerts but does not automatically stop resources or cap spending. Check current pricing for the selected region and instance type.
12 / DELIVERY

Project status and next steps

This status is based on the available project conversation and configuration notes. It is not a live inspection of the AWS account or server.

ComponentStatusEvidence / next action
EC2 Ubuntu instanceCreatedInstance deployment discussed and used.
SSH key authenticationConfiguredED25519 key and SSH connection workflow documented.
Elastic IPAllocated54.195.229.213 recorded as intended stable endpoint.
Namecheap domain / BasicDNSConfiguredRegistrar nameservers and root A lookup observed.
www CNAMEVerifyCheck dig www.linuxcat.site.
BIND9 installationVerifyCheck installed packages and service status.
BIND9 public authorityNot verifiedComplete zone, nameserver delegation and external tests if required.
NginxReported runningVerify current service and site configuration.
Apache2InvestigatedCheck whether installed or required; avoid port conflict.
HTTPS / TLSVerifyInstall and test a certificate for root and www hostnames.
$10 AWS budgetVerifyConfirm budget and notification thresholds in Billing.
Daily reportingVerifyConfigure a report or dashboard schedule.

Recommended completion checklist

  • Confirm the current EC2 instance and Elastic IP association.
  • Confirm SSH access using the linuxcat alias.
  • Confirm root and www DNS records.
  • Choose whether DNS remains with Namecheap or moves to a self-hosted authoritative BIND9 service.
  • Choose one web-server architecture and verify the site responds over HTTP.
  • Configure HTTPS and test certificate renewal.
  • Confirm AWS budget alerts and cost reporting.
13 / QUICK REFERENCE

LinuxCat command reference

System update and packages

sudo apt update && sudo apt upgrade -y
sudo apt install bind9 bind9-utils dnsutils -y
sudo apt install nginx -y
sudo apt install apache2 -y

SSH

ssh-keygen -t ed25519 -f ~/.ssh/aws-ubuntu
chmod 700 ~/.ssh
chmod 600 ~/.ssh/aws-ubuntu
chmod 600 ~/.ssh/config
ssh -i ~/.ssh/aws-ubuntu ubuntu@54.195.229.213
ssh linuxcat

DNS and BIND9

dig @8.8.8.8 linuxcat.site A
dig @8.8.8.8 linuxcat.site NS
dig @8.8.8.8 www.linuxcat.site
nslookup linuxcat.site
sudo named-checkconf
sudo named-checkzone linuxcat.site /etc/bind/db.linuxcat.site
sudo systemctl status bind9

Web services

sudo nginx -t
sudo systemctl status nginx
sudo systemctl restart nginx
sudo apache2ctl configtest
sudo systemctl status apache2
sudo systemctl restart apache2
curl -I http://linuxcat.site
curl -I https://linuxcat.site

Network diagnostics

ip addr
ip route
hostname -I
curl -4 ifconfig.me
sudo ss -tulpn
sudo ss -tulpn | grep ':80'
nc -zv 54.195.229.213 22
ping -c 4 8.8.8.8
traceroute linuxcat.site
sudo ufw status
sudo journalctl -xe
Project summary

Learn by building. Document what works.

LinuxCat brings together practical Linux administration and cloud infrastructure skills: provisioning an Ubuntu host, securing remote access, managing DNS, configuring a web server and monitoring cloud costs.

Domain: linuxcat.site · Platform: AWS EC2 · OS: Ubuntu Server