# Install
This document describes how to install nginx and php-fpm on Arch Linux. While
other combinations of operating systems, web servers and PHP systems are
possible, only instructions for this setup are provided.
## Requirements
Install the following software:
* Web server (e.g., Apache or nginx)
* PHP integration (e.g., php-fpm)
For example, on Arch Linux:
## Web server
The web server's root directory is presumed to be `/srv/http`.
### nginx
If using nginx:
1. Edit `/etc/nginx/nginx.conf`.
1. Replace the `server` section with the contents of `config/nginx.conf`.
Change the root directory as needed.
Redirect PDF files to the editor:
### Apache
If using Apache:
1. Copy `config/htaccess` into the same directory as `editor.php`.
1. Rename `htaccess` to `.htaccess`.
You may need to merge the contents if a `.htaccess` file already exists.
## Directory
The editor script must have permissions to write to a data directory. The
data directory is given relative to the editor script. For example, if the
editor script is in `/srv/http/notanexus/editor.php`, then issue the
following commands:
You will also need to make sure the directory is writable by the user running
the web service:
The data directory is configured.
## Restart
Restart both nginx and php-fpm. For example, on Arch Linux:
## Verify
Verify the installation is correct:
1. Create `/srv/http/phpinfo.php`.
1. Insert the following line: `<?php phpinfo(); ?>`
1. Save the file.
1. Browse to: http://localhost/phpinfo.php
Resolve any errors and try again.