Created
October 28, 2008 18:05
-
-
Save makoto/20455 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# There are some old db files around. Need to wipe out. | |
rm -rf /var/lib/mysql/* | |
# Install mysql and xfs related libraries. | |
apt-get update && apt-get upgrade -y | |
apt-get install -y xfsprogs mysql-server libmysql-ruby libmysqlclient15-dev | |
# Create and attach volume to /vol using the example below | |
# Stop mysql, move /var/live/mysql to /vol , create new config, and start it up again. | |
# The detail is at http://developer.amazonwebservices.com/connect/entry.jspa?externalID=1663&categoryID=100 | |
# Follow http://pandastream.com/docs/getting_started to grab panda. | |
# NOTE: Instead of getting stable, check out dm. | |
cd /var/local/www | |
git clone git://github.com/newbamboo/panda.git | |
cd panda | |
git checkout dm | |
# At configuration, we now need database.yml. Copy it from databae.yml.example and modify to use mysql. | |
cd /var/local/www/panda/config | |
cp database.yml.example database.yml | |
# I also used file system as video store in this example. Here are the diff of panda_init.rb | |
diff panda_init.rb.example panda_init.rb | |
33,35c33,35 | |
< p[:videos_store] = :s3 | |
< p[:videos_domain] = "s3.amazonaws.com/S3_BUCKET" | |
< p[:s3_videos_bucket] = "S3_BUCKET" | |
--- | |
> #p[:videos_store] = :s3 | |
> #p[:videos_domain] = "s3.amazonaws.com/S3_BUCKET" | |
> #p[:s3_videos_bucket] = "S3_BUCKET" | |
38,40c38,40 | |
< # p[:videos_store] = :filesystem | |
< # p[:videos_domain] = "localhost:4000/store" | |
< # p[:public_videos_dir] = Merb.root / "public" / "store" | |
--- | |
> p[:videos_store] = :filesystem | |
> p[:videos_domain] = "ec2-00-000-000-000.compute-1.amazonaws.com/store" | |
> p[:public_videos_dir] = Merb.root / "public" / "store" | |
# Moving local video store to EBS volume | |
mkdir /vol/store | |
ln -s /vol/store /var/local/www/panda/public/store | |
# Need to redeploy some of frozen gems. | |
cd /var/local/www/panda | |
bin/thor merb:gems:redeploy | |
# Setup database. | |
bin/rake db:create MERB_ENV=production | |
bin/rake db:automigrate MERB_ENV=production | |
# Follow http://pandastream.com/docs/getting_started to upload flash player, create profile&user. | |
# NOTE: No need to create SimpleDB domains, if you use mysql | |
# NOTE: No need to create S3 bucket, if you use local video store. | |
# Note: Since we froze all the gems, need to use "bin/merb" rather than "merb" | |
# Note: Since we now have database environment dependency, need to specify "-e production" | |
bin/merb -i -e production | |
Store.set('player.swf', 'public/player.swf') | |
Store.set('swfobject2.js', 'public/javascripts/swfobject2.js') | |
Store.set('expressInstall.swf', 'public/expressInstall.swf') | |
u = User.new | |
u.login = 'admin' | |
u.email = 'email@mydomain' | |
u.set_password('SECRETPASS') | |
u.save | |
Profile.create!(:title => "Flash video SD", :container => "flv", :video_bitrate => 300, :audio_bitrate => 48, :width => 320, :height => 240, :fps => 24, :position => 0, :player => "flash") | |
# This should be it!! startup merb via god | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment