Kaltura CE from git on MacPorts

Handy Commands to restart Apache and MySQL

These would be handy to put into a script to start or stop your development environment if you don’t want to have your web development running at all times.

sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist
sudo apachectl restart

sudo launchctl unload /Library/LaunchDaemons/org.macports.mysql5.plist
sudo apachectl stop

Caveats

I’ve got a heavily customized system of apache config files and some /etc/hosts modifications on my system so that my config files for specific virtual hosts are loaded by the following line in my httpd.conf:

Include /Users/papyromancer/src/apache-passengers/*.active

I’d also linked my /Users directory to /home to preserve consistency in my scripts for use in Ubuntu and OS-X. Adjust your shell commands to suit your setup.

Installing Prerequistes

Apache 2, MySQL 5, PHP

Follow these detailed instructions. Pay particular attention to setting up the mysql user and databases and setting up apache to use php.

sudo port install apache2
sudo port install mysql5-server
sudo port install php5 +apache2 +mysql5 +pear

This was the only additional step needed after following that tutorial

sudo port install php5-gd php5-imap php5-curl

NOTE: You MUST use php version 5.2. Kaltura will not work with version 5.3.

At this point I’m not going to install memcached since this isn’t running a production environment.

Setup Kaltura

Get Kaltura

git clone git://github.com/papyromancer/kaltura-ce.git

I’ve had limited success installing Kaltura as the root directory of a web host, and because I’m going to be installing MediaWiki, Drupal, and Wordpress into this same virtual host I’ve decided to link my clone of the Kaltura code (in its own branch) into a separate folder where I will link the other applications as well:

mkdir kaltura-apache
cd kaltura-apache
ln -s ../kaltura-ce kaltura

I’ve also installed the regular old Kaltura CE i

Setup Kaltura virtual host within Apache

<VirtualHost *:80>
  ServerName kaltura.local
  DocumentRoot /home/papyromancer/src/kaltura/kaltura-apache

  <Directory /home/papyromancer/src/kaltura/kaltura-apache>
    Options Indexes FollowSymLinks ExecCGI Includes
    AllowOverride All
    Order Allow,Deny
    Allow from all
  </Directory>
</VirtualHost>

Directories

Run some scripts to create missing directories and correct directory permissions. Run the next two commands in your kaltura-ce directory.

mkdir content/uploads kaltura/alpha/cache indicators conversions archive
install/fixperms.sh

FFMPEG

I have a nice compilation of ffmpeg from macports that I’m sure I’ll integrate into This Kaltura installation at some point, but for right now I’m just going to download the binaries from http://kaltura.org/ unzip and link into the source code checkout from the root directory of my source code checkout. YMMV

ln -s /home/papyromancer/src/kaltura/kalturaCE/kaltura/bin kaltura/bin

Run the Kaltura web based install

  1. Setup a mysql database.
  2. Visit your local virtual host for kaltura

I haven’t worried about email and memcached on my install, but you may want to.

So that didn’t work…

Here’s an additional step I did at some point in the install, but it may not be needed:

sudo ln /opt/local/bin/php /opt/lampp/bin/php
@6 months ago
#git #kaltura #kalturaCE #kaltura-ce #macports #os-x 

How to ♥ me and git

Install Git

First off… Get git. I highly recommend the guides that Github has written about all things git… GitHub Guides. Ignore the “setting up” section until you’ve gotten git running on your computer. When you go to the guides you’ll find installation instructions for whatever platform you’re running.

Send Me Your Public Key

Now that you’ve gotten git… it’s time to make get yourself some keys so you can access our git repository. again github has some really good guides on generating your keys. The basics: You’re going to wind up with a public/private keypair in a folder on your computer. I’m running os-x so my keys are in my home directory: ~/.ssh and I generated them on my mac which I’ve lovingly named james (after William James, that dude whose brother wrote all those boring novels), so my keys are associated with user papyromancer@james.local (knowing what user address is associated with your keys will be important in a few minutes).

Here’s some terminal output of my public key so you can see what I’m talking about:

james:~ papyromancer$ cat .ssh/id_rsa.pub 
ssh-rsa     AAAAB3NzaC1yc2EAAAABIwAAAQEAtalWvzs6iDxwVfv+xcXy1uZD20aG1en9JohnL7pJJcslgx3Ok+63+KXYkrGrBX3+ol8opQziQNYqrODcliG7XisYuxIjgzvwtuhHHiWnqZ+4zLrbVLz2Zl7iJ5kuZFuGMJXnOlwxmz+a8KKPdAyVBduJxYCL9NUznJQca5L9SaXmDDjnPYOC+7zY0X7Tk/hbAGW6c4mibzL6jebFM5N98bhTXystabk0JZ/g+eEkxb681buit+o0teoXgQMPnRs8aJmAil4zmbVDRdQJOewLP1A2LSm55yxC/tsg+FMEpmtPwW0+8uiWp11ifJNwtwO58nsP2Uvn4syrRuvizGVXtQ== papyromancer@james.local

So open up your terminal program or equivalent and check your ~/.ssh directory for id_rsa and id_rsa.pub. If they’re there, that’s great. Email me your id_rsa.pub file and I’ll get you access to the repository. If you don’t have those files there… once again you’re going to GitHub for Instructions. After you’ve generated your keys, send me the public one :)

Setup Git

While you’re waiting for me to get your public keys onto the repository, take the time to tell git a little bit about yourself:

[~]$ git config --global user.name "mad voo"
[~]$ git config --global user.email mad.vooo@gmail.com

You’ll of course be using your user address from your key, mine was papyromancer@james.local. Yours may vary.

Setup Your Personal Development Environment

[~]$ git clone git@git-love.com:project.git

This will give you a nice neat little directory called project where you need to remove the empty rails directory

[~]$ cd project
[~]$ rm -drf vendor/rails

and put a reals [sic] rails directory there

[~]$ cd vendor
[~]$ git clone git://github.com/rails/rails.git

Next a few commands in the project directory, and you’ll have project running on your computer.

You’ll need to have ruby and rubygems installed from here on out… I’d be happy to walk you through it… or point you at some good tutorials.

[~]$ rake gems:install
[~]$ rake gems:refresh_specs RAILS_ENV=development

That’ll get all the source code into running order. Now we need to create the database

[~]$ rake db:create
[~]$ rake db:migrate

And now we can start the server

[~]$ script/server

You can now view your server at http://localhost:3000/ unless you’ve got your default setup differently. I currently run my dev projects locally with /etc/hosts modifications through Phusion Passenger under Apache… I have a good screencast of that setup if you’re interested.

You can also edit the application and view the changes in real time through your local script/server.

Modifying the Project

Everytime you go to work on the project make sure that you have the most recent source:

[~]$ git pull

I have a feeling that you designers will be spending a lot of time in the public folder where stylesheets and javascripts are kept, and also in the app/views folders, where the templates for data display through html and xml are stored, but feel free to change anything.

Main advice I have for you is branch often, and then branch some more. Anytime you start work on an element of the site go to the root project folder and type

[~]$ git checkout -b tinylittlechange

and this will create a new branch where you can modify your code until tinylittlechange is completed, at which point you’ll need to add all the new files to the project with

[~]$ git add .

Then you commit the files to your local repository:

[~]$ git commit -a -m 'I just made this really cool tiny little change'

and then you check it on your local server to make sure everything’s running properly… And when it is, you merge tinylittlechange back into master.

[~]$ git checkout master
[~]$ git merge tinylittlechange

Verify that the merge was successful by checking the local server once again, and if everything looks cool, it’s time to share tinylittlechange with the rest of us by typing:

[~]$ git push

This is going to send your revisions to the master branch of our repository where we can pull it down ourselves.

Also… when you push to my repository, the development site at http://project.git-love.com/ gets updated. You’ll see how cleanly the development relaunch goes in the output from your push command.

The development site is probably going to break a lot :(

But that’s OK… We all have working development environments on our machines, and the repository stays up weather the development site is working or not.

Updating the Live Site

When you give me your public keys and I add you to the repository, I’ll also create an ssh account for you on audioesque.com. When the development site is running smoothly it’s time to release those improvements to audioesque into the wild.

[~/]$ ssh username@project.com
[~/]$ cd /project/
[~/]$ git pull
[~/]$ rake db:migrate
[~/]$ touch tmp/restart.txt

And I think that touches on pretty much the whole development process…

@10 months ago with 1 note
#Rails, #Ruby #Git #Github #Web Development 
Kaltura CE from git on MacPorts

Handy Commands to restart Apache and MySQL

These would be handy to put into a script to start or stop your development environment if you don’t want to have your web development running at all times.

sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist
sudo apachectl restart

sudo launchctl unload /Library/LaunchDaemons/org.macports.mysql5.plist
sudo apachectl stop

Caveats

I’ve got a heavily customized system of apache config files and some /etc/hosts modifications on my system so that my config files for specific virtual hosts are loaded by the following line in my httpd.conf:

Include /Users/papyromancer/src/apache-passengers/*.active

I’d also linked my /Users directory to /home to preserve consistency in my scripts for use in Ubuntu and OS-X. Adjust your shell commands to suit your setup.

Installing Prerequistes

Apache 2, MySQL 5, PHP

Follow these detailed instructions. Pay particular attention to setting up the mysql user and databases and setting up apache to use php.

sudo port install apache2
sudo port install mysql5-server
sudo port install php5 +apache2 +mysql5 +pear

This was the only additional step needed after following that tutorial

sudo port install php5-gd php5-imap php5-curl

NOTE: You MUST use php version 5.2. Kaltura will not work with version 5.3.

At this point I’m not going to install memcached since this isn’t running a production environment.

Setup Kaltura

Get Kaltura

git clone git://github.com/papyromancer/kaltura-ce.git

I’ve had limited success installing Kaltura as the root directory of a web host, and because I’m going to be installing MediaWiki, Drupal, and Wordpress into this same virtual host I’ve decided to link my clone of the Kaltura code (in its own branch) into a separate folder where I will link the other applications as well:

mkdir kaltura-apache
cd kaltura-apache
ln -s ../kaltura-ce kaltura

I’ve also installed the regular old Kaltura CE i

Setup Kaltura virtual host within Apache

<VirtualHost *:80>
  ServerName kaltura.local
  DocumentRoot /home/papyromancer/src/kaltura/kaltura-apache

  <Directory /home/papyromancer/src/kaltura/kaltura-apache>
    Options Indexes FollowSymLinks ExecCGI Includes
    AllowOverride All
    Order Allow,Deny
    Allow from all
  </Directory>
</VirtualHost>

Directories

Run some scripts to create missing directories and correct directory permissions. Run the next two commands in your kaltura-ce directory.

mkdir content/uploads kaltura/alpha/cache indicators conversions archive
install/fixperms.sh

FFMPEG

I have a nice compilation of ffmpeg from macports that I’m sure I’ll integrate into This Kaltura installation at some point, but for right now I’m just going to download the binaries from http://kaltura.org/ unzip and link into the source code checkout from the root directory of my source code checkout. YMMV

ln -s /home/papyromancer/src/kaltura/kalturaCE/kaltura/bin kaltura/bin

Run the Kaltura web based install

  1. Setup a mysql database.
  2. Visit your local virtual host for kaltura

I haven’t worried about email and memcached on my install, but you may want to.

So that didn’t work…

Here’s an additional step I did at some point in the install, but it may not be needed:

sudo ln /opt/local/bin/php /opt/lampp/bin/php
6 months ago
#git #kaltura #kalturaCE #kaltura-ce #macports #os-x 
How to ♥ me and git

Install Git

First off… Get git. I highly recommend the guides that Github has written about all things git… GitHub Guides. Ignore the “setting up” section until you’ve gotten git running on your computer. When you go to the guides you’ll find installation instructions for whatever platform you’re running.

Send Me Your Public Key

Now that you’ve gotten git… it’s time to make get yourself some keys so you can access our git repository. again github has some really good guides on generating your keys. The basics: You’re going to wind up with a public/private keypair in a folder on your computer. I’m running os-x so my keys are in my home directory: ~/.ssh and I generated them on my mac which I’ve lovingly named james (after William James, that dude whose brother wrote all those boring novels), so my keys are associated with user papyromancer@james.local (knowing what user address is associated with your keys will be important in a few minutes).

Here’s some terminal output of my public key so you can see what I’m talking about:

james:~ papyromancer$ cat .ssh/id_rsa.pub 
ssh-rsa     AAAAB3NzaC1yc2EAAAABIwAAAQEAtalWvzs6iDxwVfv+xcXy1uZD20aG1en9JohnL7pJJcslgx3Ok+63+KXYkrGrBX3+ol8opQziQNYqrODcliG7XisYuxIjgzvwtuhHHiWnqZ+4zLrbVLz2Zl7iJ5kuZFuGMJXnOlwxmz+a8KKPdAyVBduJxYCL9NUznJQca5L9SaXmDDjnPYOC+7zY0X7Tk/hbAGW6c4mibzL6jebFM5N98bhTXystabk0JZ/g+eEkxb681buit+o0teoXgQMPnRs8aJmAil4zmbVDRdQJOewLP1A2LSm55yxC/tsg+FMEpmtPwW0+8uiWp11ifJNwtwO58nsP2Uvn4syrRuvizGVXtQ== papyromancer@james.local

So open up your terminal program or equivalent and check your ~/.ssh directory for id_rsa and id_rsa.pub. If they’re there, that’s great. Email me your id_rsa.pub file and I’ll get you access to the repository. If you don’t have those files there… once again you’re going to GitHub for Instructions. After you’ve generated your keys, send me the public one :)

Setup Git

While you’re waiting for me to get your public keys onto the repository, take the time to tell git a little bit about yourself:

[~]$ git config --global user.name "mad voo"
[~]$ git config --global user.email mad.vooo@gmail.com

You’ll of course be using your user address from your key, mine was papyromancer@james.local. Yours may vary.

Setup Your Personal Development Environment

[~]$ git clone git@git-love.com:project.git

This will give you a nice neat little directory called project where you need to remove the empty rails directory

[~]$ cd project
[~]$ rm -drf vendor/rails

and put a reals [sic] rails directory there

[~]$ cd vendor
[~]$ git clone git://github.com/rails/rails.git

Next a few commands in the project directory, and you’ll have project running on your computer.

You’ll need to have ruby and rubygems installed from here on out… I’d be happy to walk you through it… or point you at some good tutorials.

[~]$ rake gems:install
[~]$ rake gems:refresh_specs RAILS_ENV=development

That’ll get all the source code into running order. Now we need to create the database

[~]$ rake db:create
[~]$ rake db:migrate

And now we can start the server

[~]$ script/server

You can now view your server at http://localhost:3000/ unless you’ve got your default setup differently. I currently run my dev projects locally with /etc/hosts modifications through Phusion Passenger under Apache… I have a good screencast of that setup if you’re interested.

You can also edit the application and view the changes in real time through your local script/server.

Modifying the Project

Everytime you go to work on the project make sure that you have the most recent source:

[~]$ git pull

I have a feeling that you designers will be spending a lot of time in the public folder where stylesheets and javascripts are kept, and also in the app/views folders, where the templates for data display through html and xml are stored, but feel free to change anything.

Main advice I have for you is branch often, and then branch some more. Anytime you start work on an element of the site go to the root project folder and type

[~]$ git checkout -b tinylittlechange

and this will create a new branch where you can modify your code until tinylittlechange is completed, at which point you’ll need to add all the new files to the project with

[~]$ git add .

Then you commit the files to your local repository:

[~]$ git commit -a -m 'I just made this really cool tiny little change'

and then you check it on your local server to make sure everything’s running properly… And when it is, you merge tinylittlechange back into master.

[~]$ git checkout master
[~]$ git merge tinylittlechange

Verify that the merge was successful by checking the local server once again, and if everything looks cool, it’s time to share tinylittlechange with the rest of us by typing:

[~]$ git push

This is going to send your revisions to the master branch of our repository where we can pull it down ourselves.

Also… when you push to my repository, the development site at http://project.git-love.com/ gets updated. You’ll see how cleanly the development relaunch goes in the output from your push command.

The development site is probably going to break a lot :(

But that’s OK… We all have working development environments on our machines, and the repository stays up weather the development site is working or not.

Updating the Live Site

When you give me your public keys and I add you to the repository, I’ll also create an ssh account for you on audioesque.com. When the development site is running smoothly it’s time to release those improvements to audioesque into the wild.

[~/]$ ssh username@project.com
[~/]$ cd /project/
[~/]$ git pull
[~/]$ rake db:migrate
[~/]$ touch tmp/restart.txt

And I think that touches on pretty much the whole development process…

10 months ago
#Rails, #Ruby #Git #Github #Web Development