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