mirror of
https://github.com/standardebooks/web.git
synced 2025-07-15 19:06:49 -04:00
Fix installation instructions in readme to actually work, and add missing PHP config file
This commit is contained in:
parent
c05c4293a8
commit
1148ed74b0
5 changed files with 35 additions and 8 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -2,7 +2,6 @@ ebooks/*
|
|||
www/ebooks/*
|
||||
www/images/covers/*
|
||||
www/opds/*.xml
|
||||
www/opds/subjects
|
||||
www/rss/*.xml
|
||||
vendor/
|
||||
composer.lock
|
||||
|
|
19
README.md
19
README.md
|
@ -5,26 +5,28 @@ PHP 7+ is required.
|
|||
## Installing on Ubuntu 20.04 (Focal)
|
||||
|
||||
```shell
|
||||
# Create the site root and clone this repo into it.
|
||||
# Install Apache, PHP, PHP-FPM, and various other dependencies.
|
||||
sudo apt install -y git composer php-fpm php-cli php-gd php-xml php-apcu php-mbstring php-intl apache2 apache2-utils libfcgi0ldbl task-spooler
|
||||
|
||||
# Create the site root and logs root and clone this repo into it.
|
||||
sudo mkdir /standardebooks.org/
|
||||
sudo chown $(whoami): /standardebooks.org
|
||||
sudo mkdir /var/log/local/
|
||||
cd /standardebooks.org/
|
||||
git clone https://github.com/standardebooks/web/
|
||||
|
||||
# Install Apache, PHP, PHP-FPM, and various other dependencies.
|
||||
sudo apt install -y composer php-fpm php-cli php-gd php-xml php-apcu php-mbstring php-intl apache2 apache2-utils libfcgi0ldbl task-spooler
|
||||
|
||||
# Install dependencies using Composer.
|
||||
cd /standardebooks.org/web/
|
||||
composer install
|
||||
|
||||
# Add standardebooks.test to your hosts file.
|
||||
echo "127.0.0.1\tstandardebooks.test" | sudo tee -a /etc/hosts
|
||||
echo -e "127.0.0.1\tstandardebooks.test" | sudo tee -a /etc/hosts
|
||||
|
||||
# Create a self-signed SSL certificate for use with the local web site installation.
|
||||
openssl req -x509 -nodes -days 99999 -newkey rsa:4096 -subj "/CN=standardebooks.test" -keyout /standardebooks.org/web/config/ssl/standardebooks.test.key -sha256 -out /standardebooks.org/web/config/ssl/standardebooks.test.crt
|
||||
|
||||
# Enable the necessary Apache modules.
|
||||
sudo a2enmod {headers, expires, ssl, rewrite, proxy}
|
||||
sudo a2enmod headers expires ssl rewrite proxy proxy_fcgi
|
||||
|
||||
# Link and enable the SE Apache configuration file.
|
||||
sudo ln -s /standardebooks.org/web/config/apache/standardebooks.test.conf /etc/apache2/sites-available/
|
||||
|
@ -32,8 +34,13 @@ sudo a2ensite standardebooks.test
|
|||
sudo systemctl restart apache2.service
|
||||
|
||||
# Link and enable the SE PHP-FPM pool.
|
||||
sudo ln -s /standardebooks.org/web/config/php/fpm/standardebooks.org.ini /etc/php/*/cli/conf.d/
|
||||
sudo ln -s /standardebooks.org/web/config/php/fpm/standardebooks.org.ini /etc/php/*/fpm/conf.d/
|
||||
sudo ln -s /standardebooks.org/web/config/php/fpm/standardebooks.test.conf /etc/php/*/fpm/pool.d/
|
||||
sudo systemctl restart "php*-fpm.service"
|
||||
|
||||
# Download the OPDS index template
|
||||
wget -O /standardebooks.org/web/www/opds/index.xml https://standardebooks.org/opds
|
||||
```
|
||||
|
||||
If everything went well you should now be able to open your web browser and visit `https://standardebooks.test/`. However, you won’t see any ebooks if you visit `https://standardebooks.test/ebooks/`. To install some ebooks, first you have to clone their source from GitHub, then deploy them to your local website using the `./scripts/deploy-ebook-to-www` script:
|
||||
|
|
17
config/php/fpm/standardebooks.org.ini
Normal file
17
config/php/fpm/standardebooks.org.ini
Normal file
|
@ -0,0 +1,17 @@
|
|||
error_log = "/var/log/local/php-error.log"
|
||||
display_errors = Off
|
||||
display_startup_errors = Off
|
||||
html_errors = Off
|
||||
log_errors = On
|
||||
short_open_tag = On
|
||||
error_reporting = E_ALL
|
||||
max_execution_time = 120
|
||||
allow_url_fopen = false
|
||||
allow_url_include = false
|
||||
expose_php = off
|
||||
|
||||
[Date]
|
||||
date.timezone = Etc/UTC
|
||||
|
||||
[opcache]
|
||||
opcache.validate_timestamps = off
|
|
@ -58,7 +58,7 @@ class OpdsFeed{
|
|||
protected function SaveIfChanged(string $path, string $feed, string $updatedTimestamp): void{
|
||||
$tempFilename = tempnam('/tmp/', 'se-opds-');
|
||||
file_put_contents($tempFilename, $feed);
|
||||
exec('se clean ' . escapeshellarg($tempFilename));
|
||||
exec('se clean ' . escapeshellarg($tempFilename) . ' 2>&1', $output); // Capture the result in case there's an error, otherwise it prints to stdout
|
||||
|
||||
// Did we actually update the feed? If so, write to file and update the index
|
||||
if(!is_file($path) || ($this->Sha1Entries($feed) != $this->Sha1Entries(file_get_contents($path)))){
|
||||
|
|
4
www/opds/subjects/.gitignore
vendored
Normal file
4
www/opds/subjects/.gitignore
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
# Ignore everything in this directory
|
||||
*
|
||||
# Except this file
|
||||
!.gitignore
|
Loading…
Add table
Add a link
Reference in a new issue