The PDF hosting software powering http://pdf.yt/.
- A PHP-capable HTTPd
- PHP
- MySQL
- ImageMagick
- php5-mysql
- php5-imagick
For the Internet Archive auto-mirror script (optional):
- Python
- The
internetarchive
Python module (pip install internetarchive
) - The
oursql
Python module (pip install internetarchive
, depends on libmysqlclient being installed) - A cron daemon
If you wish to run PDFy yourself, this is how:
- Clone this repository - we'll assume you'll be cloning it to a folder in
/var/sites
, so the resulting folder would be/var/sites/pdfy
. - Clone the CPHP repository to
/var/sites
- this will become/var/sites/cphp
. - Switch the CPHP repository to the
feature/formhandler
branch - this is temporary until experimental CPHP features are merged into the master branch. - Copy
config.json.example
toconfig.json
and configure the database. - Create a folder
/var/sites/pdfy/storage
and ensure that it is owned by the user and group that your PHP / HTTPd run under. This is where PDF files will be stored. - Assign ownership of
/var/sites/pdfy/public_html/static/thumbs
to that same user and group. - Add the relevant configuration to your HTTPd (see below).
- Replace instances of "https://pdf.yt/" in the code (in particular in embed codes) with the host that your instance will be running at.
- ????
- PDFy!
CPHP, the PHP framework used for PDFy, will handle URL rewriting. To make this work, you will need to tell your HTTPd to forward any non-existent requests to /var/sites/pdfy/public_html/rewrite.php
. This is how you do that for most common HTTPds. Make sure to place this in your virtual host configuration, not your global configuration!
FallbackResource /rewrite.php
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ rewrite.php [L]
server.error-handler-404 = "/rewrite.php"
location / {
try_files $uri $uri/ /rewrite.php;
}
Please include the following information (where possible) in bug reports:
- What did you expect it to do?
- What did it do instead?
- Operating System / Distribution (including version)
- Browser (if client-side bug) or HTTPd (if server-side bug)
- PDFy version (identified by commit hash, run
git rev-parse HEAD
on the server) - If a client-side bug, preferably a URL to the problematic page/document.
You may also file bugs related to the PDF viewer; if necessary, these will be forwarded upstream to the pdf.js project.