Drumbeat/Website/Install: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
Line 25: Line 25:
Install the following stuff:
Install the following stuff:


* libgd2 for image manipulation - (XXXphp5-gd module + dependencies? Or is it built-in?)
* libgd2 for image manipulation - (php5-gd module + dependencies? Or is it built-in?) [booker - these are installed by default on Ubuntu]
* curl support for feeds (php5-curl module? Isn't it built-in?)
* curl support for feeds (php5-curl module? Isn't it built-in?) [booker - installed by default on Ubuntu]
* pecl module "uploadprogress" for enhanced ajax uploads (XXXwhere to find and how to install? Install php-pear and then run a pear command?)
* pecl module "uploadprogress" for enhanced ajax uploads (XXXwhere to find and how to install? Install php-pear and then run a pear command?)
* sendmail support (XXXphp-mail module? Or is it built-in?)
* sendmail support (XXXphp-mail module? Or is it built-in?)

Revision as of 17:17, 19 March 2010

Draft-template-image.png THIS PAGE IS A WORKING DRAFT Pencil-emoji U270F-gray.png
The page may be difficult to navigate, and some information on its subject might be incomplete and/or evolving rapidly.
If you have any questions or ideas, please add them as a new topic on the discussion page.

Packages To Install

(Debian/Ubuntu package names in brackets)

  • Apache 2.x (apache2)
  • PHP 5.2 (php5)
  • MySQL 5 (mysql-server)
  • PHP MySQL support (php5-mysql)
  • Mail server (e.g. postfix)
sudo apt-get install apache2 php5 mysql-server php5-mysql postfix

Configuration

PHP 5.2

Edit /etc/php5/apache2/php.ini and make the following changes:

  • memory_limit = 128M
  • max_execution_time = 300
  • upload_max_filesize = 8M

Install the following stuff:

  • libgd2 for image manipulation - (php5-gd module + dependencies? Or is it built-in?) [booker - these are installed by default on Ubuntu]
  • curl support for feeds (php5-curl module? Isn't it built-in?) [booker - installed by default on Ubuntu]
  • pecl module "uploadprogress" for enhanced ajax uploads (XXXwhere to find and how to install? Install php-pear and then run a pear command?)
  • sendmail support (XXXphp-mail module? Or is it built-in?)

Apache 2

  • Enable mod_rewrite for clean urls:
sudo a2enmod rewrite 

MySQL 5

  • innodb (XXX is there actually anything to do here? my.cnf on Ubuntu says InnoDB is enabled by default...)

Get Code

This includes our own copies of Drupal, various Drupal modules, and CiviCRM. From now on, $DRUPAL_ROOT represents the place you want to put the code - e.g. /var/www/drumbeat.org. If you don't put it in /var/www, you'll need a symlink so the webserver can see it.

Run this command:

svn co http://svn.mozilla.org/projects/crm/trunk $DRUPAL_ROOT

or

svn co https://svn.mozilla.org/projects/crm/trunk $DRUPAL_ROOT 

Or, if you have Mozilla SVN write access:

svn co svn+ssh://svn.mozilla.org/projects/crm/trunk $DRUPAL_ROOT

Install Sample Database

  • XXX - need to make this available
  • Need to set up database users with appropriate rights to the imported databases

Below, where it says to "update a database connection string", you should use the "mysqli" connection method, and the usernames, passwords and database names you set up in this section.

Additional Server Configuration

Edit $DRUPAL_ROOT/sites/default/settings.php:

  1. Update $db_url['default'] and $db_url['mozcrm_civicrm'] database connection strings ('default' is for the Drupal database, the other is for CiviCRM).
  2. Check the correct memcached port is specified in the memcache_servers array.
  3. Right at the bottom of the file, the domain module include path must be updated to be "$DRUPAL_ROOT/sites/all/modules/contrib/domain/settings.inc".

Edit $DRUPAL_ROOT/sites/default/civicrm.settings.php:

  1. Update the database connection string for the Drupal database (CIVICRM_UF_DSN).
  2. Update the database connection string for the CiviCRM database (CIVICRM_DSN).
  3. Update the CiviCRM root path $civicrm_root to be "$DRUPAL_ROOT/sites/all/modules/civicrm".
  4. Update the CiviCRM template folder CIVICRM_TEMPLATE_COMPILEDIR to be "$DRUPAL_ROOT/sites/default/files/civicrm/templates_c/".

Make these two files read only ($USER is your user, and $APACHE_USER is the user your Apache runs as, "www-data" on Ubuntu):

 cd $DRUPAL_ROOT/sites/default/
 chmod 0640 settings.php civicrm.settings.php
 sudo chown $USER:$APACHE_USER settings.php civicrm.settings.php 

Edit $DRUPAL_ROOT/sites/default/files/civicrm/upload/Config.IDS.ini:

  1. Make sure the full paths are correct ($DRUPAL_ROOT/sites/...)
  2. Make it read-only, and readable by the apache user only:
 cd $DRUPAL_ROOT/sites/default/files/civicrm/upload/
 chmod 0440 Config.IDS.ini
 sudo chown $USER:$APACHE_USER Config.IDS.ini

Verify that the following files & folders exist and are writeable by the apache user and readable by everyone else:

  1. $DRUPAL_ROOT/sites/default/files/ (and all subfolders)
  2. $DRUPAL_ROOT/cache/
 cd $DRUPAL_ROOT
 mkdir cache
 chmod -R 0664 cache sites/default/files
 sudo chown -R $USER:$APACHE_USER cache sites/default/files

View Site

From here on, replace $SITE with the URL you plan to use to access drumbeat.org on your local web server, e.g.

localhost/drumbeat.org

Access

http://$SITE/

to see your installation working.

XXX This will depend on your /etc/host configuration. All the required steps are at http://groups.drupal.org/node/6266 [booker] - Paul - can we integrate the appropriate steps, or give a simple recipe? That URL seems fairly complex... - Gerv i'll do this when i set up my development server [Booker]

Access

http://$SITE/user/

If you can reach the above but not this one, mod_rewrite may not be working.

XXX what about SSL config?

Web Configuration

Log in to the site as “admin”. (XXX password in default db?)

  1. Go to http://$SITE/admin/build/domain/settings and set the Primary domain name to the Mozillians domain name. Save.
  2. Go to http://$SITE/admin/build/domain/edit/2 and set the DOMAIN name to $SITE. Save. When using the drumbeat domain name, the site should now appear in the drumbeat theme.
  3. Next flush the cache - click “Flush all caches” on the Drupal icon menu (should be http://$SITE/admin_menu/flush-cache). (XXX isn't this broken?)

Now CiviCRM configuration which can be tricky, because it stores more path related settings in the database from the UI, which breaks links in the CiviCRM configuration screens.

  1. Check http://$SITE/civicrm/admin/setting/path?reset=1 full paths are correct.
  2. Check http://$SITE/civicrm/admin/setting/url?reset=1 paths are correct. Use the Drumbeat domain.
  3. Setup donation Payment Processors http://$SITE/civicrm/admin/paymentProcessor?reset=1 XXXNot for testing, I presume?

Google Maps API key - for geolocating users. Add it at http://$SITE/admin/settings/gmap

Flickr API key - for Flickr widget. Add it at http://$SITE/admin/settings/flickr

Enable the “Simple Mail” module to provide mail functionality

  1. http://$SITE/admin/build/modules. Save right at the bottom.
  2. http://$SITE/admin/settings/site-information and ensure site email is correct.

Setup timezone at http://$SITE/admin/settings/date-time

Drumbeat specific settings are configurable at http://$SITE/admin/settings/drumbeat

Finally check the status reports http://$SITE/admin/reports/status. You can safely ignore the SWFObject message.

Drupal cronjob

Run:

sudo crontab -e 

and add:

10 * * * * wget -q -O /dev/null http://$SITE/cron.php

XXX the cron.php file will also need to be unreachable from over the web [booker] - in which case, we should fix the default .htaccess so this is true - Gerv.

Troubleshooting

I'll be happy to assist anyone who wishes to help out with Drumbeat [booker]

Optional Pieces

Boost Module

Boost module maintains a page cache, which dramatically improves performance for anonymous users.

Modify the "cache" folder in the Drupal root apache writeable, other readable. Copy the settings generated at http://{drumbeat_staging_url}/admin/settings/performance/boost-rules into {Drupal root}/.htaccess over the existing #Boost rules section.

See the INSTALLATION section of sites/all/modules/contrib/boost/README.txt for configuration.

Memcached

You only need memcache if you are running performance testing or debugging memcache problems. Install these modules:

  • memcached (memcached)
  • php5-memcache 2.2.5 (php5-memcache) - not 3.x, which Ubuntu 9.10 ships

XXX Where do people get the older version of php5-memcache?

Run this command:

/usr/bin/memcached -m 2048 -p 11210 -u {apache user} -l 127.0.0.1
  • Check that the settings in {Drupal root}/sites/default/settings.php match the above command line (the port, in particular)
  • Make sure local services can access port 11210 on localhost XXX how? telnet test?

You can tell if it's working by checking the reports at http://$SITE/admin/reports/memcache - if there are no statistics, then memcache is not correctly configured or running.

Apache Solr

There's a separate page for this.

Extra Bits (???)

  • Moving CiviCRM database from staging to live. Clear the CiviCRM configuration from the database - which is rebuilt automatically from {Drupal root}/sites/default/civicrm.settings.php
UPDATE `mozcrm_civicrm`.`civicrm_domain` SET `config_backend` = NULL WHERE `civicrm_domain`.`id` =1 LIMIT 1 ;

Notes on setting up ubuntu desktop server for SSL

I'll help further with this wiki page when i go through the whole installation process from scratch on a vanilla install of Ubuntu.