[easy] from the front end to the whole stack, start here

Time:2021-7-29

background

After receiving a prompt from Alibaba cloud, the server purchased by 99 expires in one year, and there is no place for the previously fooled blog website. With the idea of saving money, I turned to Tencent cloud and bought an 88 yuan a year to play.


buy whatever you want

  Alibaba cloud cloud server purchase address, play by yourself and choose the cheapest one.
[easy] from the front end to the whole stack, start here
  After buying, find the ECS and the address of the instance you bought, and you can see the ECS you bought
[easy] from the front end to the whole stack, start here
[easy] from the front end to the whole stack, start here

So you have your own server ~ And the primary IPv4 address in the list, and the IP of the public network is the address of your server


Reset server password

  Tencent ECS password reset document, here is my screenshot. One advantage of Tencent cloud is that it can scan wechat codes all the way( PS: the initial password will be sent into the information in the station, which can be viewed by yourself)
[easy] from the front end to the whole stack, start here


Install basic software

   after resetting the initialization password, log in to the ECS terminal, as shown in the following figure
[easy] from the front end to the whole stack, start here

//Install the following in order
//Log in to the root account
//EPEL Toolkit
yum info epel-release
yum install nodejs
//After successful installation, the version is lower
//Taobao image
npm install -g cnpm --registry=https://registry.npm.taobao.org
//N is the management tool of nodejs
cmpm install n -g
//Install recent node
n latest

Installing nginx

Nginx is a high-performance HTTP and reverse proxy web server. It also provides IMAP / POP3 / SMTP services. In order for the server address to access our web page, you need to install it.

1. Install compilation tools and library files
yum -y install make zlib zlib-devel gcc-c++ libtool openssl openssl-devel
2. Install PCRE
 -Enter SRC directory
   cd /usr/local/src/ 
 -Download and install PCRE
    wget http://downloads.sourceforge.net/project/pcre/pcre/8.35/pcre-8.35.tar.gz
 -Decompress
  tar zxvf pcre-8.35.tar.gz
 -Enter the installation package directory
 cd pcre-8.35
 -Compile and install
  Execute. / configure first
  Then execute make & & make install
 -View PCRE version
   pcre-config --version
   
3. Install nginx
  -Enter directory
    cd /usr/local/src/
  -Download nginx compressed package
    wget http://nginx.org/download/nginx-1.6.2.tar.gz
  -Decompress安装包
    tar zxvf nginx-1.6.2.tar.gz
  -Enter the installation package directory
    cd nginx-1.6.2
  -Compile and install(我们代理安装在了/usr/local/webserver/nginx目录下)
    Execute first 
    ./configure --prefix=/usr/local/webserver/nginx --with-http_stub_status_module --with-http_ssl_module --with-pcre=/usr/local/src/pcre-8.35
    Final execution
    make && make install
   -View nginx version
     /usr/local/webserver/nginx/sbin/nginx -v
   -Start nginx
     /usr/local/webserver/nginx/sbin/nginx
   -Access to the public IP can be seen
     Welcome to nginx!  That means it's installed

[easy] from the front end to the whole stack, start here


Configure nginx and access the specified index.html

  • First prepare an index.html and upload it to the server. You can use the software, the beyound compare tool for Mac, and the winscp tool for windows
  • I put the index.html file directly under the / root folder
  • Under the path of / usr / local / webserver / nginx / conf, find the file nginx.conf, download it locally, and then modify it to the following figure. Fill the path of index.html of the agent into L in the previous step

[easy] from the front end to the whole stack, start here

  • Restart nginx

    cd /usr/local/webserver/nginx/sbin
    ./nginx -s reload
  • At this time, visit the public IP again. It turned out to be 403

[easy] from the front end to the whole stack, start here

Later, it was found that the check directory permissions were insufficientOf course, you should make sure that there is index.html under your / root path

chmod -R 755 /root
  • The last time to witness a miracle

[easy] from the front end to the whole stack, start here

last

The whole stack development can start from here ~ ~ ~ ~

I hope the big guys

Like it

[easy] from the front end to the whole stack, start here