-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathINSTALL
191 lines (131 loc) · 5.31 KB
/
INSTALL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
REQUIRED SOFTWARE:
Make sure you have the following sofware packages installed:
- Web server (tested with Apache 2.2)
- PHP 5.x
- PHP modules:
- Curl
- MySQLi (not MySQL)
- XML Parser (php5-xml package for FreeBSD).
- (optional) php5-json
- MySQL 5.x
- (optional) HTMLPurifier, from http://www.htmlpurifier.org/
which in turn requires
- ctype PHP module
- apache2-utils Debian package (for htdigest)
INSTALLATION:
- Unpack the Newsbite distribution
If you're reading this, you've probably unpacked the source tarball.
If not, do so now.
- Create the database
In MySQL, as a user with administrative rights:
> create database newsbite character set 'utf8';
> use newsbite;
> source /path/to/schema.sql
where "/path/to/schema.sql" is the path to the "schema.sql" file in
the Newsbite distribution.
- Create a database user for the PHP scripts to access the database:
Pick a username and password for the PHP scripts to access the
database. Remember these, because you'll need them further
down.
In the example below, the database name is "newsbite", the
user is "newsbiteuser", and the password is
"newsbitepassword". Make substitutions as appropriate.
In MySQL, as a user with administrative rights:
> grant delete, insert, select, update, execute
on newsbite.*
to `newsbiteuser`@`localhost`
identified by "newsbitepassword";
- Quick directory overview
The main directories in the distribution include:
- htdocs: PHP scripts that will be accessed by the user's
browser. These need to be in the web server's DocumentRoot.
- lib: PHP files used by the scripts in "htdocs", but not
accessed directly by the browser. These do not need to be in
the DocumentRoot.
- plugins: PHP scripts used by the ones in "htdocs" and "lib",
but not accessed directly by the browser. These do not need
to be in the DocumentRoot.
- Install "htdocs"
Copy the "htdocs" directory from the distribution to where you
want it in the DocumentRoot.
- Add authentication in .htaccess
* To use digest authentication:
- Make sure mod_auth_digest is enabled in the Apache config:
LoadModule auth_digest_module /path/to/mod_auth_digest.so
- add to .htpasswd (in the same directory as the .php files):
AuthType Digest
AuthName "Newsbite on MySite"
AuthDigestDomain /newsbite/
AuthDigestProvider
AuthUserFile /path/to/.digest_pw
Require valid-user
- Create .digest_pw
> htdigest -c /path/to/.digest_pw "Newsbite on MySite" myusername
Adding password for myusername in realm Newsbite on MySite.
New password:
Re-type new password:
- Install "lib"
Copy the "lib" directory to where you want it. This does not
need to be in the DocumentRoot.
If you're not concerned with security, you can install it
underneath the "htdocs" directory.
- Install "plugins"
Copy the "plugins" directory to where you want it. By default,
this can go underneath "htdocs".
- Install HTMLPurifier
HTMLPurifier tidies up poorly-written HTML in feeds that can
mess up the layout of the page. One side effect is that it
also removes non-standard or non-whitelisted HTML elements,
which can make the feed look different from what the author
intended.
If you want to use it, install it somewhere:
- Unpack the HTMLPurifier distribution
- Put the "library" directory somewhere
and set HTMLPURIFIER_LIB in the config file.
- Edit the config file
"lib/config.inc" in the distribution contains configuration
options for Newsbite. Edit it (wherever you installed it).
Read the comments to see what each option does.
In particular, you'll need to set a server-side secret
password. This is never used by humans, so it's best to use a
randomly-generated string.
- Make sure the PHP files can find the "lib" files.
The distribution contains a "htdocs/.htaccess" file that tells
PHP to look for auxiliary files in "./lib". Change "./lib" to
the full pathname to wherever you put the "lib" directory.
That is, if "config.inc" is in /foo/bar/config.inc, then the
.htaccess file should contain
<IfModule mod_php5.c>
php_value include_path "/path/to/lib"
</IfModule>
where "/path/to/lib" is the directory where you put the lib/*
files.
If you're not running Apache, you'll have to do this some
other way.
- Configure PHP variables
- date.timezone:
Some of the time-related functions really want to know the
local time zone. Make sure it's set in php.ini:
date.timezone = America/New_York
- max_execution_time:
By default, PHP scripts run for a maximum of 30 seconds. If
you have a lot of feeds, some scripts (notably "update.php")
may time out. If this happens, you can up the execution time
by setting the "max_execution_time" PHP variable.
Either set it in your php.ini (you're on your own), or add a
line to your .htaccess:
<IfModule mod_php5.c>
php_value include_path "/path/to/lib"
php_value max_execution_time 60 # Add this
</IfModule>
- Point your browser at wherever you put the htdocs/* files.
You should be prompted for a password. Once you do, you'll see
a page with a toolbar and not much else.
- Add some feeds.
Click on "Add a feed". Or, if you have an OPML file from
another newsreader, you can import that with "Import OPML
file".
- (Optional) Add a cron job to update feeds
For instance:
0 7,9,11,14,17,20 * * * /usr/local/bin/php -d include_path=/path/to/lib /path/to/htdocs/update.php -i all
And you're finally done.