[LAMP] Creating a simple website
- Web hosting
- LAMP! (Linux, Apache, MySQL, PHP)
This is the name that you type in at the address bar. If you didn’t have Domain names, we would all have to remember the IP address (which would like something like 192.168.1.256). Can you imagine remembering all of these numbers?!
Instead of having to remember these numbers, we have domains which work through assigning a name to an IP Address, so google.com is actually an IP (or in google’s case — many IPs). We can prove this by carrying out the following:
When we ping google, we get an IP as seen in the picture as
22.214.171.124. The process that does is DNS (Domain Name Service) which translates Domain names to IP Addresses for computers to interpret.
Some places you can pick up a domain name would include:
These are just a few examples, but there are infinite amounts of sites out there that you can google
Once you’ve got your domain name, that’s the first step, we will revisit the settings for the domain after we complete the web hosting step.
Web hosting — this is essentially buying a computer / server on the internet from a provider that will have good high speed internet generally in a data centre. They will have many racks of servers that they will offer up in many different ways, for instance, they could have one server that they will partition and virtualise so that there will be a lot of different operating systems that will live insolation of one another (multi-tenancy). This will generally be a cheaper option. Alternatively, you could buy a server itself, so that you don’t share it with anyone else, and it could have additional packages such as UPS (Uninterrupted power supplies, etc.) This will be far more expensive.
An example of webhosting would be:
https://000webhost.com — free webhost, not so reliable and a lot of restrictions.
https://scaleway.com — cheap, and you have full control over the server.
Now we have to connect the webhost to the domain name, because as it currently stands, they are separate entities.
On your web host, you should have an IP assigned if it is a server. If we copy this, and go to the domain name provider, and change your DNS records.
Create one A class domain record with the host as
*.yourdomainname.com and the answer as the IP of your web hosting, all the rest of the options can stay the same.
Create another A class domain record with the host as
yourdomainname.com and the answer as the IP of your web hosting, all the rest of the options can stay the same.
The first record will make sure that all sub-domains will get picked up, and the second record will ensure that your main domain name page will get picked up.
In terms of LAMP:
This is a great link to follow to install all the packages on Ubuntu, if you’re not using ubuntu as your web host server OS, then just google LAMP + Your OS. Then to get your website up and running go to the:
Then you’ll want to make either a
index.php file and when you go to your domain name, this page should show up!
💡 Something to remember is that it may take up to 24 hours for your domain name to work!