Upto ImcPhotos

IMC Photo Mir Install

The plan is to document the installation of a test / development server for the ImcPhotos project on the UkDevServer the templates will be hosted on the imc-photo project on codecoop.

Create a directory

  # mkdir /var/www/photo.dev.indymedia.org.uk
  # chown user.user /var/www/photo.dev.indymedia.org.uk

And a site directory:

  $ cd /var/www/photo.dev.indymedia.org.uk
  $ mkdir site

Checkout the code

Check out Mir anon:

  $ cd /var/www/photo.dev.indymedia.org.uk
  $ cvs -d:pserver:anonymous@cvs.codecoop.org:/cvsroot/mir login 
  $ cvs -z3 -d:pserver:anonymous@cvs.codecoop.org:/cvsroot/mir co -r MIR_1_1 mir 

Apache virtual host

photo.conf was created in /etc/httpd/conf:

# Editor: vim:syn=apache
# photo.dev.indymedia.org.uk
<VirtualHost *:80>
    ServerAdmin chrisc@indymedia.org
    DocumentRoot /var/www/photo.dev.indymedia.org.uk/site
    ServerName photo.dev.indymedia.org.uk
  <Location /photo>
    JkUriSet worker ajp13:localhost:8009
  </Location>
  <Location /photo/*>
    JkUriSet worker ajp13:localhost:8009
  </Location>
    <Directory /var/www/photo.dev.indymedia.org.uk/site>
      Options Indexes IncludesNoExec FollowSymLinks MultiViews
      IndexOptions +SuppressHTMLPreamble +SuppressDescription
      AddHandler server-parsed .html
      AddType 'text/html; charset=utf-8' .html
      AllowOverride None
      Order allow,deny
      Allow from all  
    </Directory>
  # Apache gzip compression
  <Location />
    # This is taken from here: 
    # http://httpd.apache.org/docs-2.0/mod/mod_deflate.html
    # Insert filter
    SetOutputFilter DEFLATE
    # Netscape 4.x has some problems...
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    # Netscape 4.06-4.08 have some more problems
    BrowserMatch ^Mozilla/4\.0[678] no-gzip
    # MSIE masquerades as Netscape, but it is fine
    BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
    # Don't compress images
    SetEnvIfNoCase Request_URI \
    \.(?:gif|jpe?g|png)$ no-gzip dont-vary
    # Make sure proxies don't deliver the wrong content
    Header append Vary User-Agent env=!dont-vary
  </Location>
</VirtualHost>

The following was appended to /etc/httpd/conf/httpd.conf:

  Include /etc/httpd/conf/photo.conf

Test and restart:

  # /etc/init.d/httpd configtest
  # /etc/init.d/httpd restart

Mir install

ant

First run ant:

$ cd mir
$ ant
Buildfile: build.xml

prepare-compilation:
    [mkdir] Created dir: /var/www/photo.dev.indymedia.org.uk/mir/build/classes
    [mkdir] Created dir: /var/www/photo.dev.indymedia.org.uk/mir/build/jars

compile:
    [javac] Compiling 360 source files to /var/www/photo.dev.indymedia.org.uk/mir/build/classes
    [javac] Note: /var/www/photo.dev.indymedia.org.uk/mir/source/mir/util/HTMLRoutines.java uses or overrides a deprecated API.
    [javac] Note: Recompile with -deprecation for details.
      [jar] Building jar: /var/www/photo.dev.indymedia.org.uk/mir/build/jars/mir.jar

generate-deployment-tree:
    [mkdir] Created dir: /var/www/photo.dev.indymedia.org.uk/mir/bin/mir
    [mkdir] Created dir: /var/www/photo.dev.indymedia.org.uk/mir/bin/mir/WEB-INF
    [mkdir] Created dir: /var/www/photo.dev.indymedia.org.uk/mir/bin/mir/WEB-INF/lib
    [mkdir] Created dir: /var/www/photo.dev.indymedia.org.uk/mir/bin/mir/WEB-INF/log
     [copy] Copying 49 files to /var/www/photo.dev.indymedia.org.uk/mir/bin/mir
     [copy] Copying 75 files to /var/www/photo.dev.indymedia.org.uk/mir/bin/mir/WEB-INF/etc
     [copy] Copying 1 file to /var/www/photo.dev.indymedia.org.uk/mir/bin/mir/WEB-INF
     [copy] Copying 54 files to /var/www/photo.dev.indymedia.org.uk/mir/bin/mir/WEB-INF/templates
     [copy] Copying 13 files to /var/www/photo.dev.indymedia.org.uk/mir/bin/mir/WEB-INF/bundles
     [copy] Copying 1 file to /var/www/photo.dev.indymedia.org.uk/mir/bin/mir/WEB-INF
     [copy] Copying 28 files to /var/www/photo.dev.indymedia.org.uk/mir/bin/mir/WEB-INF/lib

deploy:

BUILD SUCCESSFUL
Total time: 52 seconds

config.properties

Then set up config.properties:

$ cp config.properties-dist config.properties

Edit config.properties, this is the edited version (minus db connection details!):



#####################
# media server URLs #
#####################

# for better performance or load-sharing
# images/media can be copied to (and served from) different servers
# only in this case image- and medialinks need different URLs.

# the url of the video-server
#
Producer.Video.Host=http://photo.dev.indymedia.org.uk/video

# the url of the audio-server
#
Producer.Audio.Host=http://photo.dev.indymedia.org.uk/audio

# the url of the image-server
#
Producer.Image.Host=http://photo.dev.indymedia.org.uk/images

# the url of the media-server
#
Producer.Media.Host=http://photo.dev.indymedia.org.uk/media

# the url of the real-media-server
#
# what to do with this? 
#Producer.RealMedia.Host=rtsp://some.streamingmedia.server/somedir/



############################################
# image/media specific storage directories #
############################################

# absolute directory, where the images are saved
#
Producer.Image.Path=/var/www/photo.dev.indymedia.org.uk/site/images/


# absolute directory, where the media files are saved
#
Producer.Media.Path=/var/www/photo.dev.indymedia.org.uk/site/media

# absolute directory, where the realmedia data files(ra and rm) are saved
# the ram files which point to the RealMedia.Host get saved in the regular Media dir
# this should make rsyncing to a separate streaming server much easier
#
Producer.RealMedia.Path=/var/www/photo.dev.indymedia.org.uk/site/rtsp

# mir creates a small thumbnail-icon for each image posted
# relativ directory, where the thumbnails will be saved
#
Producer.Image.IconPath=/icon


####################
# media-type-icons #
####################

# by default they are stored in the webservers [docRoot]/img directory
# they are distibuted with the mir-source (etc/producer/images)
# use the "staticimages.generate" producer once to copy them in place
#

# Tiny Icons for the media types on the newswire summary.
# (right hand side of start page)
#
Producer.Icon.TinyImage=photo_small.gif
Producer.Icon.TinyAudio=audio_small.gif
Producer.Icon.TinyVideo=video_small.gif
Producer.Icon.TinyText=text_small.gif

#Medium sized icons used at various places
#
Producer.Icon.BigImage=photo_big.gif
Producer.Icon.BigAudio=audio_big.gif
Producer.Icon.BigVideo=video_big.gif
Producer.Icon.BigText=text_big.gif

#Icons used for links
#
Producer.ExtLinkName=extlink.gif
Producer.IntLinkName=intlink.gif
Producer.MailLinkName=maillink.gif

# this is the name of the subdirectory where the image-dir
# will be linked to.
#
Producer.ImageRoot=/img



################################################
########### C) DYNAMIC SITE CONFIG #############
################################################

# the main mir-servlet
#
Producer.ActionServlet=/servlet/Mir

# the url of the openposting-servlet
#
Producer.OpenAction=http://photo.dev.indymedia.org.uk/servlet/OpenMir

# the maximum allowed size of an uploaded media file in KB.
#
MaxMediaUploadSize=2000000

# the maximum number of allowed media items to upload at once.
#
ServletModule.OpenIndy.MaxMediaUploadItems=50

# the default number of media items to upload at once
#
ServletModule.OpenIndy.DefaultMediaUploadItems=1


######################
# PDF configurations #
######################

# the following lines are used to construct PDFs on the fly from one or more articles
# for the moment, if you want to change anything else about your pdfs, you
# will have to learn some java!
#
# keep in mind that there may not be enough room for all the text you enter as the
# value of one these options, if text doesn't appear, the only easy thing to do is
# use less text!
#

# a single line of big text which will appear at the top of the first page of all generated pdfs
#
PDF.Title=Indymedia Photos

# about two lines of small text which will appear at the bottom of every page
#
PDF.Footer=Indymedia Photos, http://photo.dev.indymedia.org.uk/ 

# the size paper your target audience will likely have in their printers.
# pick one of A4 or LETTER
#
PDF.PageSize=A4

################################################
############ D) DATABASE CONFIG   ##############
################################################

# specify your database
#
Database.Name=imcphoto
Database.Username=photo
Database.Password=***

Database.Host=localhost
Database.Port=5432
Database.Driver=org.postgresql.Driver


############################################
# encoding configuration                   #
############################################

# The default encoding charset used in the written html files as well
# as the dynamic output html.
Mir.DefaultHTMLCharset=UTF-8

# The java equivalent of Mir.DefaultHTMLCharset
Mir.DefaultEncoding=UTF8

ant

Run ant again:

$ cd ..
$ ant
Buildfile: build.xml

prepare-compilation:

compile:

generate-deployment-tree:
   [delete] Deleting directory /var/www/photo.dev.indymedia.org.uk/mir/bin/mir/WEB-INF/lib
    [mkdir] Created dir: /var/www/photo.dev.indymedia.org.uk/mir/bin/mir/WEB-INF/lib
     [copy] Copying 1 file to /var/www/photo.dev.indymedia.org.uk/mir/bin/mir/WEB-INF/etc
     [copy] Copying 28 files to /var/www/photo.dev.indymedia.org.uk/mir/bin/mir/WEB-INF/lib

deploy:

BUILD SUCCESSFUL
Total time: 6 seconds

perms.sh-dist

Edit perms.sh-dist and then run it as root, this line that needs changing is the group:

# The group all files belong to
GROUP=tomcat4

# ./perms.sh-dist
./bin/mir/WEB-INF/etc/config.properties
Permissions set.

Create a symbolic link from the tomcat web applications directory to your bin directory: (You need to be root to do that!)

  # cd /var/lib/tomcat4/webapps/
  # ln -s /var/www/photo.dev.indymedia.org.uk/mir/bin/mir photo 

restart tomcat

# /etc/init.d/tomcat4 restart
waiting for processes to exit                              [  OK  ]
Starting tomcat4:                                          [  OK  ]

create the postgres database

There is a script for creatin the database called createmirdb.sh

$ cd dbscripts/
$ ./createmirdb.sh 
$ usage: ./createmirdb.sh dbname superuser username password

Here the dbname is the name of the database you want to create, imcphoto in this case, superuser is postgres, username is photo and password is the password for the new database, at the promot type the root password for the database:

$ ./createmirdb.sh imcphoto postgres photo ***
Password: 

set up the db to store uploads on the filesystem

By default Mir stotes the uploads in the database, but we don't want this, we want the uploads stored on the filesystem, this is how to do this:

$ psql imcphoto -U photo
Password: 
Welcome to psql 7.4.6, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help on internal slash commands
       \g or terminate with semicolon to execute query
       \q to quit

imcphoto=> update media_type set classname='ImagesExtern' where classname like 'Images%';
UPDATE 3
imcphoto=> \q

admin login

Go here to login: http://photo.dev.indymedia.org.uk/photo/servlet/Mir

** need to add generating site for first time, and sym link to en/index.shtml and making the site dir writable by tomcat4.tomcat4...


Topic revision: r1 - 29 Nov 2004, ChrisC
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback