Skip to content
Newer
Older
100644 613 lines (460 sloc) 25.7 KB
18f2698 @CaptTofu Initial revision
CaptTofu authored
1 NAME
2 INSTALL - Slash Installation
3
4 SOFTWARE REQUIREMENTS
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
5 Whatever versions listed are the versions recommended. You may try a
6 newer version, and it should work, but it is not guaranteed (of course,
7 nothing in here is guaranteed anyway :). Don't try to use anything older
8 than these listed versions.
18f2698 @CaptTofu Initial revision
CaptTofu authored
9
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
10 This document is still evolving, so there may be unintended omissions or
11 various steps may be over- or under-explained. It's assumed that you
12 have some working experience with some form of Unix, Apache, SQL
13 database, and perl.
18f2698 @CaptTofu Initial revision
CaptTofu authored
14
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
15 Note: This page looks best in a browser (the HTML version of it is in
16 the docs/ directory). You can print it out, but some of the ASCII
17 illustrations may get munged in printing; however, the directions will
18 certainly appear good enough to read.
18f2698 @CaptTofu Initial revision
CaptTofu authored
19
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
20 See the Slash web site, with support, docs, latest downloads, and more,
21 at http://slashcode.com/.
18f2698 @CaptTofu Initial revision
CaptTofu authored
22
23 Database, webserver, etc.
24
25 MySQL
26 version 3.22.25
27 http://www.mysql.com/
28
29 mod_perl
30 version 1.21
31 http://perl.apache.org/
32 http://www.perl.com/CPAN/
33
34 perl
35 version 5.005_03 (non-threaded)
36 http://www.perl.com/CPAN/
37
38 Apache
39 version 1.3.6
40 http://apache.org/
41
42 Sendmail or other mail transport daemon
43 Refer to your OS distribution.
44
45 NFS server (for nfs configuration)
46 Refer to your OS distribution.
47
48 Perl modules
49
23f6ce8 @pudge Doc updates for upcoming slash-1.0.6
pudge authored
50 DBI-1.14
18f2698 @CaptTofu Initial revision
CaptTofu authored
51 http://search.cpan.org/search?dist=DBI
52
53 Data-ShowTable-3.3
54 http://search.cpan.org/search?dist=Data-ShowTable
55
56 TimeDate-1.08
57 http://search.cpan.org/search?dist=TimeDate
58
59 Msql-Mysql-modules-1.2209
60 http://search.cpan.org/search?dist=Msql-Mysql-modules
61
62 ApacheDBI-0.87
63 http://search.cpan.org/search?dist=ApacheDBI
64
65 Apache-DBILogConfig-0.01
66 http://search.cpan.org/search?dist=Apache-DBILogConfig
67
68 Apache-DBILogger-0.93
69 http://search.cpan.org/search?dist=Apache-DBILogger
70
71 libnet-1.0607
72 http://search.cpan.org/search?dist=libnet
73
74 HTML-Parser-2.25
75 http://search.cpan.org/search?dist=HTML-Parser
76
77 XML-Parser-2.27
78 http://search.cpan.org/search?dist=XML-Parser
79
80 MIME-Base64-2.11
81 http://search.cpan.org/search?dist=MIME-Base64
82
83 Digest-MD5-2.09
84 http://search.cpan.org/search?dist=Digest-MD5
85
86 URI-1.04
87 http://search.cpan.org/search?dist=URI
88
89 libwww-perl-5.47
90 http://search.cpan.org/search?dist=libwww-perl
91
92 DateManip-5.35
93 http://search.cpan.org/search?dist=DateManip
94
95 File-Spec-0.8
96 http://search.cpan.org/search?dist=File-Spec-0.8
97
e94af4d @pudge v1.0.3. Merge with Slashdot merge. Yay!
pudge authored
98 Mail-Sendmail-0.77
99 http://search.cpan.org/search?dist=Mail-Sendmail
18f2698 @CaptTofu Initial revision
CaptTofu authored
100
101 Compress-Zlib-1.08
102 http://search.cpan.org/search?dist=Compress-Zlib
103
104 Image-Size-2.901
105 http://search.cpan.org/search?dist=Image-Size
106
107 Storable-0.6.9
108 http://search.cpan.org/search?dist=Storable
109
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
110 Note: IPC::Shareable is only needed for the troll speed limit
111 feature, which is off by default (settable via the `use_ipc'
112 variable in slashdotrc.pl). Also, on all of our test systems, some
113 of the tests in `make test' failed, but the module seems to work
114 fine for our purposes regardless.
18f2698 @CaptTofu Initial revision
CaptTofu authored
115
116 Slash Code
117
118 Bundle/Slash.pm
119 Slash.pm
120 slashd
121 moderatord
122 portald
123 dailyStuff
124 public_html/index.pl
125 public_html/comments.pl
126 public_html/article.pl
127 public_html/admin.pl
128 public_html/hof.pl
129 public_html/cheesyportal.pl
130 public_html/authors.pl
131 public_html/metamod.pl
132 public_html/nominate.pl
133 public_html/pollBooth.pl
134 public_html/search.pl
135 public_html/sections.pl
136 public_html/submit.pl
137 public_html/topics.pl
138 public_html/users.pl
139 public_html/404.pl
140 public_html/imagesize.pm
141
c461028 @pudge Doc updates for 1.0.3.
pudge authored
142 You can get the Slash code in these locations:
143
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
144 FTP
145 ftp://ftp.slashdot.org//pub/slash/
c461028 @pudge Doc updates for 1.0.3.
pudge authored
146
147 HTTP, CVS
148 http://sourceforge.net/project/?group_id=4421
149
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
150 The CVS repository is tagged with versions, so to get release 1.0.3,
151 get tag "v1_0_3_0". The last number will be incremented during
152 development ("v1_0_3_1", "v1_0_3_2", etc.) until the next release.
153 Sometimes, a release may be tagged with a last number of something
154 other than "0". Exactly what tag a given release is based on is in
155 README.
7ed36eb @pudge Final doc changes (really!) for 1.0.3.
pudge authored
156
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
157 There is a separate development branch of Slash. Its branch is
158 "bender". Primarily small changes and bugfixes will go into the MAIN
159 branch, with major changes going into the development branch.
c461028 @pudge Doc updates for 1.0.3.
pudge authored
160
46f5bd0 @pudge doc updates for 1.0.5
pudge authored
161 Hardware Requirements
162
163 None. Whatever it takes to run the above software and handle the
164 traffic you may be getting. You could probably do it on a 486 with
165 32MB and 250MB hard drive space, but we wouldn't recommend it.
166 Minimum setup would probably be some sort of Pentium 133 or higher,
167 128MB, and 1GB HD. I'd shoot for at least a Pentium II/200+ MHz,
168 256MB, 2GB. Consider also that the httpd machine might be different
169 from the mysql machine, you can keep the number of httpds real low,
170 etc. Do what works.
171
18f2698 @CaptTofu Initial revision
CaptTofu authored
172 PRE-INSTALLATION THOUGHTS
173 The are several configurations recommended, depending on scale.
174
175 Single server (all on one box)
176 Server 1
177 +-------------------+
178 | slash db |
179 | apache/mod-perl |
180 | slash code |
181 +-------------------+
182
183 db and code on one server, and external webserver
184 server 1 server 2 .. n
185 +-----------------+ +-----------+
186 | slash db | | |
187 | apache/mod-perl |---- NFS or exact copy ----| Webserver |
188 | slash code |---- NFS or exact copy ----| |
189 +-----------------+ +-----------+
190 |_________________ DBI __________________|
191
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
192 db separate on one server, slashdot code and apache on another, exported
193 to web servers
18f2698 @CaptTofu Initial revision
CaptTofu authored
194 server 1 server2 server 3 .. n
195 +-----------+ +-----------------+ +-----------+
196 | slash db | | | | |
197 | | | apache/mod-perl |--- NFS or exact copy ---| Webserver |
198 | | | slash code |--- NFS or exact copy ---| |
199 +-----------+ +-----------------+ +-----------+
200 |______ DBI _________|_______________________________________|
201
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
202 There are many ways this can be done. The key is to think about how the
203 site will be put together before starting the installation.
18f2698 @CaptTofu Initial revision
CaptTofu authored
204
205 INSTALLATION AND SETUP
206 Perform these tasks as root.
207
208 1. Create the group "slash".
209
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
210 2. Create the user "slash" with slashdot gid. Note: if using multiple
211 webservers, and using NFS, make sure that this user:group is created
212 with the same UID and GID on all involved systems.
18f2698 @CaptTofu Initial revision
CaptTofu authored
213
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
214 Note: For security's sake, you may wish to add the web server user
215 (e.g., "nobody") to the "slash" group, and then set your permissions
216 so that all the files are writable by user and group and not world,
217 to keep other users on the system from modifying the files.
18f2698 @CaptTofu Initial revision
CaptTofu authored
218
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
219 3. Unpack the slash code tarball in the slash user's home directory.
220 This will place everything where it should belong.
18f2698 @CaptTofu Initial revision
CaptTofu authored
221
222 4. chown everything in this tree as slash:slash (i.e., `chown -R
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
223 slash:slash /home/slash'). chmod the main directory to be readable
224 and executable by all (i.e., `chmod a+rx /home/slash').
18f2698 @CaptTofu Initial revision
CaptTofu authored
225
226 5. Create the directory apache will be installed into (i.e.,
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
227 /usr/local/apache). The default install uses a separate directory
228 for apache logs, which should also be created as
229 /usr/local/apache_logs. Alternatively, change httpd.conf to point to
230 a different location. See the section below on installing perl
231 modules for more information about the default installation.
232
233 Multiple slash instances can run under virtual hosts on the same
234 httpd. See vhost.httpd.conf for an example of how this works. Pay
235 special attention to the configuration section under the text "#
236 MAIN SLASHCODE SPECIFIC STUFF STARTS HERE #".
237
238 For virtual hosts, you should create a separate account and Slash
239 installation for each virtual host, so repeat the instructions
240 relating to creation of accounts for each virtual host.
241
242 6. Install MySQL. Please refer to MySQL documentation for compilation
243 and/or installation notes for any questions with this. Find the
244 script that runs mysql (probably safe_mysqld) and add this to the
245 beginning of it:
18f2698 @CaptTofu Initial revision
CaptTofu authored
246
247 TZ=GMT
248 export TZ
249
250 7. Create the slash mysql user and database.
251
252 mysql mysql < sql/slashdb_create.sql
253
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
254 This will create both the slash db user and slash db. If you are
255 using virtual hosts, or want to otherwise change the db user or db
256 name, edit this script before running it to use the proper db user
257 and db name. This script creates the user slash with the password
258 "changethis". Immediately change the password for slash in mysql:
18f2698 @CaptTofu Initial revision
CaptTofu authored
259
260 mysql mysql
261 update user set Password = password('newpassword') where User = 'slash';
262 flush privileges;
263
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
264 Note: The slash db user is created with several privileges such as
265 drop and create table, so it's up to you to modify those privileges
266 to something more restrictive if you feel uncomfortable with these
267 settings. We'd suggest you don't let other users on the database
268 have access to this user.
269
270 8. Run the slash schema creation script and load sample slash db data
271 dump. This dump has minimal data for the system to work. This data
272 is needed in the database for the site to work at all. It has a very
273 plain, basic design, that has a lot of HTML comments in each block
274 to give an idea of how the site works. Other data in this dump is
275 tables that the system needs to do things such as time conversion
276 for user date format strings. Please refer to the database schema
277 and database schema documentation to understand how the database
18f2698 @CaptTofu Initial revision
CaptTofu authored
278 schema works.
279
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
280 Replace `HOSTNAME' (or `HOSTNAME:PORT') below with the server's
281 hostname (this is the name you will call the server in the browser,
282 used for default links in the HTML).
18f2698 @CaptTofu Initial revision
CaptTofu authored
283
284 cd sql
285 mysql -uslash -pnewpassword slash < slashschema_create.sql
286 ./predata_dump.pl HOSTNAME
287 mysql -uslash -pnewpassword slash < slashdata_dump.sql
288 mysql -uslash -pnewpassword slash < slashdata_prep.sql
289
290 9. Install perl.
291
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
292 On Slashdot and Slashcode, we have all of the modules installed in
293 the Apache directory, so that we can NFS mount that one directory on
294 several machines, and they all have the same modules and
295 configuration. If you want to do that, when the configuration
296 process asks where you want to put perl modules (both system and
297 local) have it put them in the directory tree you'll install apache
298 in (i.e., /usr/local/apache/lib). Otherwise, the default
299 installation directories are usually fine.
18f2698 @CaptTofu Initial revision
CaptTofu authored
300
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
301 10. Untar apache and mod_perl. Build mod_perl. Have its build process
302 build and install apache for you:
18f2698 @CaptTofu Initial revision
CaptTofu authored
303
304 perl Makefile.PL APACHE_SRC=/where_you_have_the_source DO_HTTPD=1 \
305 USE_APACI=1 PERL_MARK_WHERE=1 EVERYTHING=1 \
306 APACHE_PREFIX=/where_apache_will_be_installed
307 make
308 make test
309 make install
310
311 This will install both mod_perl and apache.
312
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
313 You MUST install mod_perl and Apache as directed here. OK, that is
314 not strictly true, but it is mostly true. If you already have
315 mod_perl installed, chances are it is not configured properly to
316 work with Slash and you must rebuild it. If you are using the
317 provided httpd.conf file from the slash distribution, and Apache is
318 giving you errors, chances are mod_perl is not installed correctly,
319 and you need to build it from scratch.
18f2698 @CaptTofu Initial revision
CaptTofu authored
320
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
321 11. Install the listed perl modules in the order listed in the section
322 on "Perl Modules". You can use CPAN if you want, or ftp, untar and
323 do it yourself. Use whichever does the job.
18f2698 @CaptTofu Initial revision
CaptTofu authored
324
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
325 Note that the module versions Slash has been tested with are given;
326 use other versions at your own risk. We actually think that the
327 current version of each module as of this note will work, so if you
328 are brave, go ahead and install the latest.
329
330 You can get the files via FTP yourself from CPAN and then install
331 each by hand, or, if you can get the CPAN module running, you can
332 use that. There are several ways to use the CPAN shell to install
333 modules. You can install each one individually:
18f2698 @CaptTofu Initial revision
CaptTofu authored
334
335 perl -MCPAN -e shell
336 # some configuration / initialization stuff
337 > install DBI
338
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
339 Or, you can install all of them at once using the Bundle::Slash
340 module. This method is the easiest, but if something does not work
341 right, it can be more of a pain to track it down.
18f2698 @CaptTofu Initial revision
CaptTofu authored
342
343 cd /home/slash
344 perl -MCPAN -e "install 'Bundle::Slash'"
345
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
346 You may also want to use CPAN shell to install Bundle::libnet,
347 Bundle::LWP, Bundle::DBI, Bundle::DBD::mysql, and then the rest of
348 the modules. See the manpage the perlmodinstall manpage for more
349 information about using CPAN and installing modules.
18f2698 @CaptTofu Initial revision
CaptTofu authored
350
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
351 Note: Compress::Zlib is now required, and it won't install properly
352 if the zlib development headers are not available. See the
353 documentation for Compress::Zlib for more information.
18f2698 @CaptTofu Initial revision
CaptTofu authored
354
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
355 Note: File::Spec is now required, but a version beyond what comes
356 with perl 5.00503 is required. Use `make install UNINST=1` to remove
357 the version that comes with perl while installing the new version.
358 Even if using the CPAN shell you can do this:
18f2698 @CaptTofu Initial revision
CaptTofu authored
359
360 cpan> test File::Spec # download, make, and test
361 cpan> look File::Spec # opens shell to proper dir
362 % make install UNINST=1 # install from shell
363
364 12. Copy the slash httpd.conf from the untarred slash code tarball's
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
365 directory httpd (i.e., /home/slash/httpd/httpd.conf) to apache's
366 conf directory. Take time to look over the file to make sure that it
367 matches your site's specific setup. Similarly edit
368 /home/slash/slashdotrc.pl.
18f2698 @CaptTofu Initial revision
CaptTofu authored
369
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
370 For httpd.conf, pay close attention to directories and to the number
371 of servers and the max clients and requests. The defaults are
372 similar to Slashdot's defaults, but most sites will not need 20
373 servers with over 100 maximum requests per child process.
18f2698 @CaptTofu Initial revision
CaptTofu authored
374
375 In slashdotrc.pl, make sure you have reasonable defaults for
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
376 everything. If you are upgrading, then you will likely want to make
377 a copy of your old slashdotrc.pl and copy those values into the new
378 file, since it is subject to change significantly from one release
379 to the next.
18f2698 @CaptTofu Initial revision
CaptTofu authored
380
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
381 If your web server is inside a firewall, you may wish to set the
382 rootdir variable to "" (it is below the other variables, toward the
383 bottom), so all links will be relative to /.
18f2698 @CaptTofu Initial revision
CaptTofu authored
384
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
385 If you are doing virtual hosting for multple Slash sites, see the
386 instructions at the bottom of slashdotrc.pl and the sample
387 configuration at the bottom of httpd.conf.
18f2698 @CaptTofu Initial revision
CaptTofu authored
388
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
389 13. Create /etc/apache.listen (where `MY.IP.ADD.RESS' is the IP address
390 Apache will be listening on):
18f2698 @CaptTofu Initial revision
CaptTofu authored
391
392 echo "Listen MY.IP.ADD.RESS:80" > /etc/apache.listen
393
394 14. Start apache.
395
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
396 15. Copy the slashd startup script from the Slash source directory (i.e.
397 /home/slash/utils) slashd into the init.d directory (/etc/init.d on
398 Debian). Chown it to the slash user (i.e., `chown slash:slash
399 /etc/init.d/slashd') and then chmod it u+s and g+s (i.e., `chmod u+s
400 /etc/init.d/slashd', `chmod g+s /etc/init.d/slashd') Create all the
401 links to this file for the various run levels. Note: this script is
402 a startup script, and is not the same script as the slashd in the
403 same directory as Slash.pm.
18f2698 @CaptTofu Initial revision
CaptTofu authored
404
405 16. Start slashd with the startup script (i.e., `/etc/init.d/slashd
406 start').
407
408 17. Log into the server administration.
409
410 http://whateveryoursiteiscalled.com/admin.pl
411
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
412 The admin user/password is God/pete (you'll need to change this).
18f2698 @CaptTofu Initial revision
CaptTofu authored
413
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
414 This page allows you to approve submissions to be run as stories,
415 add new stories, edit stories, edit the blocks of html, code, and
416 variables that control the look and feel of the site.
18f2698 @CaptTofu Initial revision
CaptTofu authored
417
418 The system has 7 users:
419
420 author1
421 author2
422 Anonymous Coward
423 user1
424 user2
425 user3
426 user4
427
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
428 The passwords are all "change". As that implies, you should change
429 it. It's clear text, so simply change it via the database, although
430 you can use the server administration, too. If you do not change all
431 your passwords, you almost certainly will get haX0rD.
18f2698 @CaptTofu Initial revision
CaptTofu authored
432
433 mysql -uslash -pslashpass slash
434
435 Then for each author:
436
437 update authors set pwd='newpassword' where aid='authorname';
438
439 And for each user:
440
441 update users set passwd='newpassword' where nickname='username';
442
443 You can see all of the authors and users with these:
444
445 select aid,pwd from authors;
446 select nickname,passwd from users;
447
448 Running Slash on Multiple Servers
449
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
450 1. Make sure that each of those servers has an EXACT copy of the entire
451 apache tree (modules and all).
18f2698 @CaptTofu Initial revision
CaptTofu authored
452
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
453 2. Either remote copy recursively, or simply export the entire apache
454 tree via NFS (read-only) to the servers you intend to be the web
455 servers.
18f2698 @CaptTofu Initial revision
CaptTofu authored
456
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
457 3. Make sure that whatever box is running slashd has all of its code
458 and static documents exported to those web servers as well
459 (read-only).
18f2698 @CaptTofu Initial revision
CaptTofu authored
460
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
461 4. Make sure that the slash user in mysql can access the database from
462 any host that has the code on it:
18f2698 @CaptTofu Initial revision
CaptTofu authored
463
464 mysql mysql
465 insert into user values
466 ('webserver1','slash',password('newpassword'),'Y','Y','Y','Y','Y','N','N','N','Y','Y','Y','Y','Y','Y');
467 insert into user values
468 ('webserver2','slash',password('newpassword'),'Y','Y','Y','Y','Y','N','N','N','Y','Y','Y','Y','Y','Y');
469 insert into user values
470 ('webserver3','slash',password('newpassword'),'Y','Y','Y','Y','Y','N','N','N','Y','Y','Y','Y','Y','Y');
471 insert into user values
472 ('webserverN','slash',password('newpassword'),'Y','Y','Y','Y','Y','N','N','N','Y','Y','Y','Y','Y','Y');
473 flush privileges;
474
475 Database Upgrades From Previous Versions
476
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
477 Slash is data. When we release a new version, it often has updates to
478 the database, too. As such, updates can be difficult.
18f2698 @CaptTofu Initial revision
CaptTofu authored
479
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
480 We have provided upgrade scripts from previous versions of slash. Each
481 script upgrades from the version immediately preceding it, so 0.9.2
482 users, to upgrade to 0.9.5, would need to run the 0.9.3 scripts, then
483 the 0.9.4 scripts, then the 0.9.5 scripts.
18f2698 @CaptTofu Initial revision
CaptTofu authored
484
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
485 The scripts are stored in sql/updates/x.x.x/, where x.x.x is the version
486 to upgrade to. The .sql scripts can be run like so:
18f2698 @CaptTofu Initial revision
CaptTofu authored
487
488 mysql -uslash -pslashpass slash < updatescript.sql
489
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
490 The Perl scripts should be run, however, from the main slash directory,
491 so all of the libraries can be found:
18f2698 @CaptTofu Initial revision
CaptTofu authored
492
493 cd /home/slash
494 ./sql/updates/0.9.5/updatescript.pl
495
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
496 You may also at some point choose to reinitialize the database from
497 scratch. For that, you can do something like this:
18f2698 @CaptTofu Initial revision
CaptTofu authored
498
499 mysql mysql
500 mysql> drop database slash;
501 mysql> create database slash;
502 mysql> quit
503
504 cd sql
505 mysql -uslash -pslashpass slash < slashschema_create.sql
506 mysql -uslash -pslashpass slash < slashdata_dump.sql
507 mysql -uslash -pslashpass slash < slashdata_prep.sql
508
509 Upgrade 0.9.2 -> 0.9.3
510
511 If you have already installed slash-0.9.2, you may use the
512 alter_database.sql script to update the database, then run
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
513 blocks_update.pl (make sure you change the connect string) if you don't
514 want to start your database over from scratch. However, the blocks table
515 contains a lot of updated data in slash-0.9.3 that must be fixed in
516 order for slash-0.9.3 to work at all: global variables in the blocks
517 (like $rootdir and $fg[2]) must be changed to the new style ($I{rootdir}
518 and $I{fg}[2]}). You can do this by hand, or use the dumped data in
18f2698 @CaptTofu Initial revision
CaptTofu authored
519 slashblocks_dump.sql.
520
521 Upgrade 0.9.3 -> 0.9.4
522
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
523 The tables blocks and sectionblocks needed to be fixed to make it so
524 that they had a 1:1 correlation on every record for the admin interface
525 to be able to work correctly. There was a bad mismatch between the two
526 tables. We've added processes to help upgrade for those that have put a
527 lot of work into customizing their sites and don't want to lose any of
528 their work. First, back up the blocks table by doing a dump, or simply
529 back up individual blocks by doing the following:
18f2698 @CaptTofu Initial revision
CaptTofu authored
530
531 1. Check to see that your block has an entry in both blocks and
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
532 sectionblocks in the case the admin.pl didn't get it in there
533 properly:
18f2698 @CaptTofu Initial revision
CaptTofu authored
534
535 select count(*) from blocks where bid = 'myownblock';
536 select count(*) from sectionblocks where bid = 'myownblock';
537
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
538 2. If there's only one of the bids in either record, you can insert an
539 entry by hand for that record as shown here.
18f2698 @CaptTofu Initial revision
CaptTofu authored
540
541 If it is blocks that it's missing from, for a static block:
542
543 insert into blocks values ('myownblock','','',500,'',NULL);
544
545 For a portal block (something that's fetched via portald):
546
547 insert into blocks values ('myownblock','','',500,'portald',NULL);
548
549 If it is sectionblocks that it's missing from:
550
551 insert into sectionblocks values ('','myownblock',0,'',0,NULL,NULL,0);
552
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
553 If there are more than one record for a bid in sectionblocks, delete
554 one of them (probably the one without a section).
18f2698 @CaptTofu Initial revision
CaptTofu authored
555
556 3. If you want to back up a specific block, try something like:
557
558 select * from blocks where bid = 'myownblock' into outfile '/tmp/blocks.myownblock.txt';
559 select * from sectionblocks where bid = 'myownblock' into outfile '/tmp/blocks.myownblock.txt';
560
561 4. Run the sql script blocks_fix.sql. This script makes sure every
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
562 record has a match in each table, and also modifies the bid column
563 in sectionblocks to be the same as it is in blocks, as well as some
564 other fixes to some of the blocks:
18f2698 @CaptTofu Initial revision
CaptTofu authored
565
566 mysql -uslash -pslashpass < blocks_fix.sql
567
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
568 Keep note of any errors you might see. On a new 0.9.3 distribution,
569 untouched, unmodified data, this worked without incident.
18f2698 @CaptTofu Initial revision
CaptTofu authored
570
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
571 5. Run the sql script blocks_alter.sql. This script drops the existing
572 primary key on sectionblocks, which is a combination of bid and
573 section, and creates a new primary key on bid (which prevents
574 duplicates of the same bid).
18f2698 @CaptTofu Initial revision
CaptTofu authored
575
576 mysql -uslash -pslashpass < blocks_alter.sql
577
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
578 If this gives you an error, it is most likely due to the fact that
579 there are duplicate bids in sectionblocks. Identify those records
580 and delete the extra one, then retry this script. All block ids
581 (bid) must be unique.
18f2698 @CaptTofu Initial revision
CaptTofu authored
582
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
583 6. If you deleted any of the blocks that you backed up as show in step
584 3, you can restore those blocks this way:
18f2698 @CaptTofu Initial revision
CaptTofu authored
585
586 load data infile '/tmp/blocks.myownblock.txt' INTO TABLE blocks;
587 load data infile '/tmp/sectionblocks.myownblock.txt' INTO TABLE sectionblocks;
588
589 Upgrade 0.9.4 -> 0.9.5
590
7bd6193 @pudge General changes for 1.0.4 release
pudge authored
591 Just run the scripts in the sql/updates/0.9.5/ directory. The scripts
592 blocks_backup.sql and fix_matchname.pl will update the data and
593 structure of the database, and everyone should run them. The script
594 blocks_update.sql should only be run by people who want some of their
595 blocks data changed. Examine the script and CHANGES and determine if you
596 want to run the script, or whatever.
18f2698 @CaptTofu Initial revision
CaptTofu authored
597
23f6ce8 @pudge Doc updates for upcoming slash-1.0.6
pudge authored
598 Other Upgrades
18f2698 @CaptTofu Initial revision
CaptTofu authored
599
23f6ce8 @pudge Doc updates for upcoming slash-1.0.6
pudge authored
600 From To Run Scipts in Dir
601 ------- ------- --------------------
602 0.9.5 -> 1.0.0 sql/updates/1.0.0/
603 1.0.0 -> 1.0.0.1 sql/updates/1.0.0.1/
604 1.0.0.1 -> 1.0.2 sql/updates/1.0.2/
605 1.0.2 -> 1.0.3 sql/updates/1.0.3/
606 1.0.3 -> 1.0.4 sql/updates/1.0.4/
607 1.0.4 -> 1.0.5 sql/updates/1.0.5/
608 1.0.5 -> 1.0.6 sql/updates/1.0.6/
46f5bd0 @pudge doc updates for 1.0.5
pudge authored
609
18f2698 @CaptTofu Initial revision
CaptTofu authored
610 AUTHOR
23f6ce8 @pudge Doc updates for upcoming slash-1.0.6
pudge authored
611 Patrick Galbraith and Chris Nandor. Last Modified July 10, 2000.
18f2698 @CaptTofu Initial revision
CaptTofu authored
612
Something went wrong with that request. Please try again.