sinri / vanity
PHP 中的简单目录内容载体
0.1
2018-09-29 14:58 UTC
This package is auto-updated.
Last update: 2024-09-29 05:08:32 UTC
README
简单的目录内容载体
如何使用 Vanity 建立内容服务网站
- 安装 Nginx 和 PHP
- 获取 Vanity 源代码,使用
git clone https://github.com/sinri/Vanity.git或composer create-project sinri/vanity - 确定存储文件的目录,建议将其放置在项目根目录下,或者使用符号链接
- 将
config.sample.php复制到config.php并根据需要进行修改 - 配置 Nginx
允许和禁止令牌访问目录或文件
您需要在字典中设置 permission 和 forbidden。只需遵循示例文件即可。
模式格式可以参考 fnmatch 文档。
Nginx 虚拟主机示例
server { listen 80; #listen 443 ssl; server_name vanity.free; #ssl on; #ssl_certificate /etc/letsencrypt/live/vanity.free/fullchain.pem; #ssl_certificate_key /etc/letsencrypt/live/vanity.free/privkey.pem; root /var/www/vanity; index index.php; access_log /var/log/nginx/access-vanity.log; error_log /var/log/nginx/error-vanity.log; error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } # LIMIT SCRIPT FOR STORE location ^~ /store/.*\.php$ { } location ~ \.php$ { fastcgi_pass unix:/run/php/php7.0-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } location ~ /\.git/{ deny all; } }