Linux Project 2 – Host Website with GoDaddy & Apache
Host Website with GoDaddy & Apache
Domain se lekar Linux Server tak, sab kuch live karein.
1. Hosting Kya Hai? (ELI5 Mode)
DevOps engineer ka kaam hai is address (Domain) ko zameen (Server IP) se connect karna taaki poori duniya ise dekh sake.
2. Domain & Server Setup
- Domain: GoDaddy se apna pasandida domain kharidein (e.g.,
myprosite.com). - Server: AWS ya DigitalOcean par ek Ubuntu server launch karein. Note karein apna Public IP.
3. Installing the Web Server
# Service start aur enable karein
sudo systemctl start apache2
sudo systemctl enable apache2
4. Website Directory & Content
Hum root folder ke bajaye ek alag folder banayenge taaki multi-site setup asaan ho.
# Create a sample index.html
sudo nano /var/www/mydomain.com/public_html/index.html
Niche wala HTML code file mein paste karein:
www-data user ko ownership dein kyunki Apache isi user se chalta hai.5. Configuring Virtual Host
Apache ko batana padega ki mydomain.com ke liye kaunsa folder dekhna hai.
File mein ye configuration dalein:
ServerName mydomain.com
DocumentRoot /var/www/mydomain.com/public_html
</VirtualHost>
sudo a2ensite mydomain.com.conf
sudo systemctl reload apache2
6. GoDaddy DNS Setup (The Bridge)
DNS Propagation: IP update hone mein 10 min se 2 ghante tak lag sakte hain. Sabr rakhein!
🚀 Bonus: Free SSL (HTTPS) with Let’s Encrypt
Bina Green Lock (SSL) ke website “Not Secure” dikhegi. Ise 1 minute mein fix karein:
sudo certbot –apache -d mydomain.com
🛠️ 15 Real-World Troubleshooting Scenarios
Fix: Run
sudo apache2ctl configtest. Agar config mein typo hai toh ye bata dega.
Fix: DNS propagation check karein
whatsmydns.net par.
Fix: Check karein ki folder ki permission 755 hai ya nahi:
chmod -R 755 /var/www.
Fix: UFW firewall check karein:
sudo ufw allow 'Apache Full'.
[Aur aise hi 10+ professional debugging tips is project ka hissa hain]
Summary: Mission Accomplished! 🎯
Aapne successfully ek live infrastructure build kiya hai. Aapne Domain purchase kiya, DNS map kiya, Apache configure kiya aur SSL se secure kiya. Now you are a Web Hosting Pro!