当前位置:网站首页>Soliciting articles and contributions - building a blog environment with a lightweight application server
Soliciting articles and contributions - building a blog environment with a lightweight application server
2022-06-29 08:03:00 【Elastic computing baixiaosheng】
This article is from the light weight application server essay solicitation activity user contribution , The author has obtained ( Nickname: huangjiachen ) Authorized release .
Lightweight application servers , It's a lightweight cloud server that can be built quickly and managed easily ; Provide application deployment based on a single server , security management , Operation and maintenance monitoring and other services , One stop upgrade your server experience and efficiency .
I bought this lightweight application server to build a blog environment , Record your learning experience and share your skills . At present, operation is not considered , I chose the low configuration one , The configuration can be selected according to the actual needs of individuals . For servers , My main concern is “ Quick build ” And “ Easier to manage ”, These two characteristics of the product have been confirmed through our own practice .
One 、 Buy servers
Because I've used it before Linux operating system , So when you buy a server , I chose the operating system CentOS; If you're not used to it , You can also reset the system later , It is very convenient at this point . The options in the figure below will not be introduced too much , Choose according to your own needs , Next, confirm the server configuration , Just confirm the payment finally . After the purchase , Enter the console to view the relevant information of your server .

Two 、 Configure server
The newly purchased server needs to set the user password , By default, the user name is root, The password needs to be set manually , After that, I passed SSH You need to enter this password when connecting to the server remotely (Linux In the system , The password is hidden when you enter it ).
At present, the server environment required by the project is mainly MySQL、Node And Nginx. The following is the detailed steps and command code display .
1、 install Node
Download the file :
[[email protected] ~]$ mkdir -p /usr/local/nodejs
[[email protected] nodejs]$ cd /usr/local/nodejs/
[[email protected] nodejs]$ wget https://npm.taobao.org/mirrors/node/v12.12.0/node-v12.12.0-linux-x64.tar.gzdecompression :
[[email protected] nodejs]$ tar -xvf node-v12.12.0-linux-x64.tar.gzConfigure environment variables :
[[email protected] nodejs]$ vim /etc/profileAdd the following :
export NODE_HOME=/usr/local/nodejs/node-v12.12.0-linux-x64
export PATH=$NODE_HOME/bin:$PATHBe careful :NODE_HOME The following value is the directory after you unzipped it , Exit after saving ; The installation directory can be accessed through whereis node To view the .
Update environment variables :
[[email protected] nodejs]$ source /etc/profileCheck the installed version :
[[email protected] nodejs]$ node -v[[email protected] nodejs]$ npm -vIf the version information can be displayed, the installation is successful .
2、 install MySQL
Create folders and set permissions :
[[email protected] nodejs]$ cd /home/admin
[[email protected] admin]$ mkdir downloads
[[email protected] admin]$ chmod 777 downloads
[[email protected] admin]$ cd downloads/Import RPM Source :
[[email protected] downloads]$ wget https://dev.mysql.com/get/mysql80-community-release-el8-1.noarch.rpm
[[email protected] downloads]$ sudo rpm -ivh mysql80-community-release-el8-1.noarch.rpmStart installation :
[[email protected] downloads]$ sudo yum install -y mysql-serverstart-up MySQL:
[[email protected] downloads]$ sudo systemctl start mysqldsee MySQL edition :
[[email protected] downloads]$ mysql -VThe next step is to modify the account and password .
No password to enter MySQL shell:
[[email protected] downloads]$ mysql -u rootChange Password :
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY ' Change this to your own password ';sign out MySQL shell:
mysql> exitOpen ports :
[[email protected] downloads]$ firewall-cmd --add-port=3306/tcp --permanentIf you execute the above command, an error will be reported “FirewallD is not running”, You need to restart the firewall , After the port is opened, you need to reload the firewall , The order is as follows :
[[email protected] downloads]$ systemctl restart firewalld.service # service iptables restart MySQL Security Settings
MySQL 8 New Security Wizard , This is for server deployment MySQL Come on , Simplified operation of security settings , excellent .
Security settings are roughly divided into the following steps / Options :
1. Password strength verification plug-in (N)
2. modify root Account and password (Y)
3. Remove anonymous users (Y)
4. Ban root Account remote login (N)
5. Remove test database (N)
6. Reload authorization table (Y)
The above steps / The options are based on your own needs .
Enter security settings :
[[email protected] downloads]$ mysql_secure_installationModify character encoding , Find the configuration file location :
[[email protected] downloads]$ whereis my.cnf
my: /etc/my.cnfModify the configuration file :
[[email protected] downloads]$ vi /etc/my.cnf
# modify 1: increase client To configure ( Beginning of file )
[client]
default-character-set=utf8mb4
# modify 2: increase mysqld To configure ( End of file )
#charset
character-set-server=utf8mb4
collation-server=utf8mb4_general_ciRemember to press... After modification (:wq) Save and exit .
restart MySQL service :
[[email protected] downloads]$ systemctl restart mysqldNavicat Link test error handling
If you use Navicat use IP Remote connection MySQL When the failure , Tips “is not allowed to connect to this MySql server”, You can try to modify mysql In the library user surface , Will the user root Corresponding Host Values are determined by localhost Change it to %, And restart MySQL Services take effect .
3、 install Nginx
First add a repository :
[[email protected] downloads]$ vim /etc/yum.repos.d/nginx.repoPaste this code to save and exit :
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1Start installation :
[[email protected] downloads]$ yum -y install nginxThe browser opens to input the local IP Can see a Nginx The default page is the successful installation .
Nginx Common commands :
[[email protected] downloads]$ systemctl stop nginx.service # stop it nginx service
[[email protected] downloads]$ systemctl start nginx.service # open nginx service
[[email protected] downloads]$ systemctl restart nginx.service # restart nginx service
[[email protected] downloads]$ systemctl status nginx.service # see nginx Service status 4、 Other environments
Finally, I installed Git、Yarn、Java、Jenkins, Because these are unnecessary installation items , Just skip , The detailed installation process can be found from the network . Because my blog doesn't use similar WordPress/Hexo Equal template , The blog building part is also omitted , You can choose a mature blog template , After the environment deployment is completed, you can set up a blog .
Finally, take a brief look at the version I installed :

3、 ... and 、 summary & Use feeling
The environment of the whole server has encountered some difficulties , It took me three days , Finally, it successfully completed in the lightweight application server , And deploy my own blog successfully .
The server is running normally , The current configuration Running a blogging system is completely sufficient , Very smooth ; adopt SSH When the tool is connected remotely The network latency is very low , Can ignore not remember , It is similar to the local . On the whole , I am very satisfied with the experience of this lightweight application server .
Click on Participate in contributing , View the newly upgraded lightweight application server essay solicitation activity , More rewards , Monthly contributions available .
边栏推荐
- 【量化投资系统】问题记录及解决方法
- PostgreSQL安装:The database cluster initialisation failed,stack Hbulider安装
- Roblox sword nine sword two
- Gateway controller communication protocol
- Common MySQL errors and solutions summarized painstakingly (I)
- Basics - syntax standards (ANSI C, ISO C, GNU C)
- 时间操作 - 时间格式转换
- Django - installing mysqlclient error: mysqlclient 1.4.0 or newer is required; you have 0.9.3
- Little white battle pointer (Part 1)
- JS XOR obfuscation code
猜你喜欢
随机推荐
关于组织2021-2022全国青少年电子信息 智能创新大赛西北赛区(陕西)复赛的通知
基于Sophus的Ceres优化
【域渗透提权】CVE-2020-1472 NetLogon 权限提升漏洞
声波通讯 - 流式数据处理 - 窗口对齐
VSLAM特征之线特征&面特征
Linear regression with one variable
VMware vcenter/ESXI系列漏洞总结
Line features & surface features of vSLAM features
AI and the meta universe sparked a spark: human beings lost only shackles and gained all-round liberation
C#Mqtt订阅消息
嵌入式产品防盗版
JS to implement a detailed scheme for lazy loading of pictures (it can be used after being imported)
code::blocks代码格式化快捷键
1031 Hello World for U
产品安全 - 小漏洞导致大问题
Reasons why the ext.dic file configured in ES does not take effect
Indextree and Application
Postman pre request
[量化投资系统]Django从数据库中实现筛选及分页
華為雲的AI深潜之旅









