1.
Setup Ubuntu
gksudo apt-get update --assume-yes
sudo apt-get dist-upgrade --assume-yes
# Ubuntu Ruby & System libraries:
sudo apt-get install build-essential --assume-yes
sudo apt-get install ruby1.8-dev ri rdoc --assume-yes
sudo apt-get install mysql-server libmysql-ruby --assume-yes
sudo apt-get install libopenssl-ruby --assume-yes
sudo apt-get install subversion --assume-yes
sudo apt-get install imagemagick libmagick9-dev --assume-yes
# Creat parent directory for mmx projects:
sudo mkdir /var/www
sudo chown ubuntu:ubuntu /var/www
# Subversion checkout:
svn checkout --no-auth-cache --username extrovert --password extrovert
http://exv01.tii.trb/svn/extrovert/trunk/
# Create Log folders
These two folders need to be created:
cms/log
metromix/log
# Install RubyGems:
cd
sudo wget http://rubyforge.org/frs/download.php/17190/rubygems-0.9.2.tgz
tar -xvzf rubygems-0.9.2.tgz
cd rubygems-0.9.2
sudo ruby setup.rb
cd ..
rm -r rubygems-0.9.2.tgz --force
# Install Specific Gems:
sudo gem install rails --include-dependencies
sudo gem install rmagick --include-dependencies
sudo gem install rspec --include-dependencies
sudo gem install rcov --include-dependencies
sudo gem install memcache-client --include-dependencies
you'll probably want mongrel:
sudo gem install mongrel --include-dependencies
# Create databases:
sudo mysqladmin create -u root extrovert_development
sudo mysqladmin create -u root extrovert_test
sudo mysqladmin create -u root extrovert_development_selenium
sudo mysqladmin create -u root extrovert_test_selenium
# Create local db settings file:
cd /var/www/cms/config
cp ./database.example ./database.yml
cd /var/www/metromix/config
cp ./database.example ./database.yml
# Build project
cd /var/www/cms
rake db:migrate
cd /var/www/metromix
rake db:migrate
# Install MySQL admin tool:
sudo apt-get install mysql-admin
MySql Admin has a bug (http://bugs.mysql.com/bug.php?id=17879) where User
Administration hangs. To fix:
sudo vi /usr/bin/mysql-admin.safe
# Insert the following and Save
export DEBUG_DONT_SPAWN_FETCHES=1
mysql-admin
# Make executable
chmod a+x mysql-admin.safe
# Edit the GUI launch shortcut for mysql-admin to modify the launch command from
/usr/bin/mysql-admin to
/usr/bin/mysql-admin.safe
# Create extrovert user account
1) Connect to localhost as root
2) Create user: extrovert, password: extrovert
3) Grant all privleges for extrovert_development to extrovert user
2. Ubuntu VM Installing Java
Read the instructions at
[http://ubuntuguide.org/wiki/Ubuntu_Edgy#How_to_install_JRE_v5.0_Update_10
UbuntuGuide.org] on how to install Java on Ubuntu.
3. Ubuntu Running VM tools
From VMware.com:
In an X terminal, launch the VMware Tools background application.
vmware-toolbox &
You can run VMware Tools as root or as a normal user. To shrink virtual disks or to
change any VMware Tools scripts, you must run VMware Tools as root (su -).
Note:
Always run vmware-toolbox in the guest operating system to ensure you have access to
all VMware Tools features, such as copy and paste and mouse ungrab for operating
systems for which X display driver is not available.
4. MS Windows Setup
Proxy Information The proxy is 163.194.240.99:9119 http://config.trb/proxy.pac
So to get Gems to work:
set http_proxy=http://163.194.240.99:9119
#Get (or make sure you have):
Ruby 1.8.4 and Gems 0.9.1 (to update your Gem's version, do: "gem update --system")
Mysql 5 (on your DOS prompt, to try logging in: "mysql -uroot -ppassword". Note that
with spaces, i.e. "mysql -u root -p password" doesn't work. There is probably already a
"test" database there, that MySQL creates upon installation. )
Subversion 1.4
RMagick
DO NOT INSTALL ImageMagick? from the ImageMagick? website.
Use the one that comes bundled with rmagick-win32 gem (with a a copy of the
ImageMagick? Windows installer).
Download rmagick-win32 from the RMagick project page on RubyForge?
(http://rubyforge.org/projects/rmagick/),
unzip it into a temporary directory, run the ImageMagick?*dll.exe installer.
Then, install the rmagick gem from the above temporary directory.
Restart your computer after this installation (if you don't the build may have difficulty
finding the ImageMagick? libraries)
# Create parent directory for mmx projects:
wherever you like
# Subversion checkout:
in the directory you just created
svn checkout --no-auth-cache --username extrovert --password extrovert
http://exv01.tii.trb/svn/extrovert/trunk
Create Log folders under CMS & Metromix folders
# Install Specific Gems:
ensure that the environment variable http_proxy is set..
set http_proxy=http://163.194.240.99:9119
gem install rails --include-dependencies
gem install rspec --include-dependencies
gem install rcov --include-dependencies
gem install memcache-client --include-dependencies
gem install mysql
# Create databases:
Use your favorite tool to create:
extrovert_development and extrovert_test
extrovert_images_development, extrovert_images_test,
extrovert_pubwrite_development, extrovert_pubwrite_test,
extrovert_pubwrite_production,
extrovert_registered_users_development, extrovert_registered_users_test
extrovert_registered_users_production
and assign them to some user. Give that user permisions to access.
# Create local db settings file:
In cms/config there is a database.example file copy it and change its name to
database.yml
Do the same in metromix/config
Make sure the two database.yml files point to your databases and use your users as set up
above
# Migrate the DB
Both projects share the db, but only cms has the migrations, so:
In trunk/cms
rake db:migrate
and
rake db:migrate RAILS_ENV=test
This should work if you've set up your dbs corectly.
Note:
If you have problems with the db:migrate for metromix, you may need to copy the
pubwrite_test target from cms/config/database.yml to metromix/config/database.yml.
This is being addressed.
#Now let's try and run the tests:
rake cruise:all
might fail because of rcov problems, so try:
rake cruise:no_rcov_all
results are at:
tmp/rspec_output.html
Of course, run the tests in both projects (trunk/metromix and trunk/cms)
#Change your localhost file
should be found at:
C:\WINDOWS\system32\drivers\etc
file is called "hosts"
add this line at the bottom:
127.0.0.1 chicago.localhost
you will probably need to add more as you bounce around to different cities
# you're gonna need cygwin (http://www.cygwin.com) to run solr
(http://lucene.apache.org/solr/). Download cygwin, solr is checked into the repository
already.
# you're also going to need tomcat (http://tomcat.apache.org/)
configure and starting Solr instructions are as follows
# SOLR SETUP
Edit solr/conf/Catalina/localhost/solr-extrovert.xml, updating paths: (where
c:/mmx/trunk/ is the location where you svn checked-out to)
<Context docBase="C:/mmx/trunk/solr/solr-webapp"
debug="0" crossContext="true" > <Environment name="solr/home"
type="java.lang.String" value="C:/mmx/trunk/solr/indexes/extrovert"
override="true" />
</Context>
Edit solr/conf/server.xml: Find the following tags....
* <Server port="8005" shutdown="SHUTDOWN">
* <Connector port="5000" maxHttpHeaderSize="8192"
* <Connector port="8009"
and change the ports to new ports for example :
8006, 5001, 8010
Check to make sure changes aren't used already on the system
$ netstat -a | grep "8006"
$ netstat -a | grep "5001"
$ netstat -a | grep "8010"
**** Even though your netstat output does not show the ports
5000, 8005, 8009 as used..solr cannot access them for some reason
so please change them to the above ports
Edit solr/bin/solr.sh, to look like
-------------------------------------------
#!/bin/sh
# JRH - updated CATALINA_BASE
CATALINA_BASE=C:/mmx/trunk/solr
# end JRH
export CATALINA_BASE=${CATALINA_BASE}
CATALINA_HOME=C:/apache-tomcat-5.5.20
# JRH - updated JRE_HOME
JRE_HOME=C:/Java/jdk1.5.0.03/jre
# end JRH
export JRE_HOME=${JRE_HOME}
#JAVA_OPTS="-Xms128m -Xmx128m -agentlib:yjpagent"
JAVA_OPTS="-Xms128m -Xmx128m"
export JAVA_OPTS=${JAVA_OPTS}
CATALINA_PID=${CATALINA_BASE}/logs/pid
export CATALINA_PID
${CATALINA_HOME}/bin/catalina.sh $*
----------------------------------------------------------
on the cygwin window do the following
copy the solr.war file to your "apachetomcat"/webapps folder ("apachetomcat" is where
you have tomcat server installed on your machine)
and start solr using
Start Solr:
solr/bin/solr.sh run
use run so that it runs it in the same window.. and you can see the results of the run. You'll
see error messages but Solr may still start up regardless.
Verify it is running: http://localhost:5001/solr-extrovert/admin/
If you dont want to use cygwin you can configure your solr to work with windows like
so.. Create a solr/bin/solr.bat file in the same folder as solr.sh and add the following
entries
set CATALINA_BASE=C:/mmx/trunk/solr
set CATALINA_HOME=C:/apache-tomcat-5.5.20
set JRE_HOME=C:/Java/jdk1.5.0.03/jre
set CATALINA_PID=%CATALINA_BASE%/logs/pid
%CATALINA_HOME%/bin/catalina.bat %1
and on the command prompt
C:\mmx\trunk\solr\bin>solr.bat run
It should give you the same results as above
the above instructions were derived from http://www.mail-archive.com/solr-
user@lucene.apache.org/msg00365.html which were as follows
laptop:~/tmp/solr-tomcat> unzip apache-tomcat-5.5.17.zip > & /dev/null
laptop:~/tmp/solr-tomcat> unzip solr-2006-05-29.zip > & /dev/null
laptop:~/tmp/solr-tomcat> cp solr-nightly/dist/solr-nightly.war apache-tomcat-
5.5.17/webapps/solr.war
laptop:~/tmp/solr-tomcat> cp -r solr-nightly/example/solr .
laptop:~/tmp/solr-tomcat> chmod a+x apache-tomcat-5.5.17/bin/*
laptop:~/tmp/solr-tomcat> ./apache-tomcat-5.5.17/bin/startup.sh > & /dev/null
Sample data for your development database:
http://exv01.tii.trb:10000/extrovert/wiki/SampleMySqlData
Solr index:
http://exv01.tii.trb:10000/extrovert/attachment/wiki/SolrIndex/index.tgz
put the files in the zip file into mmxtrunk\solr\indexes\extrovert\data\index
Change the port to match what you're using (from 5000 to 5001)
mmx/trunk/metromix/config/environment/development.rb
#solr settings - set the correct host and port
SEARCH = {
:host => 'localhost',
:port => 5001, # was 5000
:context => '/solr-extrovert',
:update_path => '/update',
:select_path => '/select'
}
(You *might* need to do the same thing for
mmx/trunk/cms/config/environment/development.rb, if cms uses Solr also)
Start up your metromix server:
mmxtrunk\metromix> ruby script\server
If you've set up incorrectly,
http://chicago.localhost:3000/channel/bars_and_clubs
You'll get an error, possibly something about Solr
If you've set up correctly, you'll see a page, but when you click on the "After hours" link
on the left, it complains no database "extrovert_images_development"... that means the
code uses a newer db version and I need to do:
mmxtrunk\cms> rake db:migrate
After that, clicking on "After hours" link shows a good page.
# Create extrovert user account on your MySQL
1) Connect to localhost as root
2) Create user: extrovert, password: extrovert
3) Grant all privleges for extrovert_development to extrovert user