Unit 14 ยท Hosting and Publishing a Web Site

14.1Introduction to Web Hosting

Web hosting means renting space on a computer (a server) that is always connected to the internet so that anyone can reach your website. A domain name (myshop.lk) is the human-friendly address; hosting is the place where your files live.

Hosting typeDescriptionGood for
Shared hostingMany sites on one server; cPanel control panel; cheapestStudent projects, small businesses
VPS (virtual private server)Your own virtual machine with root accessGrowing sites, custom software
Cloud hosting (AWS, Azure, Google Cloud, DigitalOcean)Scalable, pay for usageLarger applications
Dedicated serverA whole physical machineVery high traffic
Managed platform (PaaS)Platform runs the server for you (Render, Railway, Heroku-style)Developers who want less server work
Static hosting (GitHub Pages, Netlify, Cloudflare Pages)Only HTML, CSS, JS (no PHP/MySQL); often freePortfolios, front-end-only sites

Choosing hosting: check that it supports your stack (PHP version, MySQL, Composer), storage and bandwidth, free SSL, backups, uptime guarantee, support quality, email accounts, location (closer to visitors is faster), and the price on renewal (introductory prices often rise). A PHP and MySQL shop needs shared, VPS or cloud hosting, not static-only hosting.

Domain names: bought from a registrar (e.g. for .lk through LK Domain Registry accredited registrars; .com through many registrars) usually per year. Choose short, memorable names. Keep the registrar account secure (two-factor authentication) and enable auto-renew, because losing a domain loses the business.