How to create an instance in Google Cloud and create a new Linux/Centos8 server instance
Create Centos8/Rocky Linux8 instance tutorial, well-knowncentos 8 has ended service support at the end of 2021, and some users who are accustomed to using Centos8 are looking for alternatives.Rocky Linux System is one of the best panning alternatives out there. Let me teach you how toGoogle cloud Create a Rocky Linux8 instance in Google Cloud
CentOS has always been free RHEL The version is deeply loved by the open source community and operation and maintenance engineers, and has a large number of user groups and installed capacity in China. RHEL is a commercial product of Red Hat. Users need to subscribe to Red Hat's commercial support service before it can be used. In other words, CentOS relies on free RHEL commercial services to gain so many loyal users. After CentOS 8 ends its service, The Stream version of CentOS 8 was launched, but the Stream version does not support many scripts very well. The best alternative system is Rocky linux
Rocky Linux is a free, open, community enterprise operating system designed to be compatible with the top upstream enterprise Linux distribution 100%. Built by the community, for the community. Rocky Linux is a downstream distribution based on the source code of Red Hat Enterprise Linux (RHEL). It is binary compatible with RHEL and is intended to be a replacement for its Linux predecessor, CentOS. This enterprise-grade Linux distribution is perfect for business and personal use.
Rocky Linux 8 will end service support on May 31, 2029. There are almost more than 5 years of service support, which can be used stably for a long time!
Create a Rocky Linux8 instance in Google Cloud Google Cloud
In Google Cloud, click Compute Engine in the menuvirtual machineExample.
Click Create Instance in the virtual machine instance, and then selectserverAfter selecting the country, select the machine configuration.
For entry-level server configuration, select E2 server. Among the following machine types, select e2-highcpu-2. This configuration is the minimum configuration among independent CPUs, 2 vCPUs, 1 core, and 2GB memory.
Compared with the initial site users, the configuration is enough, and remember to block the collection of those rogue spiders, which is basically enough for use.
The Availability Policy selects the standard by default.
In the startup disk option, click Change, here configure the disk size, and install the image of the operating system.
Choose Rocky Linux for the operating system, choose Rocky Linux 8 optimized for GCP or Rocky Linux 8 for the version, remember to choose the x86/64, x86_64 version.
Select SSD persistent disk as the boot disk type, and fill in the size as 100GB. The price of an SSD permanent disk is not very different from the price of a balanced permanent disk. The price difference between a 100GB SSD permanent disk and a balanced permanent disk is only about $10 per month.
After setting, click Select to enter the next option, check Allow HTTP and HTTPS traffic in the firewall, and then click Create!
About $70 per month, $210 for three months, and the free $300+100 is enough to maintain 3 months of free use.
After the server is created, you need to configure a permanent IP address. Currently, the server's IP address is randomly assigned. Once the server is restarted, the IP address will be changed.
Create a static IP address
Click VPC Network in the left menu, and then click IP Address.
Click Reserve external static address on the IP address page.
Fill in the static IP address name, and then select the region where your server is located in the region. Note that if you choose the wrong region, you cannot bind the additional target server. After selecting the region, select the server name you created earlier in the attachment target.
Then click Reserve, and your static IP address has been bound and created!
The last step is to set up the firewall!
Configure VPC firewall rules
In the process of creating the server just now, we chose to open HTTP and HTTPS ports, that is, ports 80 and 443. Other ports are closed by default. If you want to configure a firewall on the server, you need to setGoogle CloudThe firewall on the platform is set to transparent mode.
Click VPC Network in the left menu, then click Firewall. On the Firewall Policy page, click Create Firewall Rule.
Set a firewall rule name, and then pull down, the traffic direction is selected as inbound by default, and the operation performed on the matching item is allowed by default. In the target option below, click the drop-down menu to select all instances in the network.
Source filter condition, the default IPv4 range, fill in 0.0.0.0/0 in the source IPv4 range
Finally, in the protocol and port options, select Allow All, click Create, and a transparent rule of ALL IN is created to open all ports.
Here is an example of blocking the IP address segments of some rogue spiders.
Select Deny for actions on matches, and Deny all for protocols and ports.
In the source IP address range, fill in the IP address segment that needs to be blocked.
216.244.66.0/24
85.208.96.0/24
185.191.171.0/24
114.119.0.0/24
216.244.64.0 – 216.244.95.255
185.191.171.0 – 185.191.171.255
114.119.128.0 – 114.119.191.255
85.208.96.0 – 85.208.96.255
At this point the Rocky Linux8 server has been created!
After the server is created, other operations are the same as those on the Centos system.
set upSSHRemote login, install server panel and more.
Here are some related tutorials on server configuration, you can refer to:
- Google Cloud Google Cloud Server SSH Remote Configuration Tutorial
- CyberPanel Linux Hosting Panel – OpenLiteSpeed Support Simple, Fast and Open Source Control Panel
- CyberPanel installs WordPress and configures pseudo-static rules
- AMH-WP Build a personal blog website: Use AMH hosting panel WordPress installation