3 Last updated: $Date: 2004/11/06 17:47:26 $
4 ----------------------------------------------------------------
6 Here is a short installation-howto of Mir.
11 - tomcat 4.0.4+ or 3.3 (4.0.3 and below have some bad bugs)
12 tomcat is available from http://jakarta.apache.org/tomcat/
13 - apache 1.3.x. with mod_jk.so. As far as I can tell the connector for 2.x is
14 still rather undocumented. http://httpd.apache.org
16 - ant (a java-based make)
17 - jaxp-1.1 (a SAX 2.0 compliant XML parser, comes with ant >= 1.4)
18 - the JAI image framework (Java Advanced Imaging) version 1.1.2 . Get it from
19 java.sun.com. You need both: JAI and JAI Image I/O. Install those two in
20 the JRE running tomcat.
22 - A good reading of Tomcat, Apache and Postgresql documentation if you are not
23 familiar with any of them. The documentation is available at:
24 http://jakarta.apache.org/tomcat/tomcat-4.0-doc/index.html,
25 http://httpd.apache.org/docs/ and http://www.postgresql.org respectively.
31 cvs -d :pserver:anonymous@mir.indymedia.org:/var/lib/cvs login
36 cvs -d :pserver:anonymous@mir.indymedia.org:/var/lib/cvs co -r MIR_1_1 mir
39 2. customize the config:
42 cp config.properties-dist config.properties
44 now customize config.properties for your needs.
47 3. configure the perms.sh file if neccessary -- IMPORTANT! READ THIS!
48 We provide a script that sets all files' and direcories' permissions to
49 a quite reasonable state. This script gets automagically called by
50 ant after compilationl. The most important thing you have to do after
51 compiling Mir is to ensure that the log files -- especially
52 dbentity.log -- are not readable by users that could compromise
53 system security, because all passwords and the like will be logged here.
55 cp perms.sh-dist perms.sh
57 Now, change the install directory and group in perms.sh
61 4. There is NO step 4!!
63 5. compile. For this step, you have to make sure that the TOMCAT_HOME
64 environment variable is set to the root of your tomcat installation.
65 The build.xml compile target will give up if this is not set.
67 Do this as root so the permissions script is able to set
68 the permissions and owners correctly.
73 6. Link in the webapps directory of tomcat to the install directory (the
74 directory is in mir/bin/mir (Here and in the rest of this document,
75 we assume you called the link "Mir", but this could be named anything.)
76 cd ${TOMCAT_HOME}/webapps
77 ln -s /path/to/mir/bin/mir Mir
79 with tomcat 4.0.x, you could dynamically reload and stop the Mir webapp without
80 restarting tomcat by using the "Manager App" with the following url:
82 http://localhost:8080/manager/stop?path=/Mir
84 This is practical if you are running several installations of mir on one
85 tomcat or other webapps and can't afford to shutdown all of them.
86 See the tomcat documentation to learn how to enable and use the manager app.
88 7. Follow the installation instructions of JAI / JAI Image I/O.
90 8a. create a new database
91 The database name should be the same as in config.properties. Please look at
92 the section "Database.*" to look up the names or change them to your needs.
94 It is wise in terms of system security to use an unprivileged user for this
95 task instead of the superuser. This is because if Mir uses the superuser to
96 connect to the database and anybody manages to find out the password Mir
97 uses to connect, the attacker can take over the complete database. So, in
98 the following examples, we assume that the database name is "Mir", the
99 database user will be "joe" and the password is "joshua". Please note that
100 this particular password is far from being a good one. Watch "Wargames" for
104 To access the database as the database superuser, you either have to log in
105 as postgres on Unix level (which we don't recommend because you will need
106 another user to have a login shell and a password which makes system
107 penetration more likely) or you have to tell PostgreSQL with each
108 application call that you want to connect as a specific user. In the
109 following example we'll create the mir database as postgreSQL user
114 ./createmirdb.sh mir pete joe joshua
116 8b. Apply neccessary changes to config.properties
118 Please open config.properties and look for the lines that begin with
119 "Database.". The interesting properties are "Username", "Password", "Host"
120 and "Name". Change these properties so that they reflect the settings you
121 used to create the database and the user.
123 You should make sure that no copy of config.properties (neither in mir nor
124 in Mir/src nor in Mir/WEB-INF/classes nor in the directory tree you compiled
125 Mir from) is world-readable. Else you wouldn't have to install a password,
128 8c. Setup PostgreSQL so that all localhost connections have to pass a
131 In /etc/postgresql/pg_hba.conf, change the line with 127.0.0.1 as follows:
133 host all 127.0.0.1 255.0.0.0 password
135 This means: All connections from 127.0.0.1 to any database will have to
136 authenticate themselves with a password. Please refer to the PostgreSQL
137 documentation if you want a different authentication setup. Make sure
138 however that mir can connect to it's database using password authentication.
140 9. For now, there's no step 9 either.
142 10. Tweak mime-type extensions mappings in etc/web.xml file.
144 *** Note the defaults should be o.k for most installations ***
146 Add or remove any mime types you wish to support. This is used to figure
147 out the mime-type when (broken browsers?) browsers don't send the mime-type
148 in the content-type header field when uploading a media file. Note add the
149 moment you still have to add these to the media_type SQL table as well which
150 maps the mime-types to the correct mediaHandler class. See the comments in
151 the MirMedia class in javadoc for more details.
157 There are 2 ways to do this. auto-generation of mod_jk.conf or manula JKMount
158 lines. (rumour has it that Tomcat 4.0.x doesn't support auto-generation, but
159 this is unconfirmed).
161 In both examples please note that the JkWorkersFile line only needs to appear
162 once per Apache config.
164 Also this assumes that your tomcat installation has it's ajp13 conenctor
165 turned on. See tomcat's server.xml file and documentation for this. Chances
166 are that it is turned on.
168 Method a). The automatic mod_jk.conf method:
170 insert the following patch into /etc/apache/httpd.conf. Edit the directories
174 JkWorkersFile /path/to/tomcat/conf/workers.properties
175 Include /path/to/tomcat/conf/mod_jk.conf-auto
178 Do not put any JkMount lines into your httpd.conf!
180 If mod_jk.conf-auto doesn't get written or is 0 bytes in size, check your
181 system for file ownership/permissions problems.
183 Method b). Manual JKMount lines
185 insert the following patch into /etc/apache/httpd.conf. Edit the directories
189 JkWorkersFile /path/to/tomcat/conf/workers.properties
195 13. configure apache for the static site
197 * Make sure that if you are using a non standard character set enconding that
198 Apache doesn't accidentally send the wrong encoding in the HTTP headers.
200 * set the document root to the same directory as in the mir config file
201 * enable shtml includes:
202 - add LoadModule includes_module /usr/lib/apache/1.3/mod_include.so
203 - make sure your directory contains "Options Includes"
204 * Determine if you need to modify any apache mime-mappings
205 - The web-server host must recognize the .m3u, .pls and other file extensions
206 and send the proper "audio/x-mpegurl" and "audio/x-scpls" mime-types
207 respectively. If the web server is apache, it's easy, just
213 to the file pointed to by the "TypesConfig" command in your apache config
214 file. Or add and equivalent AddType command to your httpd.conf. Of course
215 this assumes that the mod_mime is loaded.
219 now the admin-application is accesable via:
221 http://host/Mir/servlet/Mir
223 and the openposting-servlet via
225 http://host/Mir/servlet/OpenMir
227 standard login is admin/indymedia. See the webdb_users SQL table to change/add
233 The Mir code offers no internal search facilities, rather, the design
234 expects the use of an external program to crawl and index the static
235 site. One (recommended) tool for doing this is htdig
236 (http://htdig.org), which generates static databases of the site
237 content and then accesses those databases through a very fast CGI
238 program written in C. In the scripts directory, a perl CGI script
239 which wraps calls to htsearch is provided (scripts/search.pl) which
240 will allow searching based off of media type. (This is possible
241 because the standard templates will include META keywords like
242 hasAudio, hasVideo, etc.)
246 see the UPGRADING.mir file.
250 You can give these a try if anything goes wrong:
252 + Restart Tomcat. Especially after compiling the sources Tomcat has to be
255 + Check file permissions and ownership. Try and run perms.sh.
257 ----------------------------------------------------------------
259 $Date: 2004/11/06 17:47:26 $ - the Mir coders