The great thing about hosting is that similar to setting up your own site, you can make it as simple as you would like or you can get really complex, the reality is whichever method you choose is up to you. This is not a project for the faint of heart – indeed, you should be techy and much into the intricacy of hosting your own site. Someone who is interested in setting up their own server is a person with time to dedicate to this task and looks forward to the fulfillment of completing something that can be arduous even for the most tech-savvy.
Before getting into how to do your own hosting, you need to be aware of a few issues. Hosting your site requires a lot of electricity and you could deal with power outages, plus you are responsible for the efficacy and maintenance of hardware and software. Self-hosting has slower speeds than paid, dedicated hosts as well. However, the challenge of setting up your own hosting is invigorating, and a great next step on your tech journey.
Before you get started on hosting your own sites, it is a wise move to consider the benefits of paid hosting. The first thing you should know about paid hosting is generally things move faster on a paid host; these servers are dedicated to getting everything going and they don’t have the upload limitations that your ISP imposes upon you. That said, the other benefit a paid host has over self-hosting is that a paid host is responsible for the software and hardware. If anything goes wrong, you have to fix it instead of relying on the paid server company to perform maintenance. While sometimes it is easier to get any web hosting by simply paying with PayPal, the reality is hosting your own site is something for techy people that is really fun and as you improve in this endeavor, you develop skills that are quite marketable.
You can do web hosting with Windows and with Linux. Here is how with both systems.
Windows is not a popular way to host. The people who like Windows for hosting are those using ASP.NET or C# to code. If using these systems, Windows is the best option, despite being less popular than Linux.
Step 1: Get WAMP
One of the best installation programs is WampServer. This helps you work in Windows, Apache, PHP, and MySQL. Get the massive package when you download this, as the individual packages can be onerous and less accurate than the ones coming with WampServer. Once you get your WAMP, you can create subdirectories within it. Clicking on the Local Host link will take you to a URL that says, http://localhost in your main screen of WampServer.
Step 2: Simple Page Creation and Configuration of MySQL
As with anything, you want to test what you are doing. The next step is creating a new file with sample code. This could be something simple as a test using PHP. You can check in on this by going to the info section. However, if you click on phpMyAdmin, you can get going on configuring the MySQL information. This means the screen will open for admin credentials, but if you type in Admin to the log in name, rarely do you need a password. Once you get there, you can set and reconfigure your MySQL databases, and some CMS’s like WordPress do it for you.
Step 3: Make Your Site Public
Apache by default doesn’t want to make your site public, so you need to go in Apache and turn on the public settings. This will allow not just you to view your site, but the public as well.
Step 4: Domain Names
Setting up your DNS is not the easiest. What you do here is associate your IP address with a particular domain name. This will allow any DNS to pick out your domain name and download your site to get the information they need.
This is the most popular system used for web hosting. Learning about Linux will give you plenty of advantages while using a platform most folks are comfortable with.
Step 1: Use LAMP Software on the Terminal
The first thing you do with your terminal is to write a line of code to start your LAMP software installation. These tutorials will help you get started:
- Ubuntu: How to install Apache
- How to Install MySQL/MariaDB on Ubuntu
- How to : Install PHP 7.2 to 7.4 on Ubuntu
Step 2: Check if your PHP is Working
The way to test your PHP is to place a test file in the webserver root directory. Once there, you can visit the page by going to http://localhost/info.php. At this point, you’ll get a lot of information including the current version of PHP, configuration, and the installed modules. The good news is you can use Ubuntu to get the newest PHP modules. You can also use a simple command-line technique to get the same information as well.
Step 3: Get MySQL Under Control
Testing the MySQL for your site is imperative. This is especially important when you are using a CMS like Drupal, Joomla, or WordPress. Once there, you have to look at the server issue. Unfortunately, like the other servers, these one needs you to guide them. Most of the time, the system itself takes care of these MySQL databases. That said, you may have to enter some manually.
Step 4: DNS Configuration
Use the A record to get the IP address for your server using the dig tool. Once you do this, the next step is to associate your domain name with an IP address. The DNS step is vitally important because getting your domain associated with the IP means people won’t have to type in random numbers to see your site. Use Apache to set up the domain name, the index file, and any other files and set up permissions as well, and that gets your hosting done for you. You can use Namecheap to buy a domain name, read this review to help you decide.
This is just a short intro to self-hosting. You should do more research on security, setting up and maintaining servers, and a lot more. Though it’s a fun thing to do, it still requires a lot of skills and knowledge.