sinri / vanity
A simple directory content carrier in PHP
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:project
This package is auto-updated.
Last update: 2024-10-29 05:28:31 UTC
README
A simple directory content carrier
How to build up a content service site with Vanity
- install Nginx and PHP
- fetch Vanity Source Code,
git clone https://github.com/sinri/Vanity.git
orcomposer create-project sinri/vanity
- determine the directory to store the files, it is recommended to put it under the project root, or use a symbol link there
- copy
config.sample.php
toconfig.php
and modify it as you need - configure Nginx
Permit and Forbid a Token to Access Directories or Files
You need to set the permission
and forbidden
in dictionary.
Just follow the sample file.
The pattern format could be referred by fnmatch document.
Nginx Virtual Host Sample
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; } }