当前位置:网站首页>How to use the server to build our blog
How to use the server to build our blog
2022-07-27 12:23:00 【Put the stars by the bed】
about IT People in the industry , Everyone wants to have their own website to blog , For sharing your knowledge , And blogging has many benefits , For example, deepen the understanding of technical points , Get the amount of reading , To be recognized , If it develops well, you can also receive small advertisements . But how can we build our own website , Today I share my previous process of building my own website !!
Before setting up your own blog , First of all, you have to have your own server , I won't repeat how to get the server here . We can use terminal software ( recommend xshell) Connect to our server .
When the connection is complete , Our first step is to install and configure our server through terminal software LAMP( It refers to a group of software acronyms commonly used to run dynamic websites or servers ), In order to let everyone better contact the process of building the server , I don't need a pagoda here LAMP Installation .
One 、 install Apache HTTP service
Apache It's the world's number one user Web Server software . It can run on almost all widely used computer platforms , Because of its cross platform and security is widely used , It's the most popular Web One of the server-side software .
We install by executing the following command :yum -y install httpd httpd-manual mod_ssl mod_perl mod_auth_mysql If the returned result is as shown in the figure below, the installation is successful :

perform systemctl start httpd.service Command to start Apache service !! because http yes 80 port , Now we can go through http://+ Our server is on the public network ip Address to test whether the installation is successful . If the following appears, it indicates Apache Service installed successfully .

Two 、 Install and configure the database
The second is to install our database , Due to the use Wordpress( I'll explain later ) Build a cloud blog , Need to use MySQL The database stores data , In this section, we will install MySQL Open source alternatives to MariaDB(MariaDB Fully compatible with MySQL), And create a blog database . install MariaDB Server, Execute the following command :
1、yum install -y mariadb-server If the installation is successful, the following results will appear 
2、 start-up MariaDB Server, Execute the following command :
systemctl start mariadb.
notes : You can execute the following command to view MariaDB Server Running state systemctl status mariadb If it appears as green in the figure active (running) Indicates that the service is started successfully

3. Set the initial password of the database , Execute the following command :
mysqladmin -u root -p password
Because this is the first time to set the password , So there are Enter Password Just go back to the car when you get there , Then enter the password you want to set ( In this example, the password we set is 12345678), And confirm twice , Please remember the password you set , Used for database login and link operation .
4. Linked database , Execute the following command :
mysql -uroot -p
In the presence of Enter password At the prompt , Enter the password you set above , You can log in data .
- Create a database, and then log in to the database , We're going to create a database for the blog , Here, the database name is set to woshiliangzai( You can also use other favorite names ), Execute the following command to create woshiliangzai database :
create databasewoshiliangzai; notes : Be sure to add a semicolon .
If you want to view the created database , You can enter the following command :
show databases;
6. Execute the following command to exit the database connection operation. We will temporarily exit the database connection operation , Go to the next section to install PHP Language environment
exit;
because WordPress It's using PHP Language development blog platform , Users can support PHP and MySQL Database server set up their own website . Also can put the WordPress As a content management system (CMS) To use . So we will install one next PHP Language environment .
3、 ... and 、 install PHP Language environment :
1、 Execute the following command , install PHP Environmental Science .
yum -yinstallphp php-mysql gd php-gd gd-devel php-xmlphp-common php-mbstring php-ldap php-pear php-xmlrpc php-imap
If the following appears, the installation is successful :
2. establish PHP The test page , Execute the following command :
echo “<?phpphpinfo();?>” > ar/wwwml/phpinfo.php
- restart Apache service , Execute the following command :
systemctlrestart httpd - test PHP Page access http://<ECS Public address >/phpinfo.php, The following page is displayed to show PHP Language environment installed successfully .

Four 、 install WordPress
Now we have built LAMP(Linux、Apache、MariaDB、PHP) Environmental Science , We began to WordPress Package . But before that, we have to know what is WordPress? I don't know how to express this in Chinese , I quoted the online explanation :WordPress It is one of the most widely used blogging systems in the world , It's an open source PHP Software . Because there are many users , therefore WordPress The community is very active , There are rich plug-in template resources . Use WordPress Can quickly build an independent blog website . You should be able to understand it in this way !
Now let's install WordPress:
install wordpress, Execute the following command :
yum -yinstallwordpress The following information is displayed to indicate that the installation is successful .

2、 modify WordPress The configuration file
Execute the following command , modify wp-config.php Point to path as path :
cd /usr/share/wordpress Enter this directory
ln -snf /etc/wordpress/wp-config.php wp-config.php It's equivalent to wp-config.php Built a fast way to put /etc/wordpress/wp-config.php
3、 Execute the following command , Move wordpress To Apache root directory
mkdir /var/www/html/wp-blog
mv * /var/www/html/wp-blog/
4、 Execute the following command to modify wp-config.php The configuration file .
Before executing the order , Please replace the following three parameter values first .
- database_name_here: Name the database created in the previous step , This example is woshiliangzai
- username_here: Is the user name of the database , This example is root
- password_here: For the database login password , That is installation MariaDB The password we set when ( The password set in this example is 12345678)
sed -i ‘s/database_name_here/woshiliangzai/’ /var/www/html/wp-blog/wp-config.php
sed -i ‘s/username_here/root/’ /var/www/html/wp-blog/wp-config.php
sed -i ‘s/password_here/12345678/’ /var/www/html/wp-blog/wp-config.php
5、 Execute the following command to check whether the replacement is successful :
cat -n /var/www/html/wp-blog/wp-config.php
If the above appears, the modification is considered successful .
Finally, we restart Apache(systemctl restart httpd) You can test our WordPress.
test Wordpress
When all the above steps have been completed , We can test that we are based on ECS The built cloud blog .
http://< Server's IP Address >/wp-blog/wp-admin/install.php
- Complete... According to the following information wordpress Initialize configuration , And then click Install WordPress Button complete Wordpress initialization Site Title: Site name , for example :Hello
Username: Administrator user name , for example :ebdbbd
Password: Access password , for example :123123123
Your Email:email Address , Suggest a real and valid address . If there is no , You can fill in the virtual email Address , But will not be able to receive letters . Such as [email protected]

Landing successful , After logging in , You can add a blog to publish !
I suggest you try it manually , There will be a different feeling ! You can also take a look at my official account “new front end ”
边栏推荐
- CLS monitoring alarm: ensure high availability of online services in real time
- JS parasitic combinatorial inheritance
- 5V升压9V芯片
- Implicit indicators for evaluating the advantages and disadvantages of automated testing
- [excerpt] [medical image] common DICOM thumbnail interpretation and viewer converter conversion tool
- deeplab系列详解(简单实用年度总结)
- JS-寄生组合式继承
- 查看系统下各个进程打开的文件描述符数量
- STS download tutorial (the solution cannot be downloaded on the include official website)
- Sword finger offer note: T39. Numbers that appear more than half of the time in the array
猜你喜欢

In the first half of the year, the number of fires decreased by 27.7%. Guangdong will improve the fire safety quality of the whole people in this way

5V升压9V芯片

Makefile template

Chapter 10 enumeration classes and annotations

最强分布式锁工具:Redisson

Shell script text three swordsman awk

图像分割 vs Adobephotoshop(PS)

Solve the problem of @onetomany query falling into circular reference

Watermelon book chapter 3 (first & second)

STS下载教程(include官网无法下载解决方案)
随机推荐
广东财政多举措助力稳住粮食安全“压舱石”
Example of MATLAB dichotomy (example of finding zero point by dichotomy)
JS parasitic combinatorial inheritance
上半年火灾起数下降27.7%,广东将这样提升全民消防安全素质
Leetcode 03: t58. Length of the last word (simple); Sword finger offer 05. replace spaces (simple); Sword finger offer 58 - ii Rotate string left (simple)
The chess robot "broke" the chess boy's finger...
微信小程序必用接口「建议收藏」
5V boost 9V chip
Shell script text three swordsman awk
解决方案:idea project没有显示树状图
go入门篇 (2)
Makefile template
虚拟偶像的歌声原来是这样生成的!
STS下载教程(include官网无法下载解决方案)
STS download tutorial (the solution cannot be downloaded on the include official website)
Chapter 12 generics
compute_ class_ weight() takes 1 positional argument but 3 were given
Go Beginner (5)
Binary search decision tree (average search length of binary search tree)
go入门篇 (5)