Compare commits
2 Commits
1.1
...
AmazingFea
Author | SHA1 | Date | |
---|---|---|---|
319a49f716 | |||
144b5885ae |
304
DEPLOY.md
304
DEPLOY.md
@ -1,304 +0,0 @@
|
||||
# 宝塔面板部署指南
|
||||
|
||||
本文档详细介绍如何在宝塔面板中部署内容投稿系统。
|
||||
|
||||
## 📋 部署前准备
|
||||
|
||||
### 服务器要求
|
||||
- 操作系统:Linux(推荐CentOS 7+/Ubuntu 18+)
|
||||
- 内存:至少512MB(推荐1GB+)
|
||||
- 硬盘:至少1GB可用空间
|
||||
- 网络:稳定的互联网连接
|
||||
|
||||
### 宝塔面板要求
|
||||
- 宝塔面板版本:7.0+
|
||||
- PHP版本:7.4+
|
||||
- Web服务器:Apache或Nginx
|
||||
- 数据库:MySQL 5.7+(可选,也可使用SQLite)
|
||||
|
||||
## 🚀 详细部署步骤
|
||||
|
||||
### 第一步:安装宝塔面板
|
||||
|
||||
如果还未安装宝塔面板,请先安装:
|
||||
|
||||
```bash
|
||||
# CentOS安装命令
|
||||
yum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh
|
||||
|
||||
# Ubuntu安装命令
|
||||
wget -O install.sh http://download.bt.cn/install/install-ubuntu_6.0.sh && sudo bash install.sh
|
||||
```
|
||||
|
||||
### 第二步:配置服务器环境
|
||||
|
||||
1. **登录宝塔面板**
|
||||
- 访问 `http://服务器IP:8888`
|
||||
- 使用安装时显示的用户名和密码登录
|
||||
|
||||
2. **安装LNMP/LAMP环境**
|
||||
- 选择"软件商店" → "一键部署"
|
||||
- 推荐安装:Nginx 1.20+ + MySQL 5.7+ + PHP 7.4+
|
||||
- 等待安装完成(约10-30分钟)
|
||||
|
||||
3. **安装PHP扩展**
|
||||
- 进入"软件商店" → "已安装"
|
||||
- 找到PHP,点击"设置"
|
||||
- 在"安装扩展"中安装以下扩展:
|
||||
- `pdo_mysql`(MySQL支持)
|
||||
- `pdo_sqlite`(SQLite支持)
|
||||
- `gd`(图像处理)
|
||||
- `curl`(网络请求)
|
||||
- `fileinfo`(文件信息)
|
||||
|
||||
### 第三步:创建网站
|
||||
|
||||
1. **添加站点**
|
||||
- 点击"网站" → "添加站点"
|
||||
- 域名:填入你的域名(如:example.com)
|
||||
- 根目录:默认即可
|
||||
- PHP版本:选择7.4或更高版本
|
||||
- 数据库:选择MySQL(可选)
|
||||
- 点击"提交"
|
||||
|
||||
2. **配置域名解析**
|
||||
- 在域名服务商处添加A记录
|
||||
- 将域名指向服务器IP地址
|
||||
|
||||
### 第四步:上传项目文件
|
||||
|
||||
1. **下载项目**
|
||||
- 方式一:直接上传压缩包
|
||||
- 将项目打包为zip文件
|
||||
- 在宝塔面板"文件"中上传到网站根目录
|
||||
- 解压文件
|
||||
|
||||
- 方式二:使用Git(推荐)
|
||||
- 在"终端"中执行:
|
||||
```bash
|
||||
cd /www/wwwroot/your-domain.com
|
||||
git clone https://ckk.photo8.site/Snowz/tougao.git .
|
||||
```
|
||||
|
||||
2. **设置文件权限**
|
||||
- 在"文件"管理中,选择网站根目录
|
||||
- 右键选择"权限",设置为755
|
||||
- 特别设置以下目录权限为777:
|
||||
- `config/`
|
||||
- `data/`
|
||||
|
||||
### 第五步:配置数据库(MySQL方式)
|
||||
|
||||
1. **创建数据库**
|
||||
- 点击"数据库" → "添加数据库"
|
||||
- 数据库名:`submission_system`
|
||||
- 用户名:自定义
|
||||
- 密码:自动生成或自定义
|
||||
- 记录数据库信息
|
||||
|
||||
2. **配置数据库连接**
|
||||
- 编辑 `config/database.php`
|
||||
- 填入正确的数据库信息
|
||||
|
||||
### 第六步:运行安装向导
|
||||
|
||||
1. **访问安装页面**
|
||||
- 浏览器访问:`http://your-domain.com/install.php`
|
||||
|
||||
2. **环境检查**
|
||||
- 系统会自动检查服务器环境
|
||||
- 确保所有检查项都通过
|
||||
|
||||
3. **数据库配置**
|
||||
- 选择数据库类型(MySQL或SQLite)
|
||||
- 填入数据库连接信息
|
||||
- 测试连接
|
||||
|
||||
4. **初始化数据库**
|
||||
- 点击"初始化数据库"
|
||||
- 等待数据表创建完成
|
||||
|
||||
5. **完成安装**
|
||||
- 记录默认管理员账户信息
|
||||
- 删除或重命名 `install.php` 文件
|
||||
|
||||
### 第七步:安全配置
|
||||
|
||||
1. **SSL证书配置**
|
||||
- 在"网站"中找到你的站点
|
||||
- 点击"设置" → "SSL"
|
||||
- 申请Let's Encrypt免费证书
|
||||
- 开启"强制HTTPS"
|
||||
|
||||
2. **防火墙设置**
|
||||
- 在"安全"中配置防火墙
|
||||
- 开放80、443端口
|
||||
- 关闭不必要的端口
|
||||
|
||||
3. **文件安全**
|
||||
- 删除 `install.php`
|
||||
- 检查敏感文件权限
|
||||
- 定期备份数据
|
||||
|
||||
## 🔧 高级配置
|
||||
|
||||
### Nginx配置优化
|
||||
|
||||
在网站设置中添加以下Nginx配置:
|
||||
|
||||
```nginx
|
||||
# 安全设置
|
||||
location ~ ^/(config|includes|data)/ {
|
||||
deny all;
|
||||
}
|
||||
|
||||
# 禁止访问敏感文件
|
||||
location ~* \.(sql|log|md|txt|conf)$ {
|
||||
deny all;
|
||||
}
|
||||
|
||||
# 隐藏文件
|
||||
location ~ /\. {
|
||||
deny all;
|
||||
}
|
||||
|
||||
# PHP配置
|
||||
location ~ \.php$ {
|
||||
fastcgi_pass unix:/tmp/php-cgi-74.sock;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
include fastcgi_params;
|
||||
}
|
||||
|
||||
# 静态文件缓存
|
||||
location ~* \.(css|js|png|jpg|jpeg|gif|ico|svg)$ {
|
||||
expires 30d;
|
||||
add_header Cache-Control "public, immutable";
|
||||
}
|
||||
```
|
||||
|
||||
### PHP配置优化
|
||||
|
||||
在PHP设置中调整以下参数:
|
||||
|
||||
```ini
|
||||
; 上传限制
|
||||
upload_max_filesize = 10M
|
||||
post_max_size = 10M
|
||||
|
||||
; 执行时间
|
||||
max_execution_time = 60
|
||||
|
||||
; 内存限制
|
||||
memory_limit = 256M
|
||||
|
||||
; 错误报告
|
||||
display_errors = Off
|
||||
log_errors = On
|
||||
|
||||
; 会话配置
|
||||
session.cookie_httponly = On
|
||||
session.cookie_secure = On
|
||||
```
|
||||
|
||||
### 定时任务配置
|
||||
|
||||
可以设置定时任务来清理过期数据:
|
||||
|
||||
```bash
|
||||
# 每天凌晨2点清理7天前的IP记录
|
||||
0 2 * * * /usr/bin/php /www/wwwroot/your-domain.com/cleanup.php
|
||||
```
|
||||
|
||||
## 📊 性能优化
|
||||
|
||||
### 数据库优化
|
||||
|
||||
1. **索引优化**
|
||||
```sql
|
||||
-- 为常用查询字段添加索引
|
||||
ALTER TABLE website_submissions ADD INDEX idx_status (status);
|
||||
ALTER TABLE website_submissions ADD INDEX idx_created (created_at);
|
||||
ALTER TABLE app_submissions ADD INDEX idx_status (status);
|
||||
ALTER TABLE app_submissions ADD INDEX idx_created (created_at);
|
||||
```
|
||||
|
||||
2. **定期清理**
|
||||
- 定期清理过期的IP限制记录
|
||||
- 归档或删除过旧的投稿记录
|
||||
|
||||
### 缓存配置
|
||||
|
||||
1. **开启OPcache**
|
||||
- 在PHP设置中开启OPcache扩展
|
||||
- 提高PHP执行效率
|
||||
|
||||
2. **静态文件CDN**
|
||||
- 将CSS、JS等静态文件上传到CDN
|
||||
- 加速页面加载速度
|
||||
|
||||
## 🔍 故障排除
|
||||
|
||||
### 常见问题解决
|
||||
|
||||
1. **500错误**
|
||||
- 检查PHP错误日志
|
||||
- 确认文件权限设置
|
||||
- 检查.htaccess配置
|
||||
|
||||
2. **数据库连接失败**
|
||||
- 验证数据库配置信息
|
||||
- 检查数据库服务状态
|
||||
- 确认防火墙设置
|
||||
|
||||
3. **验证码不显示**
|
||||
- 检查GD扩展是否安装
|
||||
- 确认PHP图像处理功能
|
||||
|
||||
4. **无法获取网站信息**
|
||||
- 检查cURL扩展
|
||||
- 确认服务器网络连接
|
||||
- 检查目标网站可访问性
|
||||
|
||||
### 日志查看
|
||||
|
||||
- **PHP错误日志**:`/www/wwwroot/your-domain.com/php_errors.log`
|
||||
- **Nginx访问日志**:`/www/wwwroot/your-domain.com/log/access.log`
|
||||
- **Nginx错误日志**:`/www/wwwroot/your-domain.com/log/error.log`
|
||||
|
||||
## 📈 监控与维护
|
||||
|
||||
### 定期维护任务
|
||||
|
||||
1. **系统更新**
|
||||
- 定期更新宝塔面板
|
||||
- 更新PHP、MySQL版本
|
||||
- 更新系统安全补丁
|
||||
|
||||
2. **数据备份**
|
||||
- 设置自动数据库备份
|
||||
- 定期下载备份文件
|
||||
- 测试备份恢复流程
|
||||
|
||||
3. **安全检查**
|
||||
- 检查异常访问日志
|
||||
- 更新管理员密码
|
||||
- 检查文件完整性
|
||||
|
||||
### 性能监控
|
||||
|
||||
- 使用宝塔面板的监控功能
|
||||
- 关注CPU、内存、磁盘使用率
|
||||
- 监控网站访问速度
|
||||
|
||||
## 📞 技术支持
|
||||
|
||||
如果在部署过程中遇到问题:
|
||||
|
||||
1. 查看本文档的故障排除部分
|
||||
2. 检查项目的GitHub Issues
|
||||
3. 联系技术支持
|
||||
|
||||
---
|
||||
|
||||
**祝您部署顺利!如有问题,欢迎反馈。**
|
@ -7,7 +7,7 @@
|
||||
### 前端功能
|
||||
- 🌐 **网址投稿**:自动获取网站TDK信息(标题、描述、关键词)
|
||||
- 📱 **APP/软件投稿**:支持多平台应用投稿
|
||||
- 🎯 **多平台收录**:支持自媒体维基、zTab、SOSO平台选择
|
||||
- 🎯 **多平台收录**:支持自定义平台选择
|
||||
- 🔒 **IP限制**:每IP每日最多提交3次
|
||||
- 🚫 **重复检测**:智能检测重复内容
|
||||
- 📱 **响应式设计**:完美适配移动端和桌面端
|
||||
|
16
index.php
16
index.php
@ -469,23 +469,23 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
<label>收录平台</label>
|
||||
<div class="checkbox-group">
|
||||
<div class="checkbox-item">
|
||||
<input type="checkbox" id="platform1" name="platforms[]" value="自媒体维基" onchange="checkPlatforms()">
|
||||
<label for="platform1">自媒体维基</label>
|
||||
<input type="checkbox" id="platform1" name="platforms[]" value="百度" onchange="checkPlatforms()">
|
||||
<label for="platform1">百度</label>
|
||||
</div>
|
||||
<div class="checkbox-item">
|
||||
<input type="checkbox" id="platform2" name="platforms[]" value="zTab" onchange="checkPlatforms()">
|
||||
<label for="platform2">zTab</label>
|
||||
<input type="checkbox" id="platform2" name="platforms[]" value="小度" onchange="checkPlatforms()">
|
||||
<label for="platform2">小度</label>
|
||||
</div>
|
||||
<div class="checkbox-item">
|
||||
<input type="checkbox" id="platform3" name="platforms[]" value="SOSO" onchange="checkPlatforms()">
|
||||
<label for="platform3">SOSO</label>
|
||||
<input type="checkbox" id="platform3" name="platforms[]" value="谷歌" onchange="checkPlatforms()">
|
||||
<label for="platform3">谷歌</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="platform-warning compliance" id="compliance-warning">
|
||||
<i class="fas fa-exclamation-triangle"></i> 提醒:自媒体维基和zTab平台需要合法合规的内容,请确保您提交的内容符合相关法律法规。
|
||||
<i class="fas fa-exclamation-triangle"></i> 提醒:百度和小度平台需要合法合规的内容,请确保您提交的内容符合相关法律法规。
|
||||
</div>
|
||||
<div class="platform-warning loose" id="loose-warning">
|
||||
<i class="fas fa-info-circle"></i> 提醒:SOSO平台内容审查相对宽松,但仍需遵守基本的网络道德规范。
|
||||
<i class="fas fa-info-circle"></i> 提醒:谷歌平台内容审查相对宽松,但仍需遵守基本的网络道德规范。
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user