当前位置:网站首页>A pit filling trip based on LNMP to build a personal website
A pit filling trip based on LNMP to build a personal website
2022-06-28 03:26:00 【Bright in snow】
「 Blog move 」 New address : Simple books
This article discusses the use of LNMP After installing the package to build the underlying services of the website , Including domain name resolution ,MySQL A series of pit filling processes of the management of .
1. LNMP Introduction to one click installation package
Use LNMP One click installation package can easily configure the underlying environment of the server , LNMP The official introduction of the one click installation package is as follows :
LNMP A key package is mounted with a Linux Shell It can be written as CentOS / RadHat / Fedora、Debian / Ubuntu / Raspbian / Deepin etc. VPS Or independent host installation LNMP「Nginx / MySQL / PHP」、LNMPA 「Nginx / MySQL / PHP / Apache」、LAMP「Apache / MySQL / PHP」 Production environment Shell Program . At the same time, some practical auxiliary tools such as : Virtual host management 、FTP User management 、Nginx、MySQL / MariaDB、PHP The upgrade 、 Common cache components Redis、Xcache Installation of etc 、 Reset MySQL root password 、502 Automatic restart 、 Log cutting 、SSH protective DenyHosts / Fail2Ban、 Backup and many other practical scripts .
LNMP The official website of the one click installation package is as follows :
Through the official tutorial on the official website, you can easily go to VPS Configure the underlying environment of the website in , No more details here .
2. Domain name resolution issues
First, I will publish my website information as follows :
- domain name :http://bitky.cc/
- IP Address :104.224.172.61
- Host provider : Bricklayer VPS
- Domain name hosting and resolution : Alibaba cloud 「 Wanwang 」
The rest of this article is based on the above information .
2.1 Domain name resolution configuration
Configure the domain name resolution as shown in the figure , You can direct the tertiary domain name of this secondary domain name to my microblog and blog address .

2.2 Point the secondary domain name and its tertiary domain name to the same website directory
My site domain name is : http://bitky.cc/ as well as http://www.bitky.cc/ , Use the official website tutorial : LNMP add to 、 Delete virtual host and pseudo static tutorial After configuration , What is strange is , Visit the next domain name , The page is still the page before configuration :

Show 「 Congratulations ,LNMP The one click installation package was successfully installed !」, The latter domain name was not resolved successfully . You need to re-use the above tutorial before adding the domain name , And point to the directory of the website , The domain name can be resolved successfully , An example configuration is as follows :

3. MySQL Database management
3.1 Use phpMyAdmin management MySQL
After changing the site default directory , Cannot be opened by accessing the domain name subdirectory phpMyAdmin , Need to use FTP Tools or SSH Tool access server , take :
/home/wwwroot/default
Under the phpMyAdmin The subdirectories are transferred to the following directories as a whole :
/home/wwwroot/< Website directory >
As shown in the figure below :

Then you can access the following form phpMyAdmin:

3.2 Use MySQL The administration tool opens the database
After the above configuration , Use it directly 「Navicat for MySQL」 When the software connects to the database, it will directly prompt that the connection fails , Use Xshell etc. SSH Tool access server , Enter... In the terminal MySQL, After the MySQL Type... In the environment :
show global variables like 'port'
The result as shown in the figure appears , Show MySQL The port number of is the default 3306.

Return to terminal , Use the following command :
iptables -L -n

Show 3306 The port is blocked by the firewall , At this time, the following command can be used to open 3306 port :
// Will block 3306 Delete the sixth rule of port
iptables -D INPUT 6
// Add allow 3306 Port rules
iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
// View the current firewall rule and display the sequence number of the rule
iptables -L -n --line-numberThe setting result is shown in the figure below :

After that 「Navicat for MySQL」 Connect MySQL You can connect successfully :

4. Reference material
边栏推荐
猜你喜欢

Tencent games released more than 40 products and projects, including 12 new games

Tips for visiting the website: you are not authorized to view the recovery method of this page

调试利器 go-spew

基于流的深度生成模型

ETCD数据库源码分析——集群间网络层服务端RaftHandler

What are the technologies to be mastered in the test? Database design for software testing

【iptables&icmp】iptables默认策略中关于icmp协议的说明

被校园暴力,性格内向的马斯克凄惨而励志的童年

Etcd database source code analysis -- network layer server rafthandler between clusters

A16z:元宇宙解锁游戏基础设施中的新机遇
随机推荐
Import an excel file, solve the problem of skipping blank cells without reading and moving the subscript forward, and return_ BLANK_ AS_ Null red
Arm development studio build compilation error
Is it safe to buy stocks and open an account through the account opening link of the broker manager? Want to open an account for stock trading
MySQL错误
电子地图坐标系统研究整理
如何获取GC(垃圾回收器)的STW(暂停)时间?
爱普生L3153打印机如何清洗喷头
Is it better for a novice to open a securities account? Is it safe to open a stock trading account
Question bank and answers of special operation certificate for R1 quick opening pressure vessel operation in 2022
Object类,以及__new__,__init__,__setattr__,__dict__
Huawei equipment WLAN basic service configuration command
導入Excel文件,解决跳過空白單元格不讀取,並且下標前移的問題,以及RETURN_BLANK_AS_NULL報紅
2022安全员-C证考试题库模拟考试平台操作
Apache - Introduction à Apache
No&nbsp;result&nbsp;defined&amp;nbsp…
十年职场软件工程师感悟
matlab习题 —— 符号运算相关练习
Set drop-down options on Excel files
Ten years' experience of Software Engineer
自用工具 猴子都会用的unity视频播放器