笔者之前一直使用IDC的虚拟主机和FTP软件搭建个人网站,非常简单快速,一个普通网站一般1-2个小时即可搭建完成。
这是第一次使用云主机,云主机与笔者之前使用的虚拟主机相比,就像是一台裸机,没有服务器环境和数据库,一切都需要自己来搭建。
宝塔面板(https://www.bt.cn/)是个很好的工具,笔者只用了1个多小时便用Wordpress建好了一个个人博客网站。
以下是使用宝塔面板+UCloud优刻得云主机搭建个人Blog的全过程:
1、购买UCloud云主机和域名
创建主机

选择好主机配置后购买

购买好的主机列表

购买域名


由于国内购买域名需要实名认证及备案,耗时较长,这里暂使用服务器IP来搭建,等域名实名和备案完毕后,解析过来即可。如上图,主机IP为117.50.4.207。
2、在Ucloud云主机上安装宝塔面板
首先下载一个putty远程登录工具

打开之后,输入主机IP:117.50.4.207,端口:22,连接方式:SSH,点Open连接

输入root账号密码登录
下面开始安装宝塔面板(Linux版)
输入命令:
yum install -y wget && wget -O install.sh http://download.bt.cn/install/install.sh && sh install.sh
回车
下载完成后会自动执行安装。
提示是否要安装宝塔:
Do you want to install Bt-Panel to the /www directory now?(y/n): y
输入y回车。输入y之后 宝塔面板就会全自动搭建,稍等一到两分钟

安装完成后会显示宝塔面板(Bt-panel)的登录网址、账号和密码,需要记录下来,登录时用
3、登录宝塔面板
在浏览器输入登录网址:http://117.50.4.207:8888/,首次登录失败
需要开启UCloud云主机防火墙上的这些端口:8888,888,80,443,20,21
回到Ucloud主机管理,修改外网防火墙


创建防火墙

编辑防火墙规则,增加以下端口:8888,888,80,443,20,21

修改外网防火墙为新建的防火墙

再次在浏览器输入宝塔面板网址:http://117.50.4.207:8888,这次可以打开了

输入之前记录下的账号密码登录宝塔面板
4、LNMP环境搭建
一键安装LNMP

安装开始

安装完成

5、安装WordPress
下面开始安装Wordpress
一键部署源码

找到Wordpress,点击“一键部署”

有域名的话填写域名,没有域名的话可以先填写服务器IP,数据库默认即可,不必修改

提交

成功部署Wordpress,数据库名,账号,密码需要记录下来保存
浏览器输入Wordpress安装文件地址:http://117.50.4.207/wp-admin/install.php

红框内填写之前记下的MySQL数据库的数据库名,用户名和密码,提交

点击“进行安装”

填写网站标题,用于登录个人网站后台的用户名和密码,安装Wordpress

安装完成

点击登录,输入刚设置的用户名和密码,进入网站后台


发表文章

一个用Wordpress搭建的个人博客网站就建好了。

6、域名解析
把域名解析到UCloud云主机上,域名实名认证和网站备案通过之后,就可以通过域名来访问网站了
到Ucloud控制台–全部产品–域名管理,添加记录

主机记录写:www
记录值填云主机的IP,确定

域名解析完成

7、域名绑定
域名解析完成之后,需要在服务器端绑定解析好的域名
在宝塔面板上点击网站——管理,管理网站

设置

填写域名,添加

域名绑定完成

下面就可以在浏览器输入域名网址访问网站了

总结:宝塔面板对于非专业IT人员搭建网站非常有帮助,个人用户可以轻松快速搭建Blog,绝大多数中小企业用户也可以轻松搭建企业网站,免去请IT专业人员的费用,像UCloud这样的云服务器提供商如果与宝塔面板合作,推出面向个人和中小企业等非专业用户的云主机产品,将会受到广泛欢迎。
未经允许不得转载:吾爱主机之家 » 使用UCloud云主机和宝塔面板快速搭建WP个人博客网站教程