Drumbeat/Website/Install: Difference between revisions
Paulbooker (talk | contribs) |
Paulbooker (talk | contribs) No edit summary |
||
Line 209: | Line 209: | ||
== Notes on setting up drumbeat on your Ubuntu desktop (based on the current wiki) == | == Notes on setting up drumbeat on your Ubuntu desktop (based on the current wiki) == | ||
* | * *https://wiki.mozilla.org/Drumbeat/PaulBooker/How_to_set_up_Drumbeat_on_your_Ubuntu_desktop | ||
== Notes on setting up ubuntu desktop server for SSL == | == Notes on setting up ubuntu desktop server for SSL == | ||
*http://www.tc.umn.edu/~brams006/selfsign.html | *http://www.tc.umn.edu/~brams006/selfsign.html | ||
Revision as of 10:18, 30 April 2010
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:
- Update $db_url['default'] and $db_url['mozcrm_civicrm'] database connection strings ('default' is for the Drupal database, the other is for CiviCRM).
- Check the correct memcached port is specified in the memcache_servers array.
- 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:
- Update the database connection string for the Drupal database (CIVICRM_UF_DSN).
- Update the database connection string for the CiviCRM database (CIVICRM_DSN).
- Update the CiviCRM root path $civicrm_root to be "$DRUPAL_ROOT/sites/all/modules/civicrm".
- 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:
- Make sure the full paths are correct ($DRUPAL_ROOT/sites/...)
- 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:
- $DRUPAL_ROOT/sites/default/files/ (and all subfolders)
- $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?)
- Go to http://$SITE/admin/build/domain/settings and set the Primary domain name to the Mozillians domain name. Save.
- 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.
- 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.
- Check http://$SITE/civicrm/admin/setting/path?reset=1 full paths are correct.
- Check http://$SITE/civicrm/admin/setting/url?reset=1 paths are correct. Use the Drumbeat domain.
- 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
- http://$SITE/admin/build/modules. Save right at the bottom.
- 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 drumbeat on your Ubuntu desktop (based on the current wiki)
Notes on setting up ubuntu desktop server for SSL
Questions/ Notes
This is stuff that Ned Is working through as he starts getting set up to work on the site locally.
Blockquotes get converted to paragarphs
what I type an <blockquote> into the blog edit textarea it saves as a <p>
Content of Project Pages Duplicated when not signed in
This will be fixed eventually: From M. Haggerty:
"there are views on the production server that will display things properly. they need to be copied down. we dont have a direct process for downloading stuff from there at this time."
so patience is the key here!
Working with Javascript
- How are the js files structured and what files can I add functions to?
- It would seem that sites/all/themes/drumbeat/js/theme.js would be the most appropriate place to add universal javascript, but on my setup, changes I make to this file are not rendering to the browser.
- You will need to disable "OPTIMIZE JAVASCRIPT FILES" and clear the drupal cache look for 'CLEAR CACHED DATA' [booker]
- Apparently Javascript Concatenation is turned on by default, for development work this should be turned off here: admin/settings/performance but I am not seeing any form controls here to turn it off.
- Look for "OPTIMIZE JAVASCRIPT FILES" @ admin/settings/performance as select the disable option... [booker]
Signup not working
- I couldn't reproduce this problem on my local development server. Are you still experiencing this problem? [booker]
Is it possible to create a user on the local version of the site without this error:
Sorry. A non-recoverable error has occurred. QuickForm Error: unknown error Return to home page. Error Details: Array ( [callback] => Array ( [0] => CRM_Core_Error [1] => handle ) [code] => -1 [message] => QuickForm Error: unknown error [mode] => 16 [debug_info] => Form rule callback returned invalid value in HTML_QuickForm::validate() [type] => HTML_QuickForm_Error [user_info] => Form rule callback returned invalid value in HTML_QuickForm::validate() [to_string] => [html_quickform_error: message="unknown error" code=-1 mode=callback callback=CRM_Core_Error::handle prefix="QuickForm Error: " info="Form rule callback returned invalid value in HTML_QuickForm::validate()"] )