Files
2026-07-23 20:36:13 +08:00

76 lines
3.3 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
## [
云服务器搭建网站](https://developer.aliyun.com/article/771224)
[1](https://developer.aliyun.com/article/771224)[2](https://blog.csdn.net/weixin_74009030/article/details/131200303)[3](https://cloud.tencent.com/document/product/213/39130)
[
](https://developer.aliyun.com/article/771224)
[
](https://blog.csdn.net/weixin_74009030/article/details/131200303)
[
](https://cloud.tencent.com/document/product/213/39130)
在云服务器上搭建网站是一个常见的任务,以下是详细步骤,帮助您快速完成网站部署。
1. 购买域名和云服务器
- **域名**:选择常见后缀(如 _.com_、_.net_),并完成实名认证。
- **云服务器**:推荐选择阿里云或腾讯云的轻量应用服务器,适合个人或小型网站。购买时注意选择合适的地域(如香港,无需备案)。
2. 配置云服务器
- **设置密码**:登录云服务商控制台,修改默认密码。
- **开放端口**:在防火墙或安全组中开放必要端口: 80(HTTP)、443HTTPS)、22SSH)、8888(宝塔面板)。
- **远程连接**:使用工具如 XShell 或 Workbench 连接服务器。
3. 安装宝塔面板
宝塔面板简化了服务器管理和网站搭建流程。
- 在终端输入以下命令安装宝塔:
yum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh
![复制](data:image/svg+xml,%EF%BB%BF%3Csvg%20width%3D%2218%22%20height%3D%2219%22%20viewBox%3D%220%200%2018%2019%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0D%0A%20%20%20%20%3Cpath%20d%3D%22M4.11363%203.54174L4.11153%205.16645V13.2054C4.11153%2014.579%205.19925%2015.6926%206.54102%2015.6926L12.982%2015.6929C12.751%2016.3615%2012.1281%2016.8406%2011.3958%2016.8406H6.54102C4.57998%2016.8406%202.99023%2015.2131%202.99023%2013.2054V5.16645C2.99023%204.41591%203.45927%203.77752%204.11363%203.54174ZM13.2688%201.53125C14.1977%201.53125%2014.9508%202.30219%2014.9508%203.25319V13.2022C14.9508%2014.1531%2014.1977%2014.9241%2013.2688%2014.9241H6.54102C5.6121%2014.9241%204.85907%2014.1531%204.85907%2013.2022V3.25319C4.85907%202.30219%205.6121%201.53125%206.54102%201.53125H13.2688ZM13.2688%202.67921H6.54102C6.23138%202.67921%205.98037%202.93619%205.98037%203.25319V13.2022C5.98037%2013.5192%206.23138%2013.7761%206.54102%2013.7761H13.2688C13.5784%2013.7761%2013.8295%2013.5192%2013.8295%2013.2022V3.25319C13.8295%202.93619%2013.5784%202.67921%2013.2688%202.67921Z%22%20fill%3D%22%23767676%22%20%2F%3E%0D%0A%3C%2Fsvg%3E)
- 安装完成后,记录面板地址、账号和密码。
- 在浏览器中访问面板地址,登录并安装 LNMP 或 LAMP 环境。
4. 上传网站程序
- **博客程序**:如 WordPress、Typecho。
- **论坛程序**:如 Discuz!。
- **自定义代码**:将代码压缩后上传至宝塔文件管理器并解压。
5. 配置域名解析
- 在域名管理平台添加解析记录: 主机记录为 www 或 @,记录值为服务器 IP。
- 确保解析生效后可通过域名访问网站。
6. 测试与优化
- 测试网站功能是否正常运行。
- 根据流量需求调整服务器配置。
通过以上步骤,您可以快速在云服务器上搭建属于自己的网站!