Installing a web server means you need to host a website. It's a program that requests using HTTP (Hypertext Transfer Protocol) to send information in the WWW (World Wide Web). Web servers have an IP Address and a domain name. For example, typing the URL http://www.genesisonline.com/index.html in your web browser whose domain is genesisonline.com. The server then retrieves the page named and sends it to your browser.
First Things To Do
Once you've installed Linux and deployed your Linode, Start preparing the necessary things in hosting your website. Install a web server, database, and PHP. Also known as the open source web platform which is the LAMP stack that includes Linux, Apache, MySQL, and PHP/Python/Perl. Once done installing, create your database, upload the files needed, and start managing your DNS records. To guide you on how to host your website, read below!
Get Started with Apache
Install Apache on your Linode, check also and install the system update. This will install, and start your Apache Web Server
1 sudo apt-get update && sudo apt-get upgrade
2 sudo apt-get install apache2
Create a Database
Import a database if you already have, if you don't have yet follow the steps below:
1. First is Log in using the MySQL root password:
mysql -u root -p
2. Then, start creating a database, replace exampleDB with your own database name:
CREATE DATABASE exampleDB;
3. Create a new user in MySQL and grant permission in using the new database,
then replace example_user with your username, and password with your password:
GRANT ALL ON exampleDB.* TO 'example_user' IDENTIFIED BY 'password';
4. Then, tell MySQL to reload the grant tables:
5. You can now exit MySQL;
Finally, you have created a new database. You may skip to PHP if you don't need to import a database.
Steps to Import a Database
Import the database, then replace the username with your MySQL username and database_name with the database name you want to import to. You will be prompted for your MySQL password:
mysql -u username -p database_name < FILE.sql
In hosting your website, installing the base package and a copy of modules is a must. Read below:
1. Install the base PHP package:
sudo apt-get install php5 php-pear
2. Add the MySQL support extension for PHP:
sudo apt-get install php5-mysql
Test your Website and add your DNS Records
To Test your Website:
Input your Linode’s IP address. For example, http://188.8.131.52 in the address bar of your web browser.
Take note: Your website should load in the web browser.
Add DNS Records:
1. Login to your Linode Manager
2. Then, click the DNS Manager tab.
3. Select the Add a Domain zone link
4. Input your website’s domain name in the Domain field.
5. Input the administrative contact email address in the SOA Email field.
6. Click Yes, the insert a few records.
7. Then, click Add a Master Zone. DNS records will be created for your domain.
8. Make sure that your domain name is set to use Linode's DNS.
Set the name servers for your domain to the following:
Good Job! You’ve now added DNS records for your website!