THIS PAGE IS UNDER CONSTRUCTION
Mifos's web face to the community consists of two production web sites:
Type |
Instance |
---|---|
Content Management |
Pressflow |
Web server |
Apache 2 |
Database |
mySQL 5.2 |
These two sites are powered by a single instance of Pressflow, a distribution of Drupal. Drupal is a PHP-based, open-source, content-management system. Pressflow enhances Drupal for performance, scalability, availability, and testing.
Drupal's standard component stack consists of Apache, PHP, and mySQL.
Both mifos.org and mifos.com are served by the same Drupal code base, which is set up as a multi-site installation. On the production server, 'mifos.org' is set up as a virtual host served by /path-to-mifos/sites/mifos.org, and likewise for 'mifos.com'.
Drupal's code, modules, style, and other parts of these Web sites are all version-controlled by Git.
/var/local/git/mifoswww on mifos.com is a git clone (repository). This is where the live server and the test/stage server push to and pull from. In git parlance, this means /var/local/git/mifoswww is the remote named "origin" for the servers.
The following are instructions for anyone to submit patches to mifos.com or mifos.org.
In order to submit a patch you must first develop and test the patch locally. Here are instructions for setting up a local environment. We assume that you know how to develop in Drupal and that you have installed the necessary development stack (PHP, Apache, mySQL). Excellent instructions can be found in Drupal's online handbooks. In particular, see this page for help setting up a local development environment. These instructions describe only those steps needed to set up a local environement for mifos.org and mifos.com.
Note that YOU MUST USE mySQL, since the sample database is a mySQL dump.
mifos-local
.mifos-local
and clone the Git repository
git clone git://mifos.git.sourceforge.net/gitroot/mifos/www |
mifos-local/www
. If you'd like, you can rename the directory.A sanitized database containing configuration information is provided for development only.
mifos.org
and mifos.com
maintains its own database, so be sure that you download both.mifos_org
and mifos_com
.
mysql > GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, LOCK TABLES, CREATE TEMPORARY TABLES ON `mifos_com`.* TO 'mifos'@'localhost' IDENTIFIED BY 'mifos'; mysql > GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, LOCK TABLES, CREATE TEMPORARY TABLES ON `mifos_org`.* TO 'mifos'@'localhost' IDENTIFIED BY 'mifos'; |
sites/default/default.settings.php
and place them where the two sites can find them:
$ cp sites/default/default.settings.php /sites/default/settings.php $ cp sites/default/default.settings.php /sites/mifos.org/settings.php |
sites/default/settings.php
:
... $db_url = 'mysql://mifos:mifos@localhost/mifos_com'; ... |
sites/mifos.org/settings.php
:
... $db_url = 'mysql://mifos:mifos@localhost/mifos_org'; ... |
You should simulate virtual hosting locally. But if you add 'mifos.org' and 'mifos.com' to your hosts file, all requests from your pc will get routed to your local site, rendering you unable to access the production sites. To get around this, set up local aliases – for example, 'mifos.org.local' and 'mifos.com.local' – but make sure that Git ignores them when submitting changes.
> mkdir /path-to-mifos/sites/mifos.org.local > ln \-s /path-to-mifos/sites/mifos.org /path-to-mifos/sites/mifos.org.local > mkdir /path-to-mifos/sites/mifos.com.local > ln \-s /path-to-mifos/sites/mifos.com /path-to-mifos/sites/mifos.com.local |
127.0.0.1 mifos.org.local 127.0.0 1 mifos.com.local |
virtualhost
entries to your Apache configuration. A copy of mifos.org
's virtual-host configuration is attached. Customize it for your local environment.Use git format-patch
, then send the patch to the mifos-developer mailing list. You may also clone our www repository at sf.net, push changes to a public repository and send a pull request to the mifos-developer mailing list.
The following must be performed by an administrator with root access to the live servers.
Live server working tree |
/var/www/mifos |
Test/stage server working tree |
/var/www/mifos_testing |
Private clone on mifos.com |
/var/local/git/mifoswww |
The "www" repository on sf.net is a public clone. This clone is the primary location where contributions to mifos.com and mifos.org will be solicited. All clones are kept in sync manually.
All changes (except user-generated content and changes in the database) are done as git patches. For example:
Certain things are not committed to version control. These files must be manually maintained (see .gitignore files in the public clone):
[10/19/2010 2:21:04 PM] Adam Monsen: Ed,
will you set up a schedule for changes/upgrades to the sites? ie,
something like:
A dev/ops person will push changes to mifos.com/mifos.org the
first Thursday of every month at 9am Pacific.
Drupal module security upgrades will be performed by the end of
day the first Wednesday of every month, hence, will be included
in the push to live on the first Thursday of the month.
Per recommendations of Jim Stamper, upgrades to Drupal, contrib module upgrades, and any necessary patches will be applied monthly. A dev/ops person will push changes to mifos.com/mifos.org the second Thursday of every month at 9am Pacific. Drupal module security upgrades will be performed by the end of day the second Wednesday of every month, hence, will be included in the push to live on the second Thursday of the month.
Subscribe to Drupal Security Announcements to be aware of any security advisories and any patches to install.
To immediately revert the live server to a known good state, use "git log" to find a commit, then "git checkout COMMIT_SHA1" to change the working tree to that commit.
The more permanent fix must be made in source control. Use "git revert" or simply manually undo the change in another commit, then repeat the process outlined above to push content live.
Changes to the following may need to be reverted manually