Loading... ##### 介绍 Chevereto是国外知名的图床程序, 可以用于私有图床、公共图床或个人照片分享网站,分为了免费版和收费版,相对于个人使用免费版功能已经足够 ##### 安装 > 服务器环境 ``` PHP 7 (PHP 5.6 min) MySQL 8 / MariaDB 10 (ALL PRIVILEGES) Apache / NGiNX web server ``` Web 环境:推荐宝塔Lnmp 环境:Nginx 1.16.0 , Php 7.2 , Mysql 5.7 上传主程序文件至站点根目录 并配置伪静态 <div class="tab-container post_tab box-shadow-wrap-lg"> <ul class="nav no-padder b-b scroll-hide" role="tablist"> <li class='nav-item active' role="presentation"><a class='nav-link active' style="" data-toggle="tab" aria-controls='tabs-87bb334015510b7d654ca41be4ba2f97940' role="tab" data-target='#tabs-87bb334015510b7d654ca41be4ba2f97940'>Nginx</a></li><li class='nav-item ' role="presentation"><a class='nav-link ' style="" data-toggle="tab" aria-controls='tabs-76c5ec0da89b871b8fa4c225e86489bc241' role="tab" data-target='#tabs-76c5ec0da89b871b8fa4c225e86489bc241'>Apache</a></li> </ul> <div class="tab-content no-border"> <div role="tabpanel" id='tabs-87bb334015510b7d654ca41be4ba2f97940' class="tab-pane fade active in"> ``` # Chevereto Nginx rewrite rules # Make sure to place these inside your server{} block # Disable access to .ht* files location ~ /\.ht { deny all; } # Disable access to sensitive files in app path location ~ /(app|content|lib|importer)/.*\.(po|php|lock|sql|txt)$ { deny all; } # Disable log on not found images + image replacement location ~* (jpe?g|png|gif|webp) { log_not_found off; error_page 404 /content/images/system/default/404.gif; } # Enable CORS header (needed for CDN) location ~* \.(ttf|ttc|otf|eot|woff|woff2|css|js)$ { add_header Access-Control-Allow-Origin "*"; } # Force serve upload path as static content (match your upload folder if needed) location /images {} # Route dynamic request to index.php location / { try_files $uri $uri/ /index.php$is_args$query_string; } ``` </div><div role="tabpanel" id='tabs-76c5ec0da89b871b8fa4c225e86489bc241' class="tab-pane fade "> ``` # Apache and Chevereto Apache should work instantly as the whole configuration is on `.htaccess` files. The folder `chevereto` contains one of these files (note: dot files may be hidden in your filesystem). # Troubleshooting These are the most common issues with Apache: ## 404 /install Apache virtual host configuration requires that you allow `.htaccess` rules at the virtual host path. Search for "AllowOverride .htacess". ## RewriteBase In some servers the configuration requires a RewriteBase. Check the file at chevereto/.htaccess where you will find instructions about this workaround. ``` </div> </div> </div> 完成后打开网站链接完成配置数据库信息即可 ##### 添加腾讯云COS 首先进入腾讯云COS控制台 [https://console.cloud.tencent.com/cos](https://console.cloud.tencent.com/cos) 如果没有任何资源包推荐先找到官网最新活动然后购买资源包 ![](https://resource-1256962187.file.myqcloud.com/2022/02/17/QQ20220217184723.png) 先创建存储桶![](https://resource-1256962187.file.myqcloud.com/2022/02/17/QQ20220217185119.png) 选择公有读私有写后前往刚刚创建的存储桶——安全管理 CORS跨域配置,将你图床网站的域名 ![](https://resource-1256962187.file.myqcloud.com/2022/02/17/QQ20220217185525.png) 防盗链设置,填写你的服务器ip和网址即可 ![](https://resource-1256962187.file.myqcloud.com/2022/02/17/QQ20220217185659.png) **创建秘钥** 前往控制台访问密钥-API密钥 [https://console.cloud.tencent.com/cam/capi](https://console.cloud.tencent.com/cam/capi) 访问秘钥——API秘钥管理——创建秘钥 ![](https://resource-1256962187.file.myqcloud.com/2022/02/17/QQ20220217185931.png) **进入仪表盘** ![](https://resource-1256962187.file.myqcloud.com/2022/02/17/QQ20220217190102.png) 选择S3 compatible 存储桶区域:COS域名 Bucket:存储桶名称 访问秘钥ID(SecretId):前面设置的 私有访问:秘钥(SecretKey):前面设置的 Endpoint:COS域名加上https:// 储存容量:随意 URL:存储桶访问域名,或者是COS开启CDN后的域名 ![](https://resource-1256962187.file.myqcloud.com/2022/02/17/QQ20220217190915.png) 保存后大功告成! 最后修改:2022 年 03 月 11 日 © 禁止转载 打赏 赞赏作者 支付宝微信 赞 如果觉得我的文章对你有用,请随意赞赏