Upto
UkDevServer
dev2.indymedia.org.uk
There was a disk failure at
codecoop.org which resulted in the cvs history of the
imc-uk project being lost, this page documents the setting up of a
new dev site, it basically follows the instructions on the
UkDevMirSites page.
Create a directory
# mkdir /var/www/dev2.indymedia.org.uk
# chown user.user /var/www/dev2.indymedia.org.uk
Checkout the code
You need to check out mir and the imc-uk project.
mir
Check out
Mir anon, just hit enter when prompted for a password:
$ cd /var/www/dev2.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
imc-uk
Check out the
imc-uk templates:
$ export CVS_RSH=ssh
$ cvs -z3 -d:ext:user@cvs.codecoop.org:/cvsroot/imc-uk co setup_uk
Site directories
Set up the site directory with a robots.txt file and fix the ownership:
$ cd /var/www/dev2.indymedia.org.uk
$ mkdir -p site/{,abstract,comments,content,de,en,img,inc,style}
$ cp /var/www/dev.indymedia.org.uk/site/robots.txt site/
$ su
# chown tomcat4. site/{,abstract,comments,content,de,en,img,inc,style}
# exit
$ cd site
$ ln -s en/index.html
Apache virtual host
dev2.conf was created in /etc/httpd/conf:
# Editor: vim:syn=apache
# dev2.indymedia.org.uk
<VirtualHost *:80>
ServerAdmin imc-uk-tech@lists.indymedia.org
DocumentRoot /var/www/dev2.indymedia.org.uk/site
ServerName dev2.indymedia.org.uk
<Location /photo>
JkUriSet worker ajp13:localhost:8009
</Location>
<Location /photo/*>
JkUriSet worker ajp13:localhost:8009
</Location>
<Directory /var/www/dev2.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/dev2.conf
Test and restart:
# /etc/init.d/httpd configtest
# /etc/init.d/httpd restart
Sym link to imc-uk code
$ cd /var/www/dev2.indymedia.org.uk/mir/
$ mv etc etc.orig
$ ln -s ../setup_uk/etc
config.properties
Copy the config.properties from /var/www/dev.indymedia.org.uk/etc/ to /var/www/dev2.indymedia.org.uk/etc/ and edit it: s/dev/dev2/
Apart from the db settings since we are going to use the same db.
*Not sure of locations above* Just done
$ cd /var/www/ekes.dev.indymedia.org.uk/mir/etc/
$ cp /var/www/cambridge.dev.indymedia.org.uk/mir/etc/config.properties .
$ sed -ri 's/cambridge/ekes/g' config.properties
Compile Mir
$ cd /var/www/dev2.indymedia.org.uk/mir/
$ ant
Fix some permissions
There is a script for doing this, which needs the GROUP variables setting (leave INSTDIR as it is).
$ cd /var/www/dev2.indymedia.org.uk/mir
$ cp perms.sh-dist perms.sh
Edit perms.sh:
# The group all files belong to
GROUP=tomcat4
Then it needs to be run as root:
# sh perms.sh
./bin/mir/WEB-INF/etc/config.properties
Permissions set.
Tomcat symlink
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/dev2.indymedia.org.uk/mir/bin/mir dev2
To restart tomcat:
# /etc/init.d/tomcat4 restart
(You will need to re-run ant and restart tomcat after any future changes to config.properties before they will take effect.)
Build the site
Go to
http://dev2.indymedia.org.uk/dev2 login and generate a load of stuff
Then look at
http://dev2.indymedia.org.uk/en/
index.html sym link
You need to sym link en/index.html:
# cd /var/www/dev2.indymedia.org.uk/site
# ln -s en/index.html
Cities list
Create a ~/bin/cities-update.sh file with the following in it and chomd 750 it:
#!/bin/bash
# get a new cities list
wget -q -O /var/www/dev2.indymedia.org/site/cities.inc http://www.indymedia.org/cities.inc
Create the file and make it writable by you:
# touch /var/www/dev2.indymedia.org.uk/site/cities.inc
# chown chris.chris /var/www/dev2.indymedia.org.uk/site/cities.inc
Run it to test it and then set up a cron job with crontab -e:
# update the cities list
45 01 * * * ~/bin/cities-update.sh
Includes
There are various SSI included files that can be be edited via the admin interface, to set these up you need to touch the files:
$ cd /var/www/dev2.indymedia.org.uk/site/inc
$ su
# touch events.inc
# chown tomcat4.tomcat4 events.inc
There is a script for doing: setup_uk/misc/touch_includes.sh use it like this:
$ cd /var/www/dev2.indymedia.org.uk/site/inc
$ su
# cp ../../setup_uk/misc/touch_includes.sh .
# sh ./touch_includes.sh
# chown -R tomcat4.tomcat4 *
# rm touch_includes.sh
FTP Uploads
The latest Mir supports FTP uploads, the plan is to get vsftpd running, the following config files doesn't work and needs fixing:
to top