Thursday, September 10, 2015

Install of Omeka on XAMPP

OS: Windows 7 x64
XAMPP: v 3.2.1
Omeka: v 2.3.1

The instructions for Omeka install assume a linux server but we are installing on a windows machine using XAMPP so the install is somewhat different but similar to all 'amp' applications.

Get Omeka

We download the latest version from http://omeka.org/download/. The release notes are here. We unzip the omeka-2.3.1 archive to an omeka folder at the root level of the XAMPP web server which is located at /xampp/htdocs

You have to be careful - windows native unarchiving tends to create a folder inside a folder, you need to have an omeka folder under htdocs containing the files. (7zip is a better option).


Create Omeka Database

All 'amp' apps store data in a database. So we need to create a mySQL database for omeka. This can be done using a mySQL client to connect to the mySQL server, or thru a web app like phpMyAdmin.

  1. Navigate to /xampp/xampp-control.exe and double-click to run the control panel
  2. Start the mySQL database server and the Apache web server
  3. Click on the phpMyAdmin link
  4. Click the Databases Tab
  5. Create an omeka_db database with collation of utf8_unicode_ci

NOTE: we originally named the database omeka but we noticed the Omeka documentation refers to it as omeka_db (we feel the db is redundant but...) so we redid is as omeka_db and we recommend you do as well. This database will be used by the Omeka app.

Create Omeka User

Every database needs a user so we have to create one for the Omeka app (so it can be installed) and this will user account can be used by the app to create additional users inside the application.
Note: The Linux instructions from Omeka use the mysqladmin client to set up the database.

  1. Click the SQL tab
  2. Enter the following SQL statements:

    insert into user(host, user, password)
    values('localhost','omeka_user',password('zx8180'));

    insert into db(host,db,user,Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv)
    values ('localhost','omeka_db','omeka_user','Y','Y','Y','Y','Y','Y');
  3. Click GO to execute the SQL


One thing i noted about this statement is the omeka user sql does not set up privileges for connecting. By default it should be able to connect only from localhost. Normally when setting up users who have to have access from all locations we would do something like:

use mysql;
grant all privileges on omeka_db 
to 'omeka_user'@'%' identified by 'zx8180';

And when setting up a user you want to refresh/reload the database so the client picks up the changes. The easiest way to do this in XAMPP would be to STOP and then START the mySQL server. We forgot to do this step which may be the reason for the problem noted later on....

Configure Apache Web Server

  1. Navigate to /xampp/apache/conf/
  2. Right-click http.conf and open in a text editor or use notepad if you must
  3. Change the default setting in lines 222-229 to be:


    AllowOverride All
    Allow from all
    Order allow,deny

Now save the file.

Note: the ServerRoot directive is hard-coded, for example: ServerRoot "I:/xampp/apache" so this would have to be changed if later you copy the xampp folder from current drive to another
location. Also hard coded is DocumentRoot.

Set File Permissions

The Linux instructions note that the apache user must have rights to the omeka folder. This is because many linux apps create a user account in the OS that has rights only to specific items or functions, a much more secure approach than Windows with its administrator account.

  1. Navigate to  /xampp/htdocs
  2. Right-click on the omeka folder
  3. I set the properties not to be read-only

Not sure this step is even required...

Set Omeka Database Configuration

This ini file is used by the app to find its database so it must match exactly what you set up in mySQL.

  1. Navigate to /xampp/htdocs/omeka/
  2. Right-click on db.ini and edit with a text editor or notepad
  3. Add the exact values for the database that you set up earlier

[database]
host     = "localhost"
username = "omeka_user"
password = "zx8180"
dbname   = "omeka_db"
prefix   = "omeka_"
charset  = "utf8"
port     = ""

Select file,save and save the file.

Note: by leaving the port value empty it uses the default port 80. If you are running on a non-standard port you will want to change this.

Run the Omeka Installer

To install an 'amp' app, you go to its install web page, which usually runs some php scripts.

Run a web browser and go to http://localhost/omeka/install

The first time i did this i got the mySQL error message:

"Access denied for user 'omeka_user'@'localhost' (using password: YES)"

It may be that because i did not refresh the database tables?  The error message indicates that user does not have privileges to the database from localhost. We could go back to SQL and issue a statement like this:

use mysql;
grant all privileges on omeka_db 
to 'omeka_user'@'%' identified by 'zx8180';

but we can also use phpMyAdmin. 
  1. Go back to phpmyadmin 
  2. Click the users tab and slect the omeka_user@localhost entry
  3. CHECK ALL and click GO
Normally you would not do this! But we are lazy. The privileges needed by omeka_user are not extensive.


We need to research this - when we install on OSX we can do it a little differently.
  1. Use the xampp control panel to STOP and then START the mySQL server
  2. Go to http://localhost/omeka/install and you should see the install page
 

Add an admin user and password. The admin account can access the back-end or dashboard of Omeka.

Note: PHP does not have the fileinfo module loaded and thus the installer will
disable file upload validation. Research how to set this up in php before running the installer.

We accept the defaults for most of the setting. Note it asks for the ImageMagick path so we should install that before installing omeka, although we assume we can later edit the Omeka configuration to add the path.

Click INSTALL and if ok the success page is displayed
Navigate to /xampp/htdocs/omeka and delete the install folder


You can now check out the default public site that users see, or log into the back-end as the admin user.




You now have omeka running but is only accessible from localhost, the machine you are on.

6 comments:

Zinavo-Web Design | Web Development | SEO | Mobile Apps | ERP/CRM said...

Really this is the very informal for me. Keep more share your updates. Website Designing Company Bangalore | Web Development Company Bangalore

Unknown said...

Great share...For best and cheap manual Seo services, Web designings. Must check Web Design Bangalore

Ancy merina said...
This comment has been removed by the author.
GreenfieldCoimbatore said...

Hey! You Done Good Job, Keep on posting!
Plots in Coimbatore
Lands in Coimbatore

Haappy Herbs By Shrutika said...

Hey! This blog is more informative and user friendly

Thank you so much for giving this information to me..
best acne spot removal cream
herbal products online shopping

Haappy Herbs By Shrutika said...
This comment has been removed by the author.