Introduction: Create Free Dynamic Website Using OpenShift Cloud
This instruction will show complete steps we did while we setup our free dynamic website.
First step is to sign up as OpenShift user.
They offer cloud server with limited scalability options for FREE.
So go go Go, already.
Step 1: Step 1: We Need Private and Public Keys to Connect the Server
We highly recommend to create private and public keys with Putty. You can convert Putty specific keys to OpenSSH format easily (shown below). You need two programs, Putty and Puttygen.
Open puttygen and click "Generate". This will generate unique key pair. When generated click "Save private key", choose location and name.
Step 2: Setting Up Openshift Public Key
You need to add public key to Openshift account. For this, sign in Openshift and go to "Settings" tab.
From puttygen select content of the Public key and copy. (If you closed the generator, you can get the public key by loading existing private key.)
Paste the public key to box in Openshift site marked in the pic 1. Click "Save".
Step 3: Create Your Application
Go to "Applications" tab and click "Create your first application now". Choose PHP 5.4. Choose your settings according to your own preferences and click "Create application".
Open your new application and click "Add MySQL 5.5"
Step 4: Connect to Your New Application With Putty
Get your application connection address from Openshift site. Open application and click "Want to log in to your remote application".
Now you can see your ssh connection command. It means;
ssh <username of application>@<name of application>-<account name>.rhcloud.com
Copy whole string without "ssh ". Paste the string to Putty as "Host name"
Give name for session and click "Save"
Step 5: Adding SSH Private Key for Putty Session
In Putty, go to section Connection -> SSH -> Auth
Click "Browse" and find your private key file
Go back to section Session and "Save" the session.
Click Open to connect your application server.
Step 6: Convert Openssh Private Key From Putty Private Key
Create Openssh private key in PuTTygen -application. If you already closed the application, use Load -button to load previously created private key.
Export and save OpenSSH private key with Conversions dropdown menu.
OpenSSH private key is needed for git -application.
Step 7: Installation of Git
Download git -application and install it.
Start "git bash"
Type into shell "ssh " Example "ssh 1234567b8901abcd00000bd0@php-example.rhcloud.com". At this time, you will get "Permission denied" -message from your server.
This will generate OpenSSH configuration files Windows local user folder. Example "C:\Users\yourusername\.ssh"
Copy previously exported OpenSSH -key file into .ssh -folder.
Create "config" file into .ssh -folder.
Open "config" file and these lines in it.
---------------------------------------------Config File--------------------------------------------------
Host *
ServerAliveInterval 10
Host php-example.rhcloud.com
User 1234567b8901abcd00000bd0
IdentityFile ~/.ssh/opensshkey
---------------------------------------------End File--------------------------------------------------
Step 8: Cloning Git -repository From Openshift Server
On Openshift account, select your application. Find field named "Source Code" and copy its content.
Start "Git Bash" from Windows start menu. Bash will open in your home directory (example in Win7: /c/Users/Username) Write "git clone " and paste the content of "Source Code" field. Press Enter. This will create folder which is named after your application to your home directory (example for PHP: c:\users\username\php).
Step 9: (Optional) Install Additional Tools
Download Notepad++ and install it.
Download Winmerge and install it.
Configurate git to use Winmerge as difftool.
You can also set your name and email address for Git tool using these commands
$ git config --global user.name "Your Name Here"
$ git config --global user.email your@email.com
Step 10: Replace Default Openshift -page With Our Own Code ( NOT FINISHED )
This guide is not finished.
We have ideas, but not yet found time to complete this set of instructions.
( Hopefully we have time to work on this in next the year or the next or ... )
_____________________________________________
Note for us!
- Winmerge kikkaillaan
- Siirretään vanha sivu git mv komennolla toiseksi

