sinri/vanity

PHP 中的简单目录内容载体

维护者

详细信息

github.com/sinri/Vanity

源代码

问题

安装: 5

依赖: 0

建议者: 0

安全性: 0

星标: 0

关注者: 2

分支: 0

开放性问题: 0

类型:项目

0.1 2018-09-29 14:58 UTC

This package is auto-updated.

Last update: 2024-09-29 05:08:32 UTC


README

简单的目录内容载体

如何使用 Vanity 建立内容服务网站

  1. 安装 Nginx 和 PHP
  2. 获取 Vanity 源代码,使用 git clone https://github.com/sinri/Vanity.gitcomposer create-project sinri/vanity
  3. 确定存储文件的目录,建议将其放置在项目根目录下,或者使用符号链接
  4. config.sample.php 复制到 config.php 并根据需要进行修改
  5. 配置 Nginx

允许和禁止令牌访问目录或文件

您需要在字典中设置 permissionforbidden。只需遵循示例文件即可。

模式格式可以参考 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;
    }
}