first cut of merge of STABLE-pre1_0 into HEAD. I won't even guarantee that it
[mir.git] / doc / INSTALL.mir
1 Here is a short installation-howto of Mir.
2
3
4 prerequisites: 
5
6 - tomcat 
7 - apache with mod_jk.so 
8 - postgres 7.1.x
9 - ant (a java-based make) 
10 - jaxp-1.1 (a SAX 2.0 compliant XML parser, comes with ant >= 1.4)
11
12 1. checkout the cvs
13
14 CVS LOGIN:
15
16         cvs -d :pserver: cvsanon@brazil.indymedia.de:/var/cvs login 
17         password: cvs 
18
19 CVS CHECKOUT:
20
21         cvs -d :pserver: cvsanon@brazil.indymedia.de:/var/cvs co mir 
22
23
24 2. customize the config: 
25
26         cd mir/source 
27         cp config.properties-dist config.properties 
28
29 now customize config.properties for your needs.
30
31
32 3. configure the build.sh file with java_home
33         cp build.sh-dist build.sh 
34         chmod 755 build.sh
35
36
37 4. copy the mir/templates-dist-directory to mir/templates
38
39
40 5. compile (do this as root so the permissions script is able to set
41 the permissions and owners correctly).
42
43         sh build.sh 
44
45
46 6. Link in the webapps directory of tomcat to the install directory (the 
47 directory is called "Mir" and is located in the same directory in which 
48 you installed the "mir" directory). 
49         cd /usr/share/tomcat/webapps
50         ln -s Mir-install-dir Mir
51
52 7. Modify your tomcat startup script and add an LD_LIBRARY_PATH variable
53 that points to the WEB-INF/lib directory of your Mir install dir. (called
54 "Mir"). Add something like the following at the top of tomcat.sh (tomcat.sh
55 is found in the "bin/" dir. under $TOMCAT_HOME):
56     LD_LIBRARY_PATH=/path/to/Mir-install-dir/WEB-INF/lib
57
58 An alternaive way to avoid this is to copy any dynamic library files 
59 ending with ".so" in WEB-INF/lib to your jre/jdk lib directory (where the 
60 other ".so" files live). Or, you can skip the whole thing and live without
61 "native" acceleration for image manipulation
62
63
64 8. create a new database 
65 the database name should be the same as in config.properties
66 as user postgres: 
67         createdb dbname 
68
69
70 9. create base table
71         psql -Upostgres dbname < dbscripts/create_pg.sql
72         cat dbscripts/help*.sql | psql -Upostgres dbname
73         cat dbscripts/populate*.sql | psql -Upostgres dbname
74
75
76 10. Add the dupe prevention trigger to the database:
77         cd dbscripts/dupetrigger
78         
79         There, read INSTALL and follow the instructions.
80         
81
82 11. Set permissions -- IMPORTANT! READ THIS!
83         We provide a script that sets all files' and direcories' permissions to
84         a quite reasonable state. The most important thing you have to do after
85     the invokation of this script is to ensure that the log files --
86     especially dbentity.log -- are not readable by users that could
87     compromise system security, because all passwords and the like will
88     be logged here.
89         
90         cp perms.sh-dist perms.sh
91         # Now, change the install directory and group in perms.sh
92         edit perms.sh 
93         ./perms.sh
94
95
96
97
98 12. restart tomcat 
99
100 13. configure mod_jk 
101
102 insert the following patch into /etc/apache/httpd.conf. Edit the directories
103 to suit your needs.
104
105 <IfModule mod_jk.c>
106 JkWorkersFile /usr/share/tomcat/conf/workers.properties
107 Include /usr/share/tomcat/conf/mod_jk.conf-auto
108 </IfModule>
109
110 Do not put any JkMount lines into your httpd.conf!
111
112 If mod_jk.conf-auto doesn't get written or is 0 bytes in size, check your
113 system for file ownership/permissions problems.
114
115
116 14. Add a password to your PostgreSQL user and link it to Mir (optional)
117
118 Add a hard to guess password to the PostgreSQL user database:
119
120 # psql -U postgres Mir
121 alter user postgres with password 'yourpassword';
122
123
124 Then, in /etc/postgresql/pg_hba.conf you should make sure that nobody can
125 use the database without a password:
126
127 local            all                                                                               password
128 host         all         127.0.0.1     255.0.0.0           password
129 host         all         0.0.0.0       0.0.0.0             reject
130
131
132 Then, change the database password line in config.properties:
133
134 Database.Username=postgres
135 Database.Password=yourpassword
136
137 You should make sure that no copy of config.properties (neither in mir nor
138 in Mir/src nor in Mir/WEB-INF/classes) is world-readable. Else you wouldn't
139 have to install a password, anyway.
140
141 If you can't access PostgreSQL after this for any reason, try and change
142 "password" in /etc/postgresql/pg_hba.conf to "trust". This should disable
143 any authentication method and make the database accessible again.
144
145 that's it :)
146
147 now the admin-application is accesable via:  
148
149         http://host/Mir 
150
151 and the openposting-servlet via  
152         
153         http://host/OpenMir
154
155 standard login is redaktion/indymedia
156
157
158
159 TROUBLESHOOTING
160
161 You can give these a try if anything goes wrong:
162
163 + Restart Tomcat. Especially after compiling the sources Tomcat has to be
164   restarted.
165
166 + Check file permissions and ownership. Try and run perms.sh.