Ever needed to set up your own webserver to have a site or share records with family?
Making a web server is extremely simple to do and we’ll demonstrate to you all that you have to begin.
In this instructional exercise, we’ll introduce the majority of the parts required for setting up a web server.
This will set up the majority of the fundamental parts of a web server.
In the event that you need to host many sites, or need progressively vigorous site the executives, you ought to introduce a control panel like cPanel.
Things to know first before setting up your own webserver
Consumer-grade web and PC equipment are not intended for the worries of 24×7 utilization and connections from around the world.
Our site, then again, utilizes enterprise-grade equipment and connections with guarantee everybody can connect with your server at exceptionally quick speeds.
Maintenance and Support:
One of the significant downsides of hosting your own site is that you are in charge of any help issues.
While it might sound less expensive to utilize that PC lying around doing nothing when making your web server when you factor in the expense of fuelling an old PC 24 hours per day, it can get over the top expensive.
A 500W work station running 24 hours of the day at 12 pennies for every KW/h is an incredible $524 every year! Also the expenses of the web, equipment substitution, and so on.
Note: Setup your own server only when you’re able to afford electricity expense
The framework necessities for setting up an individual web server rely upon the sort of websites you expect to run. The base necessities are as per the following:
A Hybrid, Cloud, or Dedicated Server
2GB Disk Space
Database driven websites may require more prominent framework assets to run viably.
Server Components - LAMP
There are a few noteworthy parts to setting up a web server: This is regularly alluded to as the LAMP Stack.
Linux: The working framework behind the LAMP stack is Linux. It’s a lightweight and secure OS, making it one of the most famous decisions for the best web servers.
Apache: This is the software used to control the HTTP convention which conveys web content from the server to the internet browser.
MySQL: A mainstream database utilized for database-driven sites.
PHP: The main programming language of numerous sites, PHP is required for well-known site scripts like WordPress.
Connect to root via SSH to your server.
Install screen, wget and unzip
yum -y install wget screen unzip
Download the LAMP installation code from GitHub using wget:
wget –no-check-certificate -O lamp.zip https://github.com/teddysun/lamp/archive/master.zip
Unzip the installation files:
Change into the lamp-master folder:
Set the installation script to be executable:
chmod +x *.sh
Open a screen to start the installation process:
screen -S lamp
Execute the install script:
Complete these steps during the introduce procedure:
Pick an apache version. We prescribe the most recent version recorded.
Select the database you wish to introduce. We suggest MySQL and choosing the most recent variant.
Snap enter to utilize the default MySQL information directory
Enter a root password of MySQL
Select a PHP version. We prescribe choosing the most recent form.
Introduce any required PHP modules. php-imagick is a decent alternative in case you don’t know what you need.
Select 1 to introduce PHPMyAdmin
Press any key to start the installation
Building a new site
Since the LAMP stack is introduced, you can now deploy your first site on the webserver.
The command below will add a site to your Apache configuration file:
Pursue the steps in the script, giving the domain name and database data (whenever required).
You would now be able to add records (files) to the directory of your site. The default index is:
You can utilize the SCP command from your local machine to transfer records to the directory.
Indicating a Domain to the Web Server
You should log in to the admin interface at your domain provider. Our instructional exercise did not set up any nameservers on the server, so you should utilize an outer nameserver provider. Most domain providers give this to free.
Essentially copy the IP address of your server into the A record of the domain name DNS zone.
When you point the A record of the domain to your servers open IP address, the information in this folder will be visible for clients in their web browser