Installation/OpenShift: Difference between revisions

From diaspora* project wiki
No edit summary
No edit summary
Line 6: Line 6:
# Keep a copy of your MySQL settings, you will need it ;)
# Keep a copy of your MySQL settings, you will need it ;)
# Connect to your cloud with ssh : You have a example with git :
# Connect to your cloud with ssh : You have a example with git :
<pre>git clone ssh://a-lot-of-number-and-letters@yourappli-yournamspace.rhcloud.com/~/git/timmy.git/</pre>
<pre>git clone ssh://a-lot-of-number-and-letters@yourappli-yournamspace.rhcloud.com/~/git/yourappli.git/</pre>
Connect by transform this command to
Connect by transform this command to
<pre>ssh a-lot-of-number-and-letters@yourappli-yournamspace.rhcloud.com</pre>
<pre>ssh a-lot-of-number-and-letters@yourappli-yournamspace.rhcloud.com</pre>
Line 25: Line 25:
edit the url and remove the # in front of <pre>certificate_authorities: '/etc/pki/tls/certs/ca-bundle.crt'</pre> and <pre>port: 3000</pre>
edit the url and remove the # in front of <pre>certificate_authorities: '/etc/pki/tls/certs/ca-bundle.crt'</pre> and <pre>port: 3000</pre>


# Enter <pre>$OPENSHIFT_MYSQL_DB_HOST</pre> in your shell to know the IP of the database, then edit the file with
Enter <pre>$OPENSHIFT_MYSQL_DB_HOST</pre> in your shell to know the IP of the database, then edit the file with
<pre>nano database.yaml</pre>
<pre>nano database.yaml</pre>
And edit host with the IP found, put the username and the password saved on step 4. Change the socket to MySQL with the value below too. (host can work by letting localhost)
And edit host with the IP found, put the username and the password saved on step 4. Change the socket to MySQL with the value below too. (host can work by letting localhost)
Line 33: Line 33:
password: "xxx"
password: "xxx"
socket: ~/mysql-5.1/socket/mysql.sock</pre>
socket: ~/mysql-5.1/socket/mysql.sock</pre>
Okay, so now, connect to the mysql database with
<pre>mysql -u admin -p</pre>
then create the diaspora database with
<pre>CREATE DATABASE diaspora_production</pre>
and <pre>exit</pre>
You can now create the tables with
<pre>RAILS_ENV=production bundle exec rake db:schema:load</pre>

Revision as of 21:34, 22 January 2013

Here is a quick guide to deploy Diaspora* on OpenShift, the cloud solution powered by RedHat

  1. Create an account on [OpenShift https://openshift.redhat.com/app/] (it's free !)
  2. Choose Ruby on Rails application
  3. Choose a public URL and change "Source Code" to git://github.com/diaspora/diaspora.git
  4. Keep a copy of your MySQL settings, you will need it ;)
  5. Connect to your cloud with ssh : You have a example with git :
git clone ssh://a-lot-of-number-and-letters@yourappli-yournamspace.rhcloud.com/~/git/yourappli.git/

Connect by transform this command to

ssh a-lot-of-number-and-letters@yourappli-yournamspace.rhcloud.com

You probably need to set a public key in your account setting first. If you don't have one, generate one with ssh-keygen and put it in .ssh in your home

In your cloud, go to the app folder :

cd app-root/repo/

run bundle install :
bundle install

Edit your diaspora.yaml and database.yaml file :

cd config
mv diaspora.yaml.example diaspora.yaml
mv database.yaml.example database.yaml
nano diaspora.yaml

edit the url and remove the # in front of

certificate_authorities: '/etc/pki/tls/certs/ca-bundle.crt'

and

port: 3000

Enter

$OPENSHIFT_MYSQL_DB_HOST

in your shell to know the IP of the database, then edit the file with

nano database.yaml

And edit host with the IP found, put the username and the password saved on step 4. Change the socket to MySQL with the value below too. (host can work by letting localhost)

host: 127.5.154.129" #"localhost"
port: 3306
username: "admin"
password: "xxx"
socket: ~/mysql-5.1/socket/mysql.sock

Okay, so now, connect to the mysql database with

mysql -u admin -p

then create the diaspora database with

CREATE DATABASE diaspora_production

and

exit

You can now create the tables with

RAILS_ENV=production bundle exec rake db:schema:load