πŸ‘ˆ

Topics:

πŸ‘ˆ

🚨 One filename change. Zero errors. Production broken.

image1

A small Git detail taught me a production-level lesson the hard way.

I recently ran into a subtle issue while working with Git on Windows. It looked harmless at first β€” until it showed up in production.

I had a file named DEV.html. I pushed it to GitHub and everything worked as expected.

Later, I renamed it locally to dev.html (just a case change) and pushed again. No errors. No warnings. Everything looked fine.

But in production, links like <a href="dev.html"> started returning 404 – Page Not Found.

After some digging, I realized GitHub still had the file named DEV.html.


πŸ” What was happening? This isn’t a Git bug, but a cross-platform design limitation:

  • Windows filesystems are case-insensitive
  • Git on Windows doesn’t detect case-only renames
  • GitHub runs on Linux, which is case-sensitive

So Git never recorded the rename, and GitHub never received it.


⚠️ Why this matters

In small projects, this is easy to miss. In larger projects, it can silently break navigation and cause production-only bugs β€” the classic β€œworks on my machine” problem.


βœ… What I learned

  • Always use lowercase filenames
  • Use git mv when renaming files
  • Enforce naming rules with CI or pre-commit hooks

Sharing this in case it helps someone avoid a similar issue.

πŸ‘ˆ

image2

πŸ‘ˆ

image3

πŸ‘ˆ

image4

πŸ‘ˆ

image5

πŸ‘ˆ

image6

πŸ‘ˆ

image7

πŸ‘ˆ

image8

πŸ‘ˆ

Can I run Apache and Nginx on the same AWS EC2 instance?

image1

Yes βœ… you can install another web server like Nginx, but there is one important rule you must understand first.

1️⃣ Can multiple web servers be installed?

βœ” YES β€” installed

❌ NO β€” running on the same port (by default)

You can install:

  • httpd (Apache)
  • nginx

at the same time.

But you cannot run both on port 80 at the same time.


2️⃣ Why port 80 is the problem

By default:

  • Apache (httpd) β†’ listens on port 80
  • Nginx β†’ listens on port 80

Only one process can bind to a port.

So:

  • One will start βœ…
  • The other will fail ❌

3️⃣ Check if Apache is currently running

sudo systemctl status httpd

If you see:

Active: active (running)

πŸ‘‰ Apache is running on port 80.


4️⃣ You can safely install Nginx now

Installing does not affect Apache.

sudo yum install nginx -y

This only:

  • Downloads packages
  • Installs files
  • Does NOT start nginx automatically

5️⃣ What happens if you start Nginx now?

If Apache is running:

sudo systemctl start nginx

You’ll likely see:

Failed to start nginx.service: Address already in use

This is normal, not an error in installation.


6️⃣ Two safe ways to use both web servers

βœ… Option 1: Stop Apache, use Nginx

sudo systemctl stop httpd
sudo systemctl disable httpd

Then:

sudo systemctl start nginx
sudo systemctl enable nginx

πŸ‘‰ Now Nginx uses port 80.


βœ… Option 2: Run both using different ports (Learning setup)

Change Nginx port to 8080.

sudo vi /etc/nginx/nginx.conf

Change:

listen       80;

To:

listen       8080;

Then:

sudo systemctl start nginx

Access:

http://<EC2-IP>:8080

7️⃣ Check which service is using port 80

Very important command:

sudo ss -tulnp | grep :80

or

sudo lsof -i :80

This tells you exactly which process is using the port.


8️⃣ Why would someone install both?

Common real-world reasons:

  • Learning & comparison
  • Migrating from Apache β†’ Nginx
  • Apache for legacy apps, Nginx as reverse proxy
  • Load balancing setup

9️⃣ AWS EC2 security group reminder ⚠️

Make sure:

  • Port 80 is allowed (HTTP)
  • Port 8080 is allowed (if used)

Security Group β†’ Inbound rules


βœ… Final Answer (Simple)

βœ” You can install Nginx even if Apache exists βœ” You cannot run both on port 80 βœ” Stop one OR change port βœ” This is normal Linux behavior