no message
[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     modify etc/web.xml to change the xml-config
32     parameter to point to where your server.xml file is
33     (in ../Mir i.e /path/to/Mir/server.xml)
34
35
36 3. configure the build.sh file with java_home
37         cp build.sh-dist build.sh 
38         chmod 755 build.sh
39
40
41 4. copy the mir/templates-dist-directory to mir/templates
42
43
44 5. compile
45         sh build.sh 
46
47
48 6. Link in the webapps directory of tomcat to the install directory (the 
49 directory is called "Mir" and is located in the same directory in which 
50 you installed the "mir" directory). 
51         cd /usr/share/tomcat/webapps
52         ln -s Mir-install-dir Mir
53
54 7. Modify your tomcat startup script and add an LD_LIBRARY_PATH variable
55 that points to the WEB-INF/lib directory of your Mir install dir. (called
56 "Mir"). Add something like the following at the top of tomcat.sh (tomcat.sh
57 is found in the "bin/" dir. under $TOMCAT_HOME):
58     LD_LIBRARY_PATH=/path/to/Mir-install-dir/WEB-INF/lib
59
60 An alternaive way to avoid this is to copy any dynamic library files 
61 ending with ".so" in WEB-INF/lib to your jre/jdk lib directory (where the 
62 other ".so" files live). Or, you can skip the whole thing and live without
63 "native" acceleration for image manipulation
64
65
66 8. create a new database 
67 the database name should be the same as in config.properties
68 as user postgres: 
69         createdb dbname 
70
71
72 9. create base table
73         psql -Upostgres dbname < dbscripts/create_pg.sql
74         cat dbscripts/help*.sql | psql -Upostgres dbname
75         cat dbscripts/populate*.sql | psql -Upostgres dbname
76
77 10. Add the dupe prevention trigger to the database:
78         cd dbscripts/dupetrigger
79         
80         There, read INSTALL and follow the instructions.
81         
82
83 11. Set permissions
84         We provide a script that sets all files' and direcories' permissions to
85         a quite reasonable state. The most important thing you have to do after
86     the invokation of this script is to ensure that the log files --
87     especially dbentity.log -- are not readable by users that could
88     compromise system security, because all passwords and the like will
89     be logged here.
90         
91         cp perms.sh-dist perms.sh
92         # Now, change the install directory and group in perms.sh
93         edit perms.sh 
94         ./perms.sh
95
96
97
98
99 12. restart tomcat 
100
101 13. configure mod_jk 
102
103 insert the following patch into /etc/apache/httpd.conf. Edit the directories
104 to suit your needs.
105
106 <IfModule mod_jk.c>
107 JkWorkersFile /usr/share/tomcat/conf/workers.properties
108 Include /usr/share/tomcat/conf/mod_jk.conf-auto
109 </IfModule>
110
111 Do not put any JkMount lines into your httpd.conf!
112
113 If mod_jk.conf-auto doesn't get written or is 0 bytes in size, check your
114 system for file ownership/permissions problems.
115
116
117 14. Add a password to your PostgreSQL user and link it to Mir (optional)
118
119 Add a hard to guess password to the PostgreSQL user database:
120
121 # psql -U postgres Mir
122 alter user postgres with password 'yourpassword';
123
124
125 Then, in /etc/postgresql/pg_hba.conf you should make sure that nobody can
126 use the database without a password:
127
128 local            all                                                                               password
129 host         all         127.0.0.1     255.0.0.0           password
130 host         all         0.0.0.0       0.0.0.0             reject
131
132
133 Then, change the database password line in config.properties:
134
135 Database.Username=postgres
136 Database.Password=yourpassword
137
138 You should make sure that no copy of config.properties (neither in mir nor
139 in Mir/src nor in Mir/WEB-INF/classes) is world-readable. Else you wouldn't
140 have to install a password, anyway.
141
142 If you can't access PostgreSQL after this for any reason, try to change
143 "password" in /etc/postgresql/pg_hba.conf into "trust". This should disable
144 any authentication method and make the database accessible again.
145
146 15. configure apache's mod_mime to recognize .m3u and .pls files:
147
148 The web server (of the media host) must recognize the .m3u and .pls file
149 extensions and send the proper "audio/x-mpegurl" and "audio/x-scpls" mime-types
150 respectively.  If the web server is apache, it's easy, just add:
151            *
152 audio/x-mpegurl                 m3u
153 audio/x-scpl                    pls
154               *
155 to the file pointed to by the "TypesConfig" command in your apache config file.
156 Or add and equivalent AddType command to your httpd.conf.  Of course this
157 assumes that the mod_mime is loaded.
158                    *
159 If the web server is not apache, then your on your own.
160
161 that's it :)
162
163 now the admin-application is accesable via:  
164
165         http://host/Mir 
166
167 and the openposting-servlet via  
168         
169         http://host/OpenMir
170
171 standard login is redaktion/indymedia