Koha Test Wiki MW Canasta on Koha Portainer

Test major Koha Wiki changes or bug fixes here without fear of breaking the production wiki.

For the current Koha Wiki, visit https://wiki.koha-community.org .

Koha Dev Env Setup

From Koha Test Wiki MW Canasta on Koha Portainer
Jump to navigation Jump to search

This page describes how to wire in a Koha checkout on your desktop to the Koha installation you've just created. It assumes you've already followed the steps in Setting_Up_Koha_in_Virtual_Environment_+_Using_That_as_a_Development_Environment.

Step: NFS Export Your Home Directory

It would be nice if you didn't need to copy files from machine to machine and could do your editing and other work on your desktop machine that has all the right dev tools in place. We use NFS to export your home directory to the virtual machine.

You may need to install the nfs-server package on your desktop if it's not already. If your desktop machine doesn't have an /etc/exports file you'll need to do that. Then:

desktop$ sudo vi /etc/exports

adding this line:

/home 192.168.122.0/255.255.255.0(rw,sync,no_subtree_check,no_root_squash)

then export the filesystem

desktop$ sudo exportfs -a

You should take some time to understand what you've just done. Any machine on the 192.168.122.0 subnet (the one used by QEMU/KVM) can do anything it wants to any file under /home on your desktop machine. You could be a little more strict about this by exporting just a single directory like /home/reed/koha-dev-dir and you could be more specific about exporting to just the single host. It's a balance of convenience and security. Different working environments will have different requirements.

Now mount the filesystem on kohabox.

kohabox$ sudo vi /etc/fstab

adding one line

desktop:/home/USER /home/USER nfs

then

kohabox$ sudo mount /home/USER

replacing USER with your username, now cd to your newly mounted home directory

kohabox$ cd ~/

You should see that your home directory is now on kohabox also; you should be able to edit files there.

After making changes like this I have a habit of rebooting the virtual machine or at least fully log out and back in. You've mounted a file system atop one you were using and it's just an odd situation to be in.

Step: Check Out Koha via Git

If you don't already have it. Install the git package. Git can change a bit from version to version. I'm using v1.7 and you probably want that too. If you are new to git but have experience with csv or svn you will find the usage model can be a bit confusing but it's useful and powerful enough that you'll eventually come to appreciate it.

desktop$ mkdir ~/koha-src
desktop$ cd ~/koha-src
desktop$ git clone git://git.koha-community.org/Koha-community/Koha.git koha

You'll now have a checkout of Koha in ~/koha-src/koha/


Step: Point This Koha Instance At Your Development Code Checkout

Now we need to modify the apache configs so that instead of using the packaged Koha code, the system is pointing to your code checkout in ~/koha-src/koha/

You will be editing 3 files in /etc/koha/ (As always, save copies of the original files in case you need to roll back.)

In /etc/koha/apache-shared.conf change: (set USER as appropriate)

SetEnv PERL5LIB "/usr/share/koha/lib"

to

SetEnv PERL5LIB "/home/USER/koha-src/koha"

In /etc/koha/apache-shared-opac.conf :

  • replace /usr/share/koha/opac/htdocs with /home/USER/koha-src/koha/koha-tmpl
  • replace /usr/share/koha/opac/cgi-bin with /home/USER/koha-src/koha/

In /etc/koha/apache-shared-intranet.conf :

  • replace /usr/share/koha/intranet/htdocs with /home/USER/koha-src/koha/koha-tmpl
  • replace /usr/share/koha/intranet/cgi-bin/search.pl with /home/USER/koha-src/koha/catalogue/search.pl
  • replace /usr/share/koha/intranet/cgi-bin with /home/USER/koha-src/koha/

MISSING IMPORTANT STEP -- need to include instructions for updates to koha-conf.xml and likely db upgrade -reed

Restart apache and confirm it works.

Now make some changes in the code and see them in action.

Step: Next Steps...

need to add pointers to the wiki where it talks about about getting going with git and submitting patches. -reed