pkgsrc/www/php-tt-rss/MESSAGE

107 lines
2.5 KiB
Text

===========================================================================
$NetBSD: MESSAGE,v 1.6 2017/04/05 12:33:49 fhajny Exp $
To use php-tt-rss with nginx 1.6 and php 5.4, you will need to perform
the following steps.
1. Install www/nginx and www/php-fpm.
2. Install PostgreSQL database server.
# cd databases/postgresql93-server
# make install
3. Start PostgreSQL server.
# ${RCD_SCRIPTS_DIR}/pgsql start
4. Add PostgreSQL user, ttrss
$ createuser -d -U pgsql ttrss
5. Set password for ttrss user
$ psql -U pgsql template1
psql (9.3.4)
Type "help" for help.
template1=# alter user ttrss with password 'ttrss_user_password';
ALTER ROLE
template1=# \q
6. Create database for ttrss, ttrss_db
$ createdb ttrss_db -O ttrss -U ttrss
7. Check created database
$ psql -U pgsql -l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+-------+-----------+---------+-------+-------------------
(snip)
ttrss_db | ttrss | SQL_ASCII | C | C |
8. Initialize database
$ psql -U ttrss -d ttrss_db -p 5432 -f \
${PREFIX}/share/tt-rss/schema/ttrss_schema_pgsql.sql
9. Be sure to have the following lines in ${PREFIX}/etc/php.ini.
extension=iconv.so
extension=json.so
extension=mbstring.so
extension=pgsql.so
10. Be sure to have the following in ${PREFIX}/etc/php-fpm.conf
listen.allowed_clients = 127.0.0.1
11. Be sure to have the following lines in ${PREFIX}/etc/nginx/nginx.conf
http {
upstream php-handler {
server 127.0.0.1:9000;
}
server {
listen 80;
root ${PREFIX}/share/tt-rss;
server_name YOUR_SERVER_NAME;
location ~ \..*/.*\.php$ {return 404;}
location ~* ^/(.*\.php)$ {
try_files $uri $uri/ index.php;
include fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$1;
fastcgi_param PATH_INFO $2;
fastcgi_pass php-handler;
}
}
12. Edit ${PREFIX}/share/tt-rss/config.php, be sure to have the following
lines.
define('DB_TYPE', "pgsql");
define('DB_HOST', "localhost");
define('DB_USER', "ttrss");
define('DB_NAME', "ttrss_db");
define('DB_PASS', "ttrss_user_password");
define('SELF_URL_PATH', 'http://localhost/');
13. Start PHP-FPM daemon.
${RCD_SCRIPTS_DIR}/php_fpm start
14. Start nginx httpd server.
${RCD_SCRIPTS_DIR}/nginx start
15. Access http://localhost/ , and login with
login/password = "admin"/"password".
===========================================================================