Give you a server, can you deploy the code you write online?


Author: Xiao Fu Ge
Blog: https://bugstack.cn

Precipitate, share, and grow, so that you and others can gain something! 😄

I. Introduction

给你一台服务器,你能把你写的代码部署到线上吗?

We often hear the phrase: "In order to develop only interested in business development, we have done so and so!" Shane did, did so you do not care, 系统搭建, 技术框架, 核心组件, 通用模块and when the on-line application only little spot on it is also less than a fundamental understanding of how the application server, 部署环境, 开通端口, 申请域名, 配置SSLof. Therefore, most of you are becoming more and more like a tool person in a single position in the workshop. If you want to go to a higher position in the company or want to do something out of the company, it will become your bottleneck!

一套完整的能力范围,要涵盖哪些方面?

  • When we start with a demand from undertaking to launching, the roles that we will probably experience in this process include: business, operations, products, data, research and development (UI), testing and operation and maintenance, product use data and models, and quantified business proposals Needs, how to iteratively achieve, to meet the operational use to complete the business goals, and then the UI, front-end and back-end R&D, testing to complete the development and verification of the project, and deploy to the online environment of the operation and maintenance configuration.
  • From the perspective of this set of processes in the role of programmers, in fact, a large part of R&D personnel can only interact within the scope of programming and development. The closest technical role is testing and online deployment, but if you let R&D yourself To deploy a test environment, it will be very difficult to build an online environment, not to say how difficult it is at the technical level, but that this thing has hardly been experienced, and I have never thought of trying it out.
  • Models, algorithms, and quantification in business, operations, products, and data. Perhaps the R&D personnel in this part are farther away. It is not clear at all because of what scenario, what purpose was proposed, what evaluation was made, what methods were proposed, and How to land, and what you can see in R&D may only be the PRD waiting to be executed. It is because it is always like this, so there is the sentence: "You may not be able to do anything when you leave the company!"

Next , let me tell my friends that my tossing about what I love is not only the broadening of the technical horizon, but also some unexpected gains for you!

2. Money spent on the server!

这种事你们可以花点钱嘛,花点,哪怕要呢,要不了多少钱!

Master Tang said, spend some money, I listened to it!

In fact, I have never been stingy with the consumption of technical learning, and I will not waste time on other part-time tasks that are not personal for long-term growth. Since I graduated in 13 years and started working, because there is little money, some of my co-leasing partners will go out to find some part-time money to make money. I belong to the kind that not only did not make money on weekends, but also bought the domain name and server for the extra money saved. , From the earliest host house to Baidu, there is BCH cloud service. I have also seen that Qiniu Cloud has also used Baidu cloud storage, and it has spent tens of thousands of dollars on the server all the way.

What did you buy with all this money? I bought a bunch of domain names alone, including: itstack.org, yuyueqianli.com, fuzhengwe.cn, linuxjar.org, iteuds.cn, bugstack.cn, etc. What about the server? In addition to the normal consumption of the server, you can also buy it for life! ! !

Although , they paid for, but it is precisely because of these constant consumption and shift the, I learned 域名注册, 域名备案, 域名配置(A记录、CNAME记录、TXT), 证书申请, 服务搭建, 宝塔应用, 配置环境, Linux命令and so on. When you have a specific thing to do, you will use this path as a guide, constantly search for the corresponding information and practice 造作!

Pretend to be the first forum that can be seen in the past, with a little traffic!

  • But later, due to some rogue attacks and the impact of org domain name registration, this small forum finally hung on the road.
  • Fortunately, the website is not white . I have learned a lot from it, including: deployment, launch, operation and maintenance, some traffic peaks found in the operation and maintenance process, cache processing, anti-brush processing, anti-theft chain processing, user registration and QQ association, transformation of the original php code, support for some functions, etc., only the website is linked, but the technical experience is left!

3. Earn back the money spent!

我这钱是怎么赚回来的?

After I built forums, blogs, and post-bar-like functions, and gradually got a little bit, people started to contact me if I could build such a website or corporate portal for them. I happened to be in a traditional industry at the time, and I had a lot of spare time. I could get off work at 5:30 every day. Of course I had time to do it. it is good! Just do what you say. Under one meal, I have received a lot of private work in 2 years and made tens of thousands of dollars. Even if I have earned back the money from the server and domain name, it is not in vain!

1. Enterprise portal website (5000 yuan)

Enterprise portal website (5000 yuan)
  • Index : ⭐⭐⭐⭐
  • Background : Just about a year after I started work, my high school classmates asked me if learning computer can help their company build a website, just imitate the style of Lao Luo's hammer company, 5,000 yuan.
  • Result : I took it, maybe it's also a newborn calf who is not afraid of tigers, and people need to write it in PHP! I learned Java and wrote C# for almost a year, and then I used PHP to build an enterprise portal website for someone else. I should say that I was very courageous!
  • Harvest : The project was successfully deployed, and 5,000 yuan was paid as scheduled. I bought my first Apple mobile phone, iPhone 4s, and it is still by my side.
My first iPhone 4s

2. Selling furniture promotion website (2000 yuan)

Selling furniture promotion website (2000 yuan)
  • Index : ⭐⭐⭐
  • Background : At the beginning of 2014, my relatives opened a small workshop to make aquariums, and learned that I learned to calculate. The gongs and drums came up to me and said that it was too expensive to find someone outside to do a website that promoted their company's products ! .
  • Result : 💰I was too embarrassed to ask for the money. I just asked for the server and domain name fees, but later gave me a big red envelope of 2000 yuan. Hey, shake your hand and accept it!
  • Gain : Thanks to the fact that I have already taken over a project, PHP is also very easy to develop. According to the style they liked at the time, they made a style website layout that imitated the dot.com website. I paid the rent for the money I made this time!

3. Netty communication framework (2000 yuan)

Netty communication framework (2000 yuan)
  • Index : ⭐⭐⭐
  • Background : About 14 years ago, I started to like to engage in Netty. It may also be that there was not much information on the Internet at that time, and many people found me because I wrote a complete set of Netty cases. Just once asked if I could write a Netty communication framework, 2000 yuan.
  • Result : This was also the first time I didn't use PHP but made money in Java language. For me, it's pretty simple. I finished writing once I got home from get off work at 5:30, and it was over the next day.
  • Gain : Knowledge can really be turned into money, especially when it is a little bit difficult and there are not many people involved.

4. Lectures, data collection (11,000 yuan)

In addition to the private work I received above, I also received a lot of small jobs.

  • Undergraduate design guidance, 1,000 yuan. From Zhubajie.com.
  • Encryption algorithm for graduate students, 2000 yuan. A graduate student partner designed it with me and gave me the application fee from their college.
  • Lecture to a student online, it seems that it costs 50 yuan a day, and it will be 1,000 yuan for one month in the future.
  • A comprehensive logistics data platform, in fact, does not have many functions, a bit like recording foreign trade orders, 5000 yuan.
  • Assisting a boss who took up the project by himself, wrote part of the Netty codec code for a week, and docked it with the lower computer. 2000 dollars.

In this way, in those two years, seven or eighty-eight people made more than 20,000 yuan. Of course, there is still a small income, less than 1,000. Some people have been deceived. For example, they won’t give money after they got the project, or they got a screenshot of " I didn’t add a watermark. " People can demonstrate enough, but they don’t give money anymore.

4. How to use a server?

接下来,教教你怎么把一个服务器用起来!

For a school at school, it may have been working, but has never understood or contacted the configuration of the server and how to run its own code on the server. Then you can refer to the following tutorial introduction and try to deploy your own code to the server according to such an introductory guide.

There may be many friends who don’t know what the server can do. Simply put, this is a virtual computer that is not at home, and it runs 24 hours a day without downtime. You can practice network programming on it. Network IP), transit server, and the following:

  1. Take a blog: https://mp.weixin.qq.com/s/ZoQ0xAphJQkP_pb8H08BMg
  2. Engage in forums: phpwind, Discuz, wordpress (with blog and forum templates)
  3. Get a network disk: https://mp.weixin.qq.com/s/gzUrFexHcyCrw7XZ_L7N7w
  4. Chat room: https://mp.weixin.qq.com/s/OmXCY4fTfDpkvjlg5ME0ZA
  5. Others: practice your own project, set up a cluster, play with ES, get actual combat, save private work for others to deploy demonstrations

And the exercises of these contents can let you play through the whole set of contents from R&D to operation and maintenance, and thoroughly understand the domain name, filing, ssl, pagoda, common Linux commands and so on.

1. First neng servers

First, whether or not you have a server, you can learn together with the little brother Fu use on the server, we built a special study group server, add my micro letter: fustack, Remarks: 服务器学习加群.

If you are still a new user, Xiaobai, then you can follow my process, first neng a cheap server, just learn to use it. Here, Brother Xiaofu organized an event for the newcomers. You can buy a server with a one-year validity for 79 yuan, which is still much cheaper than the one I bought before!

  • When you buy a server will see, 地域, 实例, 操作系统and other areas of Beijing, Shanghai, Hangzhou, speed is good, but cheap Zhangjiakou speed will be slower. The operating system defaults and can be replaced after shutdown.

2. Server Introduction

After purchasing the server, wait a few minutes for the cloud platform to initialize the service, and you can use the configuration directly after you finish. as follows:

  • Reset password: Click on your instance, the blue letter, after entering, there is a,, 重置实例密码operation on the right .
  • Remote link: click 远程链接to link to your service, it is an online operation. You can link to the service through the local software xshell.
  • System replacement: If you are not very satisfied with the system you have selected by default or have other requirements, you can click to stop the system, and then start the operating system replacement.

3. The system is replaced with a mirror image of the pagoda

For the server system, you can use Linux commands to install various service components, such as k8s, docker, jdk, tomcat, mysql or php, etc., but for the actual operation and maintenance, we hope that the operation and maintenance cost will be more The lower the better, so here we chose the pagoda , a server operation and maintenance panel to manage our servers.

Pagodas can be installed on various cloud platforms, including Baidu Cloud, Huawei Cloud, Alibaba Cloud, and Tencent Cloud. Some cloud platforms will also have their own prepared pagoda mirrors. Here we use Alibaba Cloud services. As an example, it is better to shut down the system as a pagoda.

Downtime

  • Location: Click on the instance of the cloud service to enter this page
  • Operation: Before replacing the system, we need to stop the operation first, after the shutdown, you can click to replace the operating system

Change system

Select mirror

  • After replacing the system to confirm the order, then it will jump to the management background, then wait for a while, the server will start.

4. Configure and log in to the pagoda

Remote login

  • In this step, we log in directly on the web page, you can also use xshell to log in to the public IP

Initialize the pagoda

command:[[email protected] ~]# bt default

Configure Security Group

  • The access to the pagoda must be configured with port 8888, otherwise it cannot be accessed. This can be opened in the security group of the server.
  • Here we directly turn on all of them for convenience. If you are actually using it, you can't do this, otherwise it is very unsafe!

Log in to the pagoda

  • Address: http://39.96.73.xxx:8888/- 换成你的地址
  • Account: The user name and password have been printed on the console, you can copy your own, and you can modify the default password after logging in to the pagoda

5. Install Apache and FTP

Next, we install an Apache server and FTP in the pagoda, so that we can deploy and access our static blog, which is a html, as follows:

Install Apache

  • Some commands will be executed automatically during the installation process. You don't need to worry about this, just watch it silently.

Install FTP

  • The main purpose of installing FTP is to transfer files to the server locally. For example, if one of your static blogs is html, it can be transferred to the server via FTP.

6. Website configuration

After installing Apache and FTP, we can simply configure a site, and with this site, we can visit our own blog!

Create a site

  • If you have not applied for a domain name, or the domain name has not been registered, you can directly fill in the public IP.

Visit site

  • Address: http://39.96.73.167/ When you visit, you can change to your own IP

7. Website content

  • In the files of the pagoda, you can select the site added in step 6, find your file in it, and make some modifications. When you visit the website at this time, you will find that the content is your new content.

8. Domain name configuration

If you have a domain name and have already filed it, you can configure the domain name directly when you create the site, and you can access it through the domain name when you visit your website.

  • Add domain name: The domain name configured by Brother Xiaofu is the domain name that has been applied for and filed, and you can configure it as yours. Remember to configure the domain name, you need to configure the server IP mapping through the A record in your domain name service.
  • FTP configuration: In order to upload your files more conveniently, you can turn on FTP so that you can transfer the configuration via FTP.
  • Access Address: http://blog.itedus.cn -由于域名不是在阿里云,可能http会监测为未备案,拒绝访问

9. SSL configuration

There are many free websites to apply for SSL, or you can apply in the pagoda. If you are using Alibaba Cloud service, you can apply for 20 SSL certificates for free. In addition, if your domain name and service are both in Alibaba Cloud, then apply SSL can go through DNS authentication directly, otherwise you need to manually configure the DNS information to your own domain name. Don’t worry, there are prompts when you apply, just follow the instructions to configure

Download certificate

Because we need to configure ssl on the pagoda, we need to download SSL here and choose Apache format to download.

Configure certificate

  • After configuration, click Save. In addition, you need to force HTTPS to be turned on, otherwise your website can continue to access http, which is meaningless.
  • Now you can access your blog or website via https, it doesn't look like a lot!

10. Other instructions

Maybe you also want to configure jdk and tomcat, it doesn’t matter, you can install it in the pagoda, or you can install mysql. With these entry content, you can search for some general configuration content for the rest, or search in Alibaba Cloud .

Five, summary

  • This article mainly introduces the knowledge points and content of some technological growth that can expand your knowledge, as well as the introductory learning of some operational knowledge about the operation and maintenance of the server. With such a basic operation to lead you in, you can then expand to search for many other content to improve some of the deployments you have to do.
  • In addition, this article does not introduce the registration and filing of domain names. These contents are still very easy. You only need to search for the domain name on the cloud platform or search for the domain name registration on Baidu to find a registration entry. Generally, the .cn domain name is relatively cheap, and many other domain names are more expensive to renew. In addition, like .org, it cannot be filed, so don't choose too Gelu domain name.
  • Knowledge like this must be learned by hands-on operation. You may encounter various problems in the process. It doesn't matter, these problems can all be searched.
  • In addition, you can join our server learning group, add my WeChat:, fustackremarks 服务器学习, and record some small operation videos for everyone in the group. There are also many partners who have set up their own blogs to exchange and learn from each other!

Sixth, series recommendation