Howto Mongoose PHP PostgreSQL TT-RSS on Windows

Howtos, instructions and links to related software. Do not ask questions here.
tractrix
Bear Rating Trainee
Bear Rating Trainee
Posts: 3
Joined: 22 May 2013, 08:15

Howto Mongoose PHP PostgreSQL TT-RSS on Windows

Postby tractrix » 23 May 2013, 13:23

This tutorial shows how to setup a Tiny Tiny RSS server on a local Windows OS. It uses mongoose http server, PHP, PostgreSQL, and TT-RSS. Since TT-RSS will be running on the local machine, focus will be narrowed on usability. You should adopt security measures if necessary.

And be aware, TT-RSS running on Windows is not officially supported, so don't expect any answers from a TT-RSS developer. If it become broken someday, or you find a bug, please verify on an officially supported OS before reporting. And use Firefox or Chrome, instead of IE.

No advanced computer skills required to complete the tutorial. You only need to know how to make new folders, copy, rename files, and browse the Internet then download files, and extract files from zip archives, and edit plain text files.

You will need a decent text editor that can handle UNIX EOL, if you don't know what this means, you can just download and use Notepad++ from
http://notepad-plus-plus.org

The following procedures are tested under Windows 7 Professional 64-bit.

I. Download the latest version of the following software:

1. Mongoose Windows executable, from
https://code.google.com/p/mongoose/downloads/list
At the time of writing it's mongoose-3.7.exe

2. PHP Windows x86 thread safe binaries zip, from
http://www.php.net/downloads.php
At the time of writing it's php-5.4.15-Win32-VC9-x86.zip

3. PostgreSQL binaries from installer - Win x86-32, from
http://www.enterprisedb.com/products-services-training/pgbindownload
At the time of writing it's postgresql-9.2.4-1-windows-binaries

4. Tiny Tiny RSS, from
https://github.com/gothfox/Tiny-Tiny-RSS
Click the ZIP button, you get master.zip

II. Make the TT-RSS folder tree

1. Make a new folder that about to hold all TT-RSS related stuff. I use "C:\http" as example, you could change. Any path not containing spaces is considered appropriate. For example, "D:\mystuff\tt-rss-server" is good, but "C:\my stuff\http server" is bad.

2. Do some file operations to make a folder look like below. You may need to copy, rename, extract, and even delete files.

C:\http contains 4 objects:
mongoose.exe file renamed
pgsql folder extracted/renamed
php folder extracted/renamed
web_root folder manually created

C:\http\pgsql contains 3 objects extracted from PostgreSQL zip archive
bin folder, extracted as is
lib folder, extracted as is
share folder, extracted as is

C:\http\php contains 8 objects extracted from PHP zip archive
libeay32.dll file
libpq.dll file
php.ini-production file
php-cgi.exe file
php-win.exe file
php5ts.dll file
ssleay32.dll file
ext folder

C:\http\php\ext contains 3 files extracted from PHP zip archive
php_curl.dll file
php_mbstring.dll file
php_pgsql.dll file

C:\http\web_root contains 1 folder
tt-rss folder by extracting everything from TT-RSS zip archive, renamed

III. Setup Mongoose and PHP

1. Create a text file c:\http\mongoose.conf, encoded in ANSI, Windows EOL, with 3 lines of

Code: Select all

cgi_interpreter C:\http\php\php-cgi.exe
listening_ports 80
document_root C:\http\web_root


2. rename php.ini-production as php.ini, edit to make sure it contains the following lines

Code: Select all

extension_dir = "ext"
extension=php_curl.dll
extension=php_mbstring.dll
extension=php_pgsql.dll


You may remove the leading semicolons to get it right.

3. Create a text file C:\http\web_root\index.php, write 3 lines to it

Code: Select all

<html>
<?php phpinfo();?>
</html>


4. Run C:\http\mongoose.exe as administrator, then find its icon in system tray, right-click and choose Install Service, right-click again and choose Exit.

Win+R to open the Run window, run services.msc. Find Mongoose in the service list, right-click and choose properties, then choose "Log On" tab, choose "This account", Fill in "Network Service" and leave the two password fields blank. Click OK to close the window.

Right-click Mongoose in the service list again, choose start.

It's OK to keep it blocked if any firewall pop-up window asks.

5. Use your Internet Browser (Not IE) to open the link below
http://localhost
You should see the PHP info page.

IV. Setup the database

Run Command Prompt as administrator, then execute the following commands one by one

Code: Select all

C:
cd C:\http\pgsql\bin
initdb -E UTF8 --lc-messages="american-english" -D "C:\http\pgsql\data"


scroll up and find the line saying
"The files belonging to this database system will be owned by user "UserName"
remember the user name between the quotations because we will use it latter. Now continue executing commands.

Code: Select all

pg_ctl register -N PostgreSQL -U "NT AUTHORITY\NetworkService" -D "C:\http\pgsql\data" -S auto
net start PostgreSQL
createdb ttrss
psql -d ttrss -f "C:\http\web_root\tt-rss\schema\ttrss_schema_pgsql.sql"


Close the Command Prompt window.

V. Setup TT-RSS

1. Copy the file C:\http\web_root\tt-rss\config.php-dist as config.php, then edit to make sure the following lines are right

Code: Select all

define('DB_TYPE', "pgsql");
define('DB_HOST', "");
define('DB_USER', "[i]UserName[/i]"); <- fill in the user name you remembered when setting up database
define('DB_NAME', "ttrss");
define('DB_PASS', "");
define('DB_PORT', '');
define('SELF_URL_PATH', 'http://localhost/tt-rss/');
define('PHP_EXECUTABLE', 'C:/http/php/php-win.exe');
define('CHECK_FOR_NEW_VERSION', false);
define('PLUGINS', 'auth_internal, note');


2. Make the feeds update daemon auto start on every boot. The command to use is

Code: Select all

C:\http\php\php-win.exe "C:\http\web_root\tt-rss\update.php" --daemon


Run Task Scheduler, follow the menu Action -> Create Task, see the snapshots for reference. after adding the task, run it manually.
SNAG-0000.png
daemon-scheduler-01
SNAG-0000.png (14.78 KiB) Viewed 8046 times

SNAG-0001.png
daemon-scheduler-02
SNAG-0001.png (13.04 KiB) Viewed 8046 times

SNAG-0002.png
daemon-scheduler-03
SNAG-0002.png (13.86 KiB) Viewed 8046 times


VI. All done, browser to http://localhost/tt-rss, login using admin / password, and Enjoy.

roshambo
Bear Rating Trainee
Bear Rating Trainee
Posts: 35
Joined: 19 Jun 2013, 20:03

Re: Howto Mongoose PHP PostgreSQL TT-RSS on Windows

Postby roshambo » 25 Jun 2013, 00:27

Thanks for this, it really helped and only took about 10 minutes to do. It's all working great except when importing OPML there's an error code 6 (restricted access?). I forced logout and deleted cookies like the FAQ mentions to no avail. WAMP imports just fine. Any ideas?

tractrix
Bear Rating Trainee
Bear Rating Trainee
Posts: 3
Joined: 22 May 2013, 08:15

Re: Howto Mongoose PHP PostgreSQL TT-RSS on Windows

Postby tractrix » 26 Jun 2013, 19:06

roshambo wrote:Thanks for this, it really helped and only took about 10 minutes to do. It's all working great except when importing OPML there's an error code 6 (restricted access?). I forced logout and deleted cookies like the FAQ mentions to no avail. WAMP imports just fine. Any ideas?

By default PHP tries to use an unaccessible location as upload temp directory. So all we have to do is to change it.

Open php.ini and search for "upload_tmp_dir", uncomment it and set to a valid path, for example:

Code: Select all

upload_tmp_dir = C:\http\web_root\upload-tmp\

You may have to make the new upload-tmp dir.

It should be working now.

roshambo
Bear Rating Trainee
Bear Rating Trainee
Posts: 35
Joined: 19 Jun 2013, 20:03

Re: Howto Mongoose PHP PostgreSQL TT-RSS on Windows

Postby roshambo » 26 Jun 2013, 20:41

That did it, thanks!


Return to “Knowledge Base”

Who is online

Users browsing this forum: No registered users and 1 guest