Topic: Setting Up Environment on Host for Kete
Topic type:
What are the steps to set up a computer's user and its directories to host Kete.
Originally written by Walter McGinnis, Kete Project Lead for Katipo Communications, Ltd.
Part of the Installation Guide
Application User Set Up
This is a matter of taste, but I like to keep things by the user that is going to "own" the application.
Using your own account
If you are setting up Kete for a demo or development, the simplest thing is for you to use your day-to-day user account. In which case, your new Kete would live under "/home/your_account/apps/your_app" on most Unixy operating systems. On Mac OS X this would be "/Users/your_account/apps/your_app".
If you choose to use your account, then all you have to do for this step is make an "apps" directory, like so:
$ mkdir ~/apps
$ cd ~/apps
You can skip the rest of this step if you are using your account.
Using a "kete" account
For Kete apps in production however, I think it makes sense to create an account that simply used to manage Kete instances. Unsurprisingly I have settled on a "kete" user.
So Kete apps are deployed to "/home/account_you_have_chosen/apps/your_app". The your_app bit allows the same user to manage multiple Kete sites from the same host. Let's create the user and directories we need:
If you are setting up a "kete" user, first do this for non-Mac OS X systems:
$ su # if you aren't already logged in as root
root@host: # groupadd kete
root@host: # useradd -d /home/kete -m -g kete -p kete
root@host: # passwd kete # enter kete user's password as prompted
For Mac OS X, use the System Preferences > Accounts preferences to add a new "kete" user instead.
The run the following to setup a folder that Kete will run in.
$ sudo su - kete
$ mkdir ~/apps
Now, you should give sudo rights to your kete user. The main thing is that your kete user needs to be able install gems, but the ability to also configure apache is good to have to.
On Debian, you may need to install sudo (aptitude install sudo) before granting kete sudo.
Some systems like openSUSE allow all new users to access sudo when created, so you can ignore this step. But to be sure, and for systems where sudo is limited, edit /etc/sudoers to suit by running
$ su root@host: # visudo
Add the line
kete ALL=(ALL) ALL
then type CTRL+X to close, 'Y' at the prompt to save, path /etc/sudoers, and 'Y' at the prompt to overwrite. Finally restart sudo service.
root@host: # /etc/init.d/sudo restart
You may also want to set up ssh keys for your kete user, particularly if you are going to deploy from a separate host (as in our Best Practice installation). A runthrough of the process can be found here: https://support.railsmachine.com/index.php?pg=kb.page&id=33
All User Accounts
Whichever account you use, make sure that you have the rake command in your PATH. If you have been following the installation guides recommended software (in particular, using Ruby Enterprise Edition) then you'll have already got this in your path from earlier. You can test this by running
which gem
and checking that is it coming from /opt/ruby-enterprise-1.8.x-20xxxxxx/bin/gem. If it isn't, edit your user's .bash_profile or .profile file to add that bin directory to your path.
Next step:
Aquiring Kete's Codebase