Validation Quiz - MODULE 7
This 30-question quiz allows you to validate your knowledge of AWS web publishing before moving on to the practical lab.
Question 1
What are the minimum components to publish a web server on AWS?
A) EC2 only
B) VPC, Public Subnet, IGW, Security Group, EC2 with public IP
C) S3 and CloudFront
D) Lambda and API Gateway
See the answer
Answer: B
To publish a simple web server on EC2, you need: a VPC with a public subnet having a route to an Internet Gateway, a Security Group allowing HTTP/HTTPS, and an EC2 instance with a public IP or Elastic IP in this subnet.
Question 2
Which port should be open in the Security Group for HTTP?
A) 22
B) 443
C) 80
D) 8080
See the answer
Answer: C
Port 80 is the standard port for HTTP (unencrypted). Port 443 is for HTTPS (encrypted). Port 22 is for SSH. For a publicly accessible web application, you need to open at least port 80 and/or 443.
Question 3
What is the best practice for the IP address of a production web server?
A) Use dynamic public IP
B) Use an Elastic IP (static IP)
C) Use only a private IP
D) Change IP every week
See the answer
Answer: B
For production, use an Elastic IP that remains constant. The dynamic public IP changes if the instance is stopped and restarted, which would break DNS configurations. An Elastic IP remains the same as long as you retain it.
Question 4
What is an Application Load Balancer (ALB)?
A) A database service
B) A load balancer that distributes HTTP/HTTPS traffic to multiple targets
C) A type of EBS volume
D) A DNS service
See the answer
Answer: B
The ALB is a level 7 (application) load balancer that distributes HTTP/HTTPS traffic to multiple targets (EC2 instances, containers, Lambda). It supports routing based on path, host, and headers.
Question 5
Why use a Load Balancer in front of web servers?
A) To reduce costs
B) For high availability, scalability, and load distribution
C) For encryption only
D) It's mandatory on AWS
See the answer
Answer: B
A Load Balancer distributes traffic among multiple instances to avoid overloading a single server. It detects failing instances (health checks) and stops sending traffic to them. It also allows horizontal scaling and SSL termination.
Question 6
In which layer of the OSI model does an Application Load Balancer operate?
A) Layer 3 (Network)
B) Layer 4 (Transport)
C) Layer 7 (Application)
D) Layer 2 (Data Link)
See the answer
Answer: C
The ALB operates at level 7 (Application) and understands the HTTP/HTTPS protocol. It can make routing decisions based on the content of requests (URL, headers, cookies). The Network Load Balancer operates at level 4 (Transport).
Question 7
What is a 3-tier web architecture?
A) 3 identical servers
B) Separate Presentation (web), Application (logic), Data (DB)
C) 3 AWS regions
D) 3 availability zones
See the answer
Answer: B
The 3-tier architecture separates: the presentation layer (frontend web servers), the application layer (backend business logic), and the data layer (database). This separation allows for better security, scalability, and maintainability.
Question 8
In which network layer should the database be placed in a 3-tier architecture?
A) Public subnet with public IP
B) Private subnet without direct Internet access
C) In the same subnet as the web server
D) In another region
See the answer
Answer: B
The database should be in a private subnet, without a public IP or direct route to the Internet. It should only be accessible from the application servers via their Security Groups. This significantly reduces the attack surface.
Question 9
How do application servers in a private subnet access external APIs?
A) Directly via the IGW
B) Via a NAT Gateway placed in a public subnet
C) Via VPC Peering
D) It's impossible
See the answer
Answer: B
Servers in a private subnet use a NAT Gateway (in a public subnet) to access the Internet. The NAT allows outbound traffic while blocking unsolicited inbound traffic from the Internet.
Question 10
What is a Health Check for a Load Balancer?
A) A security check
B) A periodic test to verify if targets are healthy and can receive traffic
C) A billing check
D) A performance test
See the answer
Answer: B
The Health Check is a periodic verification performed by the Load Balancer towards the targets (instances). If a target does not respond correctly (bad HTTP code, timeout), it is marked "unhealthy" and no longer receives traffic until recovery.
Question 11
Which URL is often used for Health Checks?
A) /
B) /admin
C) /health or /status
D) /login
See the answer
Answer: C
A dedicated URL like /health or /status is recommended. This page should be lightweight and verify that the application is functioning (DB connection OK, active services). Using / can load unnecessary resources and skew metrics.
Question 12
Which HTTP codes indicate a successful Health Check by default?
A) 500-599
B) 200-299
C) 300-399
D) 400-499
See the answer
Answer: B
By default, codes 200-299 indicate success. You can configure the Load Balancer to accept other codes (e.g., 200,301). A 5xx code or a timeout marks the target as "unhealthy."
Question 13
What is SSL/TLS termination at the Load Balancer level?
A) Stop the SSL service
B) The Load Balancer decrypts HTTPS traffic and communicates in HTTP with the instances
C) Remove certificates
D) Block HTTPS
See the answer
Answer: B
SSL termination means that the Load Balancer handles HTTPS encryption. It decrypts incoming traffic and communicates in unencrypted HTTP with backend instances (in the secure private network). This simplifies certificate management.
Question 14
Which AWS service provides free SSL/TLS certificates?
A) AWS IAM
B) AWS Certificate Manager (ACM)
C) AWS KMS
D) AWS Secrets Manager
See the answer
Answer: B
AWS Certificate Manager (ACM) provides free SSL/TLS certificates for integrated AWS services (ALB, CloudFront, API Gateway). Certificates are automatically renewed. For EC2 directly, other methods (Let's Encrypt) must be used.
Question 15
What is a Target Group for an ALB?
A) A group of Security Groups
B) A group of targets (instances, IPs, Lambda) to which traffic is directed
C) A group of users
D) A group of regions
See the answer
Answer: B
A Target Group is a set of targets (EC2 instances, IP addresses, Lambda functions) registered with the Load Balancer. The Load Balancer routes traffic to healthy targets in the Target Group according to listener rules.
Question 16
What is a Listener on a Load Balancer?
A) A logging service
B) A process that checks connection requests according to the configured protocol and port
C) A monitoring tool
D) A type of Security Group
See the answer
Answer: B
A Listener is a process that listens on a specific port and protocol (e.g., HTTPS on 443). When it receives a corresponding request, it routes it to a Target Group according to configured rules.
Question 17
Can you route to different Target Groups based on the URL with an ALB?
A) No, an ALB has a single Target Group
B) Yes, with path-based routing rules
C) Only with an NLB
D) Only with CloudFront
See the answer
Answer: B
The ALB supports path-based routing (URL). For example: /api/* to an API Target Group, /images/* to another, and /* to the default Target Group. This allows directing traffic to different services.
Question 18
What is the command to test if a website is responding?
A) ping www.example.com
B) curl -I www.example.com
C) ssh www.example.com
D) telnet www.example.com 22
See the answer
Answer: B
curl -I URL performs an HTTP HEAD request and displays the response headers (HTTP code, content type, etc.). curl URL displays the page content. These commands test HTTP connectivity, unlike ping which tests ICMP.
Question 19
What does an HTTP 502 Bad Gateway code mean?
A) The page does not exist
B) The Load Balancer could not get a valid response from backend targets
C) Authentication error
D) Permanent redirection
See the answer
Answer: B
A 502 Bad Gateway indicates that the Load Balancer (acting as a proxy) did not receive a valid response from backend servers. Possible causes: servers down, timeout, crashed application, Security Group blocking LB traffic to instances.
Question 20
What does an HTTP 504 Gateway Timeout code mean?
A) The page does not exist
B) The Load Balancer did not receive a response within the allotted time
C) Too many requests
D) Certificate error
See the answer
Answer: B
A 504 Gateway Timeout means the backend did not respond in time. The application takes too long to process the request. Solutions: increase LB timeout, optimize the application, or investigate bottlenecks (DB, external APIs).
Question 21
How to verify that Apache/Nginx is running on a Linux instance?
A) aws ec2 describe-instances
B) systemctl status apache2 or systemctl status nginx
C) curl localhost from the instance
D) B and C
See the answer
Answer: D
systemctl status apache2 (or nginx, httpd) shows if the service is active. curl localhost or curl 127.0.0.1 tests if the server responds locally. If it works locally but not externally, it's a Security Group or network issue.
Question 22
Which Apache log file to check for errors?
A) /var/log/messages
B) /var/log/apache2/error.log or /var/log/httpd/error_log
C) /var/log/syslog only
D) /etc/apache2/apache2.conf
See the answer
Answer: B
Apache logs are generally found in /var/log/apache2/ (Debian/Ubuntu) or /var/log/httpd/ (RHEL/CentOS). error.log contains errors, access.log contains requests. These logs are essential for troubleshooting.
Question 23
What to check if the site works in HTTP but not in HTTPS?
A) Web server only
B) SSL certificate, port 443 in Security Group, server HTTPS configuration
C) The database
D) DNS
See the answer
Answer: B
Check: is the SSL certificate valid and correctly installed, is port 443 open in the Security Group, is the web server configured for HTTPS (VirtualHost on 443), do the certificate files exist and are they readable.
Question 24
What is sticky sessions (session affinity) on a Load Balancer?
A) Permanent sessions
B) Routing requests from the same user to the same backend instance
C) Encrypted sessions
D) Shared sessions
See the answer
Answer: B
Sticky sessions use a cookie to direct all requests from a user to the same instance. This is useful for applications with local state (in-memory sessions). However, it can create load imbalance and issues if the instance fails.
Question 25
Why should cloud web applications be "stateless"?
A) To reduce code size
B) To allow horizontal scaling without losing session data
C) To save money
D) It's a personal preference
See the answer
Answer: B
A stateless application does not store session state on the instance. Sessions are externalized (Redis, DynamoDB). This allows adding/removing instances freely without losing user sessions and facilitates horizontal scaling.
Question 26
Where to store user sessions for a scalable application?
A) On the local disk of each instance
B) In ElastiCache (Redis/Memcached) or DynamoDB
C) In the Load Balancer
D) In the Security Group
See the answer
Answer: B
ElastiCache (Redis, Memcached) or DynamoDB are solutions to externalize sessions. All instances can read/write sessions in this centralized store. This allows scaling and high availability of sessions.
Question 27
What is Route 53 in the context of web publishing?
A) A network route
B) AWS's managed DNS service to associate a domain name with resources
C) A type of VPC
D) A load balancer
See the answer
Answer: B
Route 53 is AWS's DNS service. It allows domain registration and creating DNS records (A, CNAME, ALIAS) to point to Load Balancers, EC2 instances, CloudFront distributions, etc.
Question 28
What type of DNS record to use to point to an ALB?
A) MX
B) A with ALIAS to the Load Balancer's DNS name
C) TXT
D) PTR
See the answer
Answer: B
Use an A record with ALIAS pointing to the Load Balancer's DNS name. ALIAS is specific to Route 53 and resolves CNAME limitations at the domain apex. It does not incur additional DNS query costs.
Question 29
How to test DNS resolution of a domain?
A) ping only
B) nslookup or dig
C) curl only
D) traceroute
See the answer
Answer: B
nslookup domain.com or dig domain.com allow verifying DNS resolution: which IP is returned, which DNS server responded, TTL, etc. This is essential for diagnosing DNS issues.
Question 30
What is the order of testing to validate an end-to-end web deployment?
A) DNS first
B) Local instance, then Load Balancer, then public DNS
C) All at once
D) CloudWatch first
See the answer
Answer: B
The logical order is: 1) Test the application locally on the instance (curl localhost), 2) Test via the Load Balancer (curl LB-DNS), 3) Test via the public domain name. This helps isolate the level where the problem is.
Result
Count your correct answers:
- 27-30: Excellent - You master web publishing on AWS
- 22-26: Good - Some points to review
- 17-21: Average - Review the course before the lab
- Less than 17: Insufficient - Retake the course from the beginning
Proceed to the Web Publishing Lab once you have achieved at least 22 correct answers.