Showing posts with label tutorial. Show all posts
Showing posts with label tutorial. Show all posts

Wednesday, July 24, 2013

Plone Quickstart on the Cloud in less than 5 minutes: Installing Plone on the Nitrous.io Platform


(update: August 18, 2015 the Nitrous.io free tier is no more, so you'll want to look at installing Plone on Cloud9 IDE)

(update: July 31, 2015)
A better free alternative to this is installing Plone on Cloud9 IDE.


(update: December 2, 2013, the script has been updated for Plone 4.3.2)
I learnt about Nitrous.io from +Tarik Carey at the July Plone Jamaica Meetup. He suggested that I should check it out and see if it can run Plone, so I did a few tests. Not only does it run Plone, but the installation can be done in less than 4 minutes*. I've created a little script (really a wrapper around the Plone Unified Installer) that does all the installation for you.

* I say 5 minutes in the title just so that I don't over promise.

Here are the steps:

Step 0 - Get a Nitrous.io account

You will need to get an account with Nitrous.io, so go and sign up over there and then come back here. (That link is a referral link, if you use it I get more units to use on my nitro boxes)

Step 1 - Start a new Python/Django Box

After logging in click 'New Box'. (update: so far I've tested all the different boxes and it actually doesn't matter if you choose a Node.js, Django or whatever box, no idea if this will change in the future)


Then select 'Python/Django', set your name and region, max out the storage and then click 'Create Box'



Step 2 - Run the Plone installer script

(update: December 1, the new URL will install Plone 4.3.2 now)
In the console of your new box paste the following command and press enter to begin the installation:
curl -L http://goo.gl/DiYOM8 | bash

You will see output similar to this:


Step 3 - Launch the server

Run the following command to start Plone (Zeo and Client1) as a foreground process.

(update: I've created start,stop,restart and debug scripts which should simplify development https://gist.github.com/pigeonflight/6089807, they are now integrated into the installer) 

Open a new console. Yes, you MUST open a new console!


In the new console window paste the following and press enter:
plone-start.sh
When you're ready to stop it you can open another console and use the command:
plone-stop.sh

If you've closed the browser and return to Nitrous.io you can check on your Plone process by running
plone-debug.sh

You can try "plone-restart.sh" though I prefer to explicitly stop it with "plone-stop.sh" then "plone-start.sh"

Step 4 - Setup Plone

You will know that Plone is running when you see the following message in the second console.
 "Zope Ready to handle requests" ([3] in the screenshot below). 

You can view the default administrator credentials, username and password under 'workspace' >  'zeocluster' in a file called adminPassword.txt ([2] in the screenshot below). To go to your live server select 'Preview' > 'Port 8080' ([1] in the screenshot below). 


You will see the Zope server ready to create your first Plone site.  You can now create a new Plone site, you will be prompted for your Admin credentials (stored in the adminPassword.txt [2] in the screenshot above).
Zope server, ready to create a Plone Site
Click create Plone site and enter your credentials.

Important things of note

This is definitely only suitable for development purposes, this is absolutely NOT FOR PRODUCTION USE. If you're a themer, integrator or developer, it should work nicely, I can see this coming in handy when working with a team on Plone projects or for running Plone training courses. 

Be careful, because this only runs in the foreground, the instance will die if you close the IDE or console window. If you want to work around this limitation there are ways to get shell access to your box and the Nitrous.io boxes support both screen and tmux (though I prefer the screen-based byobu). (See their tutorial on using tmux). 
Nitrous.io appears to be configured to limit background processes. The new plone-start.sh/plone-stop.sh scripts that now ship with this script are integrated with tmux, this means that, even though everything is a foreground process, your instances won't die if you close the console or window.

For those who want to see the code that run's this thing, here's the Gist:

Friday, December 14, 2012

Plone to the cloud in 3 easy steps

update: July 31, 2015 My recommended approach is to install Plone on Cloud9 IDE.

update: July 24, 2013 This no longer works as Dotcloud has retired their free sandboxes. I've documented a way to run Plone in the Cloud with Nitrous.io.

Before you start

You will need:
  • 5 to 10 minutes of spare time.
  • a  reliable internet connection 
  • a Cloud9 IDE account 
  • a Dotcloud account 

Have your login information for both Cloud9 IDE and Dotcloud close at hand.

Disclaimer:

The underlying tools for managing Plone on Dotcloud from Cloud9 IDE are in an alpha stage at best (meaning, I've been working on this for only a few weeks)

Setup and Installation

Step 1 - Clone the URL at Cloud9 IDE

Log in to Cloud9 IDE and from the dashboard select "Create new workspace" > "Clone from URL".


In the resulting dialog box, set the "source URL" to https://github.com/pigeonflight/stack-python-plone and click "Create":



Step 2 - Preparation

Launch your newly created Cloud9 IDE instance from the dashboard and install the dependencies by issuing the following commands from a dotcloud terminal (you can launch the terminal with the shortcut key Alt+T)
easy_install pip
pip install -r requirements.txt
Also setup dotcloud (you'll be prompted for you dotcloud username and password)
dotcloud setup

Step 3 - Create a dotcloud instance

From a terminal create a new dotcloud instance and push. (Answer yes when asked about using the current directory for using
dotcloud create plonedemo
dotcloud push
This will generate a live Plone instance on dotcloud.

Accessing your Plone Site

Your Plone site is named based on your dotcloud account name and your dotcloud instance name. If you used the name 'plonedemo' and your dotcloud account name is 'scotty', then your Plone url will be: http://plonedemo-scotty.dotcloud.com.

Your credentials (admin password)

The following command will retrieve your admin password:
dotcloud run www cat code/adminPassword.txt
Make a note of your admin password.

Visit the appropriate url using your webbrowser and log in using the credentials from the output of the above command.

Have fun.

Thursday, April 1, 2010

TTW Plone for Designers – Part 1

If you missed it, or just want to quickly revise the course material,
visit the video on demand (sorry about the ridiculous lack of
lighting):
http://www.livestream.com/pigeonflight/video?clipId=flv_47945cb1-281c-40da-857c-1cb474b973c7

I've noted some special times in the video so you don't have to endure
all the bumbling:

Watch live streaming video from pigeonflight at livestream.com


Content

18:20 - Purpose of Course
21:30 - Adding Objects via the ZMI
29:30 - Understanding Page Templates
33:10 - Using TAL (tal:content) in Page Templates
39:00 - Creating a Dynamic List with Page Templates
49:40 - Using Macros (METAL) in Page Templates
55:00 - Basing a Page on a Template (sorry about the bad sound here)
1:00:25 - Tour of A Fancy Site Template based on a free template
1:05:30 - Creating a Navigation Bar Menu for the Site
1:14:25 - Using Page Templates with metal:fill-slot to create a slideshow page
1:39:40 - Brief Tour of Plone

Errata
---------
During the presentation I referred to the basic site example as a
Plone Site (if you were keen you would see that it was clearly not a
Plone site, but a basic Zope site built with Page Templates)

Sign up for my upcoming Plone 5 Book & Video tutorials

plone 5 for newbies book and videos