如题,如何搭建一个个人博客,这里就忽略域名,使用域名需要备案,具体根据地域不同,备案都是不同的,为了节省时间,只进行网站搭建配置。
1、首先你要有一台Linux服务器,服务器不需要太高配置,但是尽量是可以自行配置环境的主机。
搭建宝塔:
https://www.bt.cn/btcode.html

Centos为例:
执行命令:
yum install -y wget && wget -O install.sh http://download.bt.cn/install/install.sh && sh install.sh

中途需要选择执行y
Do you want to install Bt-Panel to the /www directory now?(y/n): y

执行需要大概2分钟左右,最终出现:
Congratulations! Installed successfully!
===========================
Bt-Panel: http://xx.xx.xx.xx:8888
username: aaadadas
password: 8sdfsds5
Warning:
If you cannot access the panel,
release the following port (8888|888|80|443|20|21) in the security group
===========================
Time consumed: 0 Minute!

就是成功安装宝塔了,如果是云服务器则需要在对应的安全组或者防火墙放行对应的8888、80之后端口才可以访问。
2、下载WordPress源文件
地址 : https://cn.wordpress.org/

可以下载最新,也可以选择需要的版本。

然后复制对应版本的连接地址

然后粘贴到您的服务器执行:
wget https://cn.wordpress.org/wordpress-5.2.2-zh_CN.tar.gz

下载成功之后看下相关WordPress程序的环境需求:
https://cn.wordpress.org/about/requirements/

PHP 7.3或更新
MySQL 5.6或更新 或 MariaDB 10.0或更新
Nginx或Apache(及mod_rewrite模块)
HTTPS支持
不是必须,但建议这样做以提高安全性
3、使用上述账号密码正常登陆宝塔面板

按照版本需求,安装默认的环境即可,根据需求可以选择FTP以及PhpAdmin是可以的。

等待安装即可


4、配置站点 首先新建网站站点

这边测试就先使用IP地址绑定配置

然后添加数据库,配置账号密码,提交。

然后将您下载的WordPress站点文件上传到网站目录下


mv wordpress-5.2.2-zh_CN.tar.gz /www/wwwroot/test.com
然后解压源码包

根目录中解压出一个wordpress目录,然后点击进去

选择所有文件,右上角剪切

回到根目录下,右上角粘贴所有即可

5、安装WordPress
浏览器访问您的域名或者IP地址即可进入安装页面
http://xxxx/wp-admin/setup-config.php

填写数据库信息,忘记的话可以在宝塔面板中查看


开始安装


安装成功之后使用账号密码登录后台

即可进入管理后台管理 :
http://XXXX/wp-admin/


访问您的域名或者IP地址即可进入您的博客。

到此为止您的博客正常搭建成功!!!祝您搭建顺利
网友评论