Visit E-Democracy's [https://github.com/e-democracy/buildout-config buildout-config repo] and grab the URI that you wish to use. Then, in your development space on your file system, create a folder named 'e-democracy' and cd into it. Finally, clone the above repo. It's recommended that you clone into a repo with a name that makes sense, such as 'forums', 'forums.e-democracy.org', or 'groupserver'. Thus, your clone command might look like:

+

Visit E-Democracy's [https://github.com/e-democracy/buildout-config buildout-config repo] and grab the URI that you wish to use. Then, in your development space on your file system, create a folder named 'e-democracy' and cd into it. Finally, clone the above repo. It's recommended that you clone into a folder with a name that makes sense, such as 'forums', 'forums.e-democracy.org', or 'groupserver'. Thus, your clone command might look like:

git clone https://github.com/e-democracy/buildout-config.git forums

git clone https://github.com/e-democracy/buildout-config.git forums

−

This will fetch all of the files that are needed to build GroupServer and E-Democracy's custom eggs. This repo is also used to save and share changes to the buildout configuration. Thus, always be sure to do a '''git pull''' to get the latest buildout configuration and eggs.

+

This will fetch all of the files that are needed to build GroupServer and E-Democracy's custom eggs. This repo is also used to save and share changes to the buildout configuration. If you plan to develop on E-Democracy, always be sure to do a '''git pull''' to get the latest buildout configuration and eggs.

== Set config.cfg ==

== Set config.cfg ==

Revision as of 20:10, 15 April 2013

This page attempts to walk you through the installation of GroupServer, E-Democracy's custom eggs, and the ZMI files required to make many of E-Democracy's pages work as they do on http://forums.e-democracy.org. The resulting local instance will not be a perfect replica of what is currently hosted at http://forums.e-democracy.org, but it will provide an instance that you can use to develop on E-Democracy's code.

If you are interested in simply installing and developing on core GroupServer, please visit http://groupserver.org/downloads/ to download the most recent release and find instructions on how to install it.

Set Hosts

The absolute first thing you need to do is decide on the host name you will use to access your local instance of GroupServer/E-Democracy. Zope will behave differently based on what URL you use to access it, and it is best to choose a host name besides 'localhost'.

The host name used as an example through this document is 'e-dem-box'.

Once you have decided on a host name, you must edit /etc/hosts to add a reference for your host name. If your hosts file contains lines for both 127.0.0.1 and 127.0.1.1 (common in Debian and Ubuntu), add a reference for your chosen name on the 127.0.1.1 line.

Requirements

In the following list, the brackets [] contain the name of the apt package to get.

Debian based OS (Debian and Ubuntu both known to work)

Sudo [sudo]

Git [git]

Mercurial* [mercurial]

Python 2.7 [python2.7]

Postfix [postfix]

Postgres [postgres]

Nginx [nginx]

libxslt1-dev [libxslt1-dev]

It actually is possible to install E-Democracy without Mercurial. However, GroupServer's code is kept in Mercurial repos, so if you plan on doing any programming, you will need to have Mercurial installed to push your changes.

There is a great write-up by a user who attempted to install GroupServer on Scientific Linux (a variant of RHEL), which gives hope to those who want to install on rpm based distros. That said, it will probably be a lot easier to just install Ubuntu or Debian.

Sudo

If you are installing on Ubuntu, you can skip this section, since sudo is already installed and setup on Ubuntu.

Several of the steps that follow require root access. More importantly, gs_install_ubuntu.sh (the file that will drive a lot of the installation) assumes that sudo is available and configured for the user that runs it. In theory it is possible to run gs_install_ubuntu.sh as root, but this will mess up the permissions of all files created in the process, and will make it harder in the future to develop on E-Democracy as a regular user.

Assuming that sudo is installed, you can run the command visudo as root to edit the sudoers file, which controls how sudo works. In this file, find the following line:

root ALL=(ALL:ALL) ALL

and add a similar line for your regular system user (called 'super-programmer-hero' here):

super-programmer-hero ALL=(ALL:ALL) ALL

Save the file and exit the editor.

Fix Postgresql Transactions Limit

Postgresql out of the box is not configured to support transactions, which GroupServer makes use of. Thus, you will have to edit /etc/postgresql/<version>/main/postgresql.conf so that it contains the following line:

max_prepared_transactions = 10

postgresql.conf should already contain a line that sets max_prepared_transactions, so just find that line and modify it so that max_prepared_transactions is any non-zero value.

Configure Nginx

You will want to add a site configuration for E-Democarcy. This is important for two reasons:

Its always good to create a configuration for any web-app you are developing on, since you may have multiple web apps you are working on at any given time

The Nginx configuration does two very important things:

It inserts a string into the URL of requests that tells GroupServer to apply E-Democracy's custom eggs/skin

It inserts a header that tells GroupSever which configuration instance to use

On your file system go to /etc/nginx/sites-available and create a file named 'e-democracy'. In e-democracy, insert the following:

Note that in the above we refer to the host name established earlier. Replace 'e-dem-box' with whatever host name you choose. Also note the value of INSTANCEID we insert; this must correspond to a configuration instance that we will create in gsconfig.ini later.

Save /etc/nginx/sites-available/e-democracy. Then go into /etc/nginx/sites-enabled and create a link to sites-available/e-democarcy:

ln -s ../sites-available/e-democracy e-democracy

Now restart Nginx:

service nginx restart

Get the E-Democracy Config Files

Visit E-Democracy's buildout-config repo and grab the URI that you wish to use. Then, in your development space on your file system, create a folder named 'e-democracy' and cd into it. Finally, clone the above repo. It's recommended that you clone into a folder with a name that makes sense, such as 'forums', 'forums.e-democracy.org', or 'groupserver'. Thus, your clone command might look like:

This will fetch all of the files that are needed to build GroupServer and E-Democracy's custom eggs. This repo is also used to save and share changes to the buildout configuration. If you plan to develop on E-Democracy, always be sure to do a git pull to get the latest buildout configuration and eggs.

Set config.cfg

Create dummy error pages

There is a difference between the error handling systems of the production server and our development environment that causes the development environment to redirect to a non-existant page whenever an error/missing page is encountered. This makes reading errors in the log file a lot harder, because it becomes an infinate loop of not found pages.

So, we create a dummy new_unexpected_error.html in the ZMI:

Go to ZMI

Go to groupserver/Content/initial_site

Create page template new_unexpected_error.html

Set Content-Type to text/html

Leave Body as default, or customize if you wish

We also create a dummy new_not_found.html page in the ZMI. It won't display anything useful, but it will make reading the logs a lot easier:

<p>Select by place for community <a href="http://e-democracy.org/if">Issues Forums</a> or join the Online Communities and Project online groups that we host below.</p>
<p>No <a href="http://e-democracy.org/if">Issues Forum</a> in your community? <a href="http://e-democracy.org/contact">Contact Us</a> to propose one.</p>

Set up XSLT

Go to Properties tab of /groupserver/Content/initial_site/groups/content_en

Set transform_paths to: Presentation/Tofu/XHTML2/xslt/

Save

Set property named 'transform_html' to 'xhtml2-transform_body-content-only (xslt)'. Leave the other transform properties as 'do not use transform'

Save

Set category properties

In /groupserver/Content/initial_site/groups, go to Properties tab

Create a property named 'categories' of type lines

Once saved, enter a couple of categoires ('Test', 'Empty')

For each group that current exists

Go into the group's folder

View the group's Properties

Create a property named 'category' of type 'string', with a vlue equal to one of the categories entered above