Posts Tagged "CiviCRM"

CiviCRM – Joomla on Shared Hosting

Usually on Shared Hosting there are lots of restrictions, which makes it impossible to install CiviCRM. Few tricks that i learned over the time that might help others. (Especially if you can’t modify php.ini settings on shared hosting and you don’t know .htaccess) This is sort of customized installation procedure :)

1. Since we have more control on our local install, first install Joomla + CiviCRM on your machine. Make sure that local and live server versions are same. So that there is no conflict when you migrate.  I usually have separate database for CiviCRM, which make it easy for future upgrades and backups.

2. Once you have everything running on local server.

- Take the database backup of CiviCRM db.

- You need export INSERT statements for CiviCRM Component entries from you joomla_components table. Check below INSERT from my install.

- Take the backup of component/com_civicrm and administrator/component/com_civicrm  folders.

3. Now you are all set for migration. Most of the time Shared Hosting allow only ftp access and also there is no untaring/ unzipping utility.  So i would recommend to use a ftp client that resumes upload from the point it gets disconnected. So don’t use gFTP, I always had problems hence started using Filezilla.

- Upload component/com_civicrm and administrator/component/com_civicrm  to respective folder on your server.

- Modify civicrm.settings.php in both compnent/component/ and administrator/component/ make sure fix it according to your server settings.

- now make component entries in your joomla database on live server. If you are on latest CiviCRM 2.1.x and Joomla 1.5.x it should look like:

INSERT INTO `jos_components` ( `name`, `link`, `menuid`, `parent`, `admin_menu_link`, `admin_menu_alt`, `option`, `ordering`, `admin_menu_img`, `iscore`, `params`, `enabled`)
VALUES
( ‘CiviCRM’, ‘option=com_civicrm’, 0, 0, ‘option=com_civicrm’, ‘CiviCRM’, ‘com_civicrm’, 0, ‘js/ThemeOffice/component.png’, 0, ‘task=civicrm/profile\nreset=1\n’, 1),
( ‘CiviCRM Home’, ”, 0, 34, ‘option=com_civicrm&task=civicrm/dashboard&reset=1′, ‘CiviCRM Home’, ‘com_civicrm’, 0, ‘js/ThemeOffice/component.png’, 0, ”, 1),
( ‘Find Contacts’, ”, 0, 34, ‘option=com_civicrm&task=civicrm/contact/search&reset=1′, ‘Find Contacts’, ‘com_civicrm’, 1, ‘js/ThemeOffice/component.png’, 0, ”, 1),
( ‘Manage Groups’, ”, 0, 34, ‘option=com_civicrm&task=civicrm/group&reset=1′, ‘Manage Groups’, ‘com_civicrm’, 2, ‘js/ThemeOffice/component.png’, 0, ”, 1),
( ‘Import Contacts’, ”, 0, 34, ‘option=com_civicrm&task=civicrm/import&reset=1′, ‘Import Contacts’, ‘com_civicrm’, 3, ‘js/ThemeOffice/component.png’, 0, ”, 1),
( ‘CiviContribute’, ”, 0, 34, ‘option=com_civicrm&task=civicrm/contribute&reset=1′, ‘CiviContribute’, ‘com_civicrm’, 4, ‘js/ThemeOffice/component.png’, 0, ”, 1),
( ‘CiviPledge’, ”, 0, 34, ‘option=com_civicrm&task=civicrm/pledge&reset=1′, ‘CiviPledge’, ‘com_civicrm’, 5, ‘js/ThemeOffice/component.png’, 0, ”, 1),
( ‘CiviMember’, ”, 0, 34, ‘option=com_civicrm&task=civicrm/member&reset=1′, ‘CiviMember’, ‘com_civicrm’, 6, ‘js/ThemeOffice/component.png’, 0, ”, 1),
( ‘CiviEvent’, ”, 0, 34, ‘option=com_civicrm&task=civicrm/event&reset=1′, ‘CiviEvent’, ‘com_civicrm’, 7, ‘js/ThemeOffice/component.png’, 0, ”, 1),
( ‘Administer CiviCRM’, ”, 0, 34, ‘option=com_civicrm&task=civicrm/admin&reset=1′, ‘Administer CiviCRM’, ‘com_civicrm’, 8, ‘js/ThemeOffice/component.png’, 0, ”, 1);

Note the 34, is the parent id, so it’s the id of first record. you might have to modify it accordingly.

4. Lastly import CiviCRM database to live server CiviCRM database. Once you import make sure:

- Fire this command in your phpmyadmin or any other sql utitlity on your server for CiviCRM database.

UPDATE civicrm_domain SET config_backend=NULL;

- The login to your Joomla administration section and type this url to reset civicrm menus.

http://<joomla_site>/administrator/index2.php?option=com_civicrm&task=civicrm/menu/rebuild?reset=1

5. Now just logout and login to Joomla. CiviCRM should be working fine.

Few links that might help:

http://wiki.civicrm.org/confluence/display/CRMDOC/Moving+an+Existing+Installation+to+a+New+Server+or+Location

http://wiki.civicrm.org/confluence/display/CRMDOC/Install+2.1+for+Joomla

Note that this is hack to get CiviCRM working with Joomla. For official guide you should check http://wiki.civicrm.org

Hope this helps shared host user…

Configuring multiple CiviCRM on single Drupal

This instructions were originally written for Ubuntu, but can be used for other operating systems.

We will setup http://civicrm , which will be on CiviCRM trunk and http://civicrm21, which will be on CiviCRM v2.1 branch.

1. Download Drupal from drupal.org. Untar and copy it to /var/www/drupal-6.6.
2. We need multi-site Drupal setup. So create “civicrm” folder in sites/ .
3. Now we need to define Virtualhost in apache. You can read instructions from: http://httpd.apache.org/docs/2.2/vhosts/name-based.html
OR you can follow my instructions:

i) In your /etc/apache2/site-available. Create new file civicrm and copy below code
<VirtualHost *:80>
ServerName civicrm

DocumentRoot /var/www/drupal-6.6
<Directory /var/www/drupal-6.6/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>

ErrorLog /var/log/apache2/civicrm_error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/civicrm_access.log combined

</VirtualHost>

ii) sudo a2ensite civicrm
iii) sudo /etc/init.d/apache2 restart

This will create apache virtual host.

Then modify your /etc/hosts and to add new site “civicrm”

127.0.1.1    civicrm

Restart your network: sudo /etc/init.d/networking restart

4. Now you new site is ready and you can install drupal using http://civicrm

While installing you might get errors like;

“Copy the ./sites/civicrm/default.settings.php file to ./sites/civicrm/settings.php”

So copy sites/defaults/default.setting.php to sites/civicrm/settings.php

If you want clean url’s edit your .htaccess accordingly.

Important Note:

For your second site ie. http://civicrm21 you need to follow few more steps:
- take a drupal database table “system” dump (structure and data)
- create another new table for 21_system with above above dump
- add db prefix in your settings.php
$db_prefix = array( ‘system’ => ’21_’);
- specify $cookie_domain in your settings.php ( for eg civicrm21 )

5. After that install CiviCRM, you can get it from http://civicrm.org

Untar and copy civicrm folder in “sites/civicrm/modules/”.

Just in case you are running civicrm from svn. Then your settings_location.php should be like:

define( ‘CIVICRM_CONFDIR’, ‘/var/www/drupal-6.6/sites/civicrm’ );

For installing another instance of civicrm you need to create another site in drupal. So sites/civicrm21. Then repeat above steps.

So http://civicrm (CiviCRM trunk) and http://civicrm21 (CiviCRM v2.1)

Enjoy CiviCRM and Drupal :)

CodeCamp Mumbai Nov 17/18

CodeCampMumbai was officially sponsored by CiviCRM.

And it all begins like normal barcamp. As we all know most of the developers are nocturnal, yet again this CodeCamp will start off schedule.

I am here with one of my colleague to work on Facebook plugin for CiviCRM. Other projects include lighting up bulb using web interface(PHP), mapping and adding events on Google Map and many more….

At around 12.00 pm we kicked off with the event. We will try to do some magic in next 20 hours or so.

I had several problems with net connectivity, which slowed down my progress. After lunch we had a good coding session and we were able get most of the data from Facebook in CiviCRM.

At around 6.00 we were able get most the CiviCRM related stuff working like Facebook tab in Contact Summary and were also able to generate permanent session key for facebook so that everytime user need not login to their Facebook account.

Since everyone was busy with their projects, we had late dinner along with a good all topic discussion as a dessert :)

At around 1.30 am we were able to get Contact Summary with Facebook profile and also Contact Dashboard with Friend list. We are hoping to do more work done in next few hours.

Complete how to on this feature will be posted on CiviCRM blog.

After trying for around 2 hours we gave up on CiviCRM plugin for WordPress. It was fun working with Akshay on this.

At around 6.30 am we were almost done with Facebook stuff. We were able to get data from Facebook and display it in CiviCRM.

Finally at around 7.00 am we headed for our homes. It was fun working together with everyone @ CodeCamp.

For more photos: http://www.flickr.com/photos/barkha/sets/72157603221321385/

OSSCampDelhi Sept 9, 2007

Day 2:

Video thumbnail. Click to play

Click To Play

OSSCampDelhi Sept 8, 2007

Day 1:

I traveled all the way to Delhi to attend OSSCampDelhi, Non-Conference (Bar Camp), my first Open Source Camp in India. It started well with a good presentation on “HIGH Performance Websites”.
Speaker shared few tricks how to make you front-end load faster.

  • Use of expire headers for javascript, css
  • Use of compressor to remove spaces in javascript using tools like (Dojo Shrink safe, YUI Compressor, JSMin, Dean Edwards Packer)
  • use of mod_gzip/ mod deflate for apache
  • not to use @import use “link” tags
  • load script at last (although i am don’t agree)

Another interesting presentation was on “MySQL Performance Tuning” from a OSS guys. We had a good discuss after the session which helped me to learn few new things. Few do’s listed by the Presenter(for specific to InnoDB)

  • use varchar instead of char
  • avoid using count (*) with InnoDB, ( You can use it for MyISAM since it stores row count)
  • avoid use of autocommit, use transaction mechanism for multiple statements
  • configure to use larger data pools.
  • disable non required engines
  • use auto increment for unique identification rather than primary keys (lot of thing to argue on this)
  • make NOT NULL columns if possible
  • enable log-slow-query (this helps to track slow queries so that you can optimize it

Some other useful command for MySQL

  • SHOW PROCESSLIST
  • SHOW GLOBAL status like ‘slow_queries’
  • SHOW LOCAL status like ‘slow_queries’

Mir Nazim, gave a good intro to Drupal. Some of new members in Open Source world were very much thrilled by its powerful nature as CMS.

To end the day Noel Hidalgo, expressed his view on use of Media in Social Sector. I was very much impressed with way and his thinking about the use of internet, technology, social networking etc, in Social Sector. We had good laugh at some of his jokes and enjoyed his story on “Scooter Group”.

I conducted a session on CiviCRM, it was good to see few enthusiasts from the crowd.

To summarize the day, i would say besides few sessions other stuff was not for me :( . It was much of a training session or i should say engineering student presenting for some contest.