Arts & Entertainment

Self-Hosting: Setting Up a Website In 10 Minutes With A SIN

Today, I propose to host a website on your SIN in a  fourth part devoted to self-hosting. Very easily, we will set up the web service, PHP (to have dynamic pages) and install a database management system. In a few minutes, you will have your website hosted on your NAS with your domain in .fr
Two important steps were discussed before: the creation of a domain  and redirecting it to our box / NAS . We must now set up the hosting of the domain. For that, I decided to leave on a synology NAS and to host a little blog under WordPress .
I want to say a little about the speed, availability and accessibility of the website. If you want to host a photo album, a small blog or a forum … no problem. However, I do not recommend web hosting a site with a lot of traffic without a few precautions, such as the Internet connection. If you have a small ADSL connection, the pages will be difficult to display (several seconds of waiting for the visitor). It does not matter if the goal is to share personal photos with your family or friends. They are ready to wait a few seconds before they see a web page. If you have a successful blog or an active forum,
Go to the center of Packet … To run a WordPress, you need a web service ( Web Station at Synology), PHP and a database .

Web Station and PHP

When you press the Install button of the Web Station package , a message will alert you to the need to install PHP 5.6 (or higher) as well. We click OK of course.
install-phpThese 2 software bricks are needed to host a forum, a blog or any other website. Note for experts that Web Station will allow you to choose between Nginx or Apache Web servers .
As previously explained, WordPress requires a database. Synology offers as standard the MariaDB database management system (MySQL community fork). Click on Install in the Package Center and wait a few seconds …
Once the installation is complete, I recommend that you change the default password . To do this, click on the MariaDB Open button .
Then the Change MariaDB password buttonchange-word pass MariaDB-Synology
and the OK button leaving the MariaDB Password field empty.
Enter the New Password and confirm it by typing it a second time and click OK.
A small warning message appears, we click on the button Yes.
I do not think I’m saying too much stupidity by saying that the Web Station, PHP and MariaDB installation will be needed in + 90% of the wordpress hosting on your SIN.

Installing WordPress

The installation of WordPress is also fast. Still in the Package Center, click Install .
A dialog box will open to link WordPress and MariaDB . You will be asked to enter the password MariaDB (previously entered).
We finalize by clicking on the Apply button . That’s it, it’s over. All you have to do is click on the Open button of WordPress.
Note: It is also possible to simplify the installation. Indeed, I have described the steps one after the other … but we could have clicked directly on the button Install WordPress and all previously mentioned packages would have been installed automatically.

WordPress setting

We will now finalize the configuration of WordPress. After clicking on WordPress (or the Open button), choose your default language then the Continue button.
Enter your information (website title, username, password, email address) and click on the Install WordPress button.
That’s it! All you have to do is log in to the WordPress admin interface.
I recommend that you immediately update WordPress by clicking the Update button. Feel free to update the extensions and themes.
A quick tour in Settings then  General , enter your domain name (.fr) in the field Web address of the site (URL).

Web Station Settings

Direction Web Station and go to the Virtual Host menu  on the left. Click Create and enter your domain name (do not forget the www or your subdomain) and in the Root field of the document put your WordPress folder. The goal is to match the domain name (.fr) on the SIN and the hosting folder of the website.
Now all you have to do is open port 80 of your box / router and redirect it to your NAS. Note that I did not need to open the ports on the NAS firewall … which is strange, opening the ports in the Virtual Host is enough to set up a rule. Normally you have to go through Control Panel > Security and then the Firewall tab .
Then, click on the Edit Rules button and press the Create button . Finally,  select from the list of integrated applications and ticked the Enabled box (Web Station 80/443).
PS: To test the accessibility of your site, you will have to switch another Internet connection (not your home) because otherwise it is likely that you have an empty page. To access your blog at home, you must type the IP address of the NAS (or its name) and add / wordpress / at the end. From outside, with 3G / 4G connection or any other network you will have no problem with the address

HTTPS (optional)

Thanks to Let’s Encrypt (basic on NAS Synology), it is very easy to set up a free certificate to pass your site in HTTPS . Go to the Certificate Manager  Control Panel> Security> Certificate Tab . Click on the Add button and select Add a new certificate and then the Next button .
We pick Get a certificate from Let’s Encrypt , then the Next button .
Finally, you must enter the domain name (without the www), a valid email address and click on the Apply button .
Note: Port 80 must be open on the NAS and your box / router to get a certificate from Let’s Encrypt.
That’s it, there’s nothing else to do … The certificate is free, but it is only valid for 3 months. Nothing really serious, it will be necessary to go through this step to extend it by another 3 months.
Last little thing, return in WordPress to indicate that the site has just switched to HTTPS
And do not forget to open the 443 on your box.

Leave a Reply

Your email address will not be published. Required fields are marked *