From bff48f7f61e87fca56a299bd1b8160d47c3381e2 Mon Sep 17 00:00:00 2001 From: garhve Date: Fri, 2 Dec 2022 17:27:58 +0800 Subject: transfer blogs 1 --- cn/index.html | 1 + en/sitemap.xml | 10 +++ index.html | 38 ++++++++- index.xml | 26 +++++- posts/1/index.html | 240 +++++++++++++++++++++++++++++++++++++++++++++++++++++ posts/2/index.html | 195 +++++++++++++++++++++++++++++++++++++++++++ posts/index.html | 150 +++++++++++++++++++++++++++++++++ posts/index.xml | 34 ++++++++ sitemap.xml | 2 + 9 files changed, 692 insertions(+), 4 deletions(-) create mode 100644 posts/1/index.html create mode 100644 posts/2/index.html create mode 100644 posts/index.html create mode 100644 posts/index.xml diff --git a/cn/index.html b/cn/index.html index b158f0f..53b5e8c 100644 --- a/cn/index.html +++ b/cn/index.html @@ -42,6 +42,7 @@ + diff --git a/en/sitemap.xml b/en/sitemap.xml index 80ac808..e8a3bf2 100644 --- a/en/sitemap.xml +++ b/en/sitemap.xml @@ -3,6 +3,7 @@ xmlns:xhtml="http://www.w3.org/1999/xhtml"> https://blog.garhve.com/ + 2022-08-10T19:24:59+08:00 + + https://blog.garhve.com/posts/2/ + 2022-08-10T19:24:59+08:00 + + https://blog.garhve.com/posts/ + 2022-08-10T19:24:59+08:00 + + https://blog.garhve.com/posts/1/ + 2022-08-10T17:21:02+08:00 diff --git a/index.html b/index.html index d7f396e..645a190 100644 --- a/index.html +++ b/index.html @@ -28,9 +28,9 @@ "publisher": "garhve", "accountablePerson" : "garhve", "copyrightHolder" : "garhve", - "copyrightYear" : "0001", - "datePublished": "0001-01-01 00:00:00 \u002b0000 UTC", - "dateModified" : "0001-01-01 00:00:00 \u002b0000 UTC", + "copyrightYear" : "2022", + "datePublished": "2022-08-10 19:24:59 \u002b0800 CST", + "dateModified" : "2022-08-10 19:24:59 \u002b0800 CST", "url" : "https:\/\/blog.garhve.com\/", "keywords" : [ ] } @@ -42,6 +42,7 @@ + @@ -88,6 +89,37 @@
+
+

2022

+ + +
+ +
+ +
+
+ +
+
+
+ +
+
+
+ +
+
+ +
diff --git a/index.xml b/index.xml index c0c4ba1..b2e85de 100644 --- a/index.xml +++ b/index.xml @@ -5,6 +5,30 @@ https://blog.garhve.com/ Recent content on blog | garhve's hub Hugo -- gohugo.io - en-us + en-us + Wed, 10 Aug 2022 19:24:59 +0800 + + Install arch linux on Tencent server + https://blog.garhve.com/posts/2/ + Wed, 10 Aug 2022 19:24:59 +0800 + + https://blog.garhve.com/posts/2/ + In order to build a website for myself, I rent a server from Tencent. This is my final decision, the process is turtuous… +My requirement as below: +abroad provider because they don’t have to register.. the the budget’s not relax, all I can choosing was in range of $0 - $10. It can runs Arch linux seamlessly I already eye on one: Linode. But they don’t see me… and banned all my gmail account from their service… + + + + First Website + https://blog.garhve.com/posts/1/ + Wed, 10 Aug 2022 17:21:02 +0800 + + https://blog.garhve.com/posts/1/ + So now I can say my website is on.. even though it just literally has nothing but a printing hello ![FirstWebsite.png][https://assets.garhve.com/pictures/2022/08/2751557406.png] +I got this garhve.com domain on namesilo for $9.95 per year, it’s really cheap! I always want a domain that is .com suffix. +Now, the web is https, this is a bit difficult for me. +Due to personal interest, I didn’t choose frame to base my website. I use Nginx but I don’t familiar with it. + + diff --git a/posts/1/index.html b/posts/1/index.html new file mode 100644 index 0000000..aa5e2db --- /dev/null +++ b/posts/1/index.html @@ -0,0 +1,240 @@ + + + + + + + + + + + + + +First Website + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+

First Website

+ +
+
+ + + +
+
+ + + +
+
+ +
+ +
+ +

So now I can say my website is on.. even though it just literally has nothing but a printing hello +![FirstWebsite.png][https://assets.garhve.com/pictures/2022/08/2751557406.png]

+

I got this garhve.com domain on namesilo for $9.95 per year, it’s really cheap! I always want a domain that is .com suffix.

+

Now, the web is https, this is a bit difficult for me.

+

Due to personal interest, I didn’t choose frame to base my website. I use Nginx but I don’t familiar with it. making it shows my content is not that difficult even that I don’t know much fancy state, but I stucked on SSL.

+

In order to use https instead of http, I choosed let’s encrypt, which is good for me and it’s free. However, I can only getting my non-www domain working. when it comes to www domain, it still http.

+

I found solutions all about using return to returning https, but it won’t work

+
+ +
+
1
+2
+3
+4
+
+
server {
+    server_name www.garhve.com;
+	return 301 https://www.garhve.com$request_uri
+}
+
+
+

This would return me a 404 error…

+

After searching and searching, I found where i was getting wrong.

+

Above statement only return https-www which doesn’t hold any contents, all I need is to redirect the https-www to https-non-www.

+

So, change to this one

+
+ +
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+
+
server {
+    listen 80;
+	server_name www.garhve.com garhve.com;
+	return 301 https://garhve.com$request_uri;
+}	# this block will redirect http-both to https-both
+
+server {
+    listen 443 ssl http2;	#http2 is newer and more secure http
+    listen [::]:443 ssl http2;
+  
+    server_name www.garhve.com;
+    include /path_to_cert_file;
+    return 301 https://garhve.com$request_uri;
+}	# this block will redirect https-www to https-non-www
+
+server {
+    listen 443 ssl http2;
+    listen [::]:443 ssl http2;
+  
+    server_name garhve.com
+    include /path_to_cert_file;
+  
+    #location to real content
+}	# this block is where we hold web content.
+
+
+

It will redirect https-www to https-non-www. Now, both domain will point to same location – my home page.

+ +
+ +
+
+ +
+
+ + +
+ + + + +
+
+
+ + + + + + + + + + diff --git a/posts/2/index.html b/posts/2/index.html new file mode 100644 index 0000000..f7dc153 --- /dev/null +++ b/posts/2/index.html @@ -0,0 +1,195 @@ + + + + + + + + + + + + + +Install arch linux on Tencent server + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+

Install arch linux on Tencent server

+ +
+
+ + + +
+
+ + + +
+
+ +
+ +
+ +

In order to build a website for myself, I rent a server from Tencent. This is my final decision, the process is turtuous…

+

My requirement as below:

+
    +
  1. abroad provider because they don’t have to register..
  2. +
  3. the the budget’s not relax, all I can choosing was in range of $0 - $10.
  4. +
  5. It can runs Arch linux seamlessly
  6. +
+

I already eye on one: Linode. But they don’t see me… and banned all my gmail account from their service…

+

![cancelEmail.png][https://assets.garhve.com/pictures/2022/08/38383267.png]

+

Fine! It’s your loss!

+

My second thought was hostkey, They got excellent support, and cheapest price comparing with other service me compared. So be it. I paid €3 to get one.

+

The server was great at first. But when it comes to custom OS installation because I want my server runs Arch linux, things got frustrating. The server supports me mount custom OS installer from their library, but even it shows me that mounted successfully, i still can’t boot from ISO, not saying start installation..

+

There is where excellent support comes from. I feedbacked the issue, they immediately help me fixed it. Thanks a lot!

+

And then, I started installation…

+

I never tried install a arch linux into server. So when it has not network. I totally fucked up, I googled and googled. Finally I found that in official wiki, this issue has a solution. The solution tells me that if we had static IP, we can get network through systemd-network service which comes with iso. It’s very tricky.

+

It associates another service called systemd-resolve. Network can be reachable if both in proper configuration..

+
+

Start both systemd service, then edit their config..

+
    +
  • For systemd-network, we can edit /etc/systemd/network/20-*.conf
  • +
  • For systemd-resolve, we can link /etc/resolv.conf to /run/systemd/resolve/stub-resolv.conf
  • +
+
+

After tricky part done, other steps just as normal as install in local env.

+

I struggled and successfully installed arch linux on my server, but then i encountered night traffic jam.. No matter how hard I try, I just can’t ssh into my server. That’s unacceptable! I immediately start looking for other provider..

+

Then, I found Tencent Cloud..

+

I already have one server of it, based on Shanghai. It is good, but building a website in it would require me to register, so I never consider using it.

+

I rent a server that based on Hong Kong, cost me ¥42 per month. But this has really good quality. even now at 2:05am when I’m writing this essay. It still performs stable connection.

+

First thing I got hands on Tencent Hong Kong server, I changed OS to arch linux, just as before. But Tencent doesn’t provide arch linux ISO, so i found some blogs on internet to know how to do it. And I succeed.

+

![tencentArch.png][https://assets.garhve.com/pictures/2022/08/4068602805.png]

+

There involves three parts to install arch:

+
    +
  • Mount ISO to driver and delete other thing
  • +
  • Manually add entry of ArchISO to grub
  • +
  • Static IP is of internal whereas hostkey is public.
  • +
+

So now, I got a server that running Arch Linux. Next, buiding a website on it!

+ +
+ +
+
+ +
+
+ + +
+ + + + +
+
+
+ + + + + + + + + + diff --git a/posts/index.html b/posts/index.html new file mode 100644 index 0000000..1a69fed --- /dev/null +++ b/posts/index.html @@ -0,0 +1,150 @@ + + + + + + + + + + + + + +Posts + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/posts/index.xml b/posts/index.xml new file mode 100644 index 0000000..4719172 --- /dev/null +++ b/posts/index.xml @@ -0,0 +1,34 @@ + + + + Posts on blog | garhve's hub + https://blog.garhve.com/posts/ + Recent content in Posts on blog | garhve's hub + Hugo -- gohugo.io + en-us + Wed, 10 Aug 2022 19:24:59 +0800 + + Install arch linux on Tencent server + https://blog.garhve.com/posts/2/ + Wed, 10 Aug 2022 19:24:59 +0800 + + https://blog.garhve.com/posts/2/ + In order to build a website for myself, I rent a server from Tencent. This is my final decision, the process is turtuous… +My requirement as below: +abroad provider because they don’t have to register.. the the budget’s not relax, all I can choosing was in range of $0 - $10. It can runs Arch linux seamlessly I already eye on one: Linode. But they don’t see me… and banned all my gmail account from their service… + + + + First Website + https://blog.garhve.com/posts/1/ + Wed, 10 Aug 2022 17:21:02 +0800 + + https://blog.garhve.com/posts/1/ + So now I can say my website is on.. even though it just literally has nothing but a printing hello ![FirstWebsite.png][https://assets.garhve.com/pictures/2022/08/2751557406.png] +I got this garhve.com domain on namesilo for $9.95 per year, it’s really cheap! I always want a domain that is .com suffix. +Now, the web is https, this is a bit difficult for me. +Due to personal interest, I didn’t choose frame to base my website. I use Nginx but I don’t familiar with it. + + + + diff --git a/sitemap.xml b/sitemap.xml index 9942680..b213a00 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -4,6 +4,8 @@ https://blog.garhve.com/en/sitemap.xml + 2022-08-10T19:24:59+08:00 + -- cgit v1.2.3-70-g09d2