From 5402a1688bf565aa344c344a1b65a8fada3aa771 Mon Sep 17 00:00:00 2001 From: "J. King" Date: Tue, 30 Jul 2019 12:34:46 -0400 Subject: [PATCH] Configuration sample for Apache --- .../030_Web_Server_Configuration.md | 40 +++++++++++++++++-- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/docs/en/020_Getting_Started/030_Web_Server_Configuration.md b/docs/en/020_Getting_Started/030_Web_Server_Configuration.md index 7bae733..2a79f5b 100644 --- a/docs/en/020_Getting_Started/030_Web_Server_Configuration.md +++ b/docs/en/020_Getting_Started/030_Web_Server_Configuration.md @@ -2,13 +2,13 @@ # Preface -As a PHP application, The Arsse requires the aid of a Web server in order to communicate with clients. How to install an configure a Web server in general is outside the scope of this document, but this section provides examples and advice for Web server configuration specific to The Arsse. Any server capable of interfacing with PHP should work, though we have only tested Nginx and Apache 2.4. +As a PHP application, The Arsse requires the aid of a Web server in order to communicate with clients. How to install and configure a Web server in general is outside the scope of this document, but this section provides examples and advice for Web server configuration specific to The Arsse. Any server capable of interfacing with PHP should work, though we have only tested Nginx and Apache 2.4. -Samples included here only cover the bare minimum. In particular, configuration for HTTPS (which is highly recommended) is omitted for the sake of clarity +Samples included here only cover the bare minimum for configuring a virtual host. In particular, configuration for HTTPS (which is highly recommended) is omitted for the sake of clarity ## Configuration for Nginx -``` +```nginx server { server_name example.com; listen 80; # adding HTTPS configuration is highly recommended @@ -25,7 +25,7 @@ server { fastcgi_pass_request_headers on; fastcgi_intercept_errors off; fastcgi_buffering off; - fastcgi_param SCRIPT_FILENAME /usr/share/arsse/arsse.php; + fastcgi_param SCRIPT_FILENAME /usr/share/arsse/arsse.php; # adjust according to your installation path fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; @@ -67,3 +67,35 @@ server { } } ``` + +# Configuration for Apache2 + +There are many ways for Apache to interface with PHP, but the recommended way today is to use `mod_proxy` and `mod_proxy_fcgi` to communicate with PHP-FPM. If necessary you can enable these modules on Debian systems using the following commands: + +```sh +sudo a2enmod proxy proxy_fcgi +sudo systemctl restart apache2 +``` + +Afterward the follow virtual host configuration should work, after modifying path as appropriate: + +```apache + + ServerName localhost + DocumentRoot /usr/share/arsse/www + + ProxyFCGISetEnvIf "true" SCRIPT_FILENAME "/usr/share/arsse/arsse.php" + ProxyPreserveHost On + + # NextCloud News v1.2, Tiny Tiny RSS API, TT-RSS newsfeed icons + + ProxyPass "unix:/var/run/php/php7.2-fpm.sock|fcgi://localhost/usr/share/arsse" + + + # NextCloud News API detection, Fever API + + # these locations should not be behind HTTP authentication + ProxyPass "unix:/var/run/php/php7.2-fpm.sock|fcgi://localhost/usr/share/arsse" + + +```