Tuesday, September 15, 2015

Omeka 2.3.1 install on native Ubuntu 14.04 LTS



 Sources:


 Background:

This documentation details my install procedure of a LAMP stack and Omeka 2.3.1. It does not cover certain steps (like installing Unzip) which are seen in other guides because these packages were already installed on my machine.

There were 5 major steps:
  1.  Set up LAMP stack and ImageMagick
  2.  Download and install Omeka
  3. Set-up web user and permissions
  4. Create and modify database
  5.   Enable mod_rewrite (worst part)

Step 1- Set up LAMP stack and ImageMagick


1.Install PHP5:
sudo apt-get install php5

2.Install PHP-MySQL:
sudo apt-get install php5-mysql

3.Install Apache2:
sudo apt-get install apache2

4.Install MySQL server:
sudo apt-get install mysql-server

5. Install ImageMagick (image software used by Omeka):
sudo apt-get install imagemagick


To test go to your IP
(see image)


Step 2- Download and install Omeka


6. Download Omeka to home directory:
cd

wget http://omeka.org/files/omeka-2.3.1.zip

unzip omeka-2.3.1.zip

7. Move unzipped files to web directory
sudo mv omeka-2.3.1/* /var/www/

sudo mv omeka-2.3.1/.htaccess /var/www/

8. If there is an old index.html file in www remove it:
sudo rm /var/www/index.html



Step 3- Set up web user and permissions


9. Create a web group and user:
sudo groupadd webdev

sudo usermod -a -G webdev your_ubuntu_username

cd /var

sudo chown -R root.webdev www 

10. Give the newly created user permissions to directories needed:
sudo chmod 775 www

cd /var/www 

sudo find . -type d | xargs sudo chmod 775

sudo find . -type f | xargs sudo chmod 664

sudo find files -type d | xargs sudo chmod 777

sudo find files -type f | xargs sudo chmod 666



Step 4- Create and modify database


11. Open MySQL from appropriate location
mysql -u root -p

12. Create the database (keep ‘’ punctuation)
create database omeka;

grant all privileges on omeka.* to 'username from step 9'@'localhost'     identified by 'insertpasswordhere';

flush privileges;

quit;

13. Open db.ini in terminal to modify
sudo nano /var/www/db.ini

14.  Adjust values to reflect newly created settings from step 12 and save file.
[database]

host = "localhost"

username = "username"

password = "password"

dbname = "omeka"

prefix = "omeka_"



Step 5- Enable mod_rewrite in for Apache


15. Enable mod_rewrite and restart the server:
sudo a2enmod rewrite

sudo service apache2 restart

16. Open apache2.conf file in gedit (easier to see than if in nano)
sudo gedit /etc/apache2/apache2.conf 

17. Modify apache2.conf (append to the end of the file), then save and close
ServerName localhost

# Enable mod_rewrite

<IfModule mod_rewrite.c>

RewriteEngine On

</IfModule>

18. Open 000-default.conf file in gedit
sudo gedit /etc/apache2/sites-available/000-default.conf 

17. Modify 000-default.conf (append below line DocumentRoot /var/www), then save and close
<Directory ”/var/www/html”>

AllowOverride All

</Directory>

18. Restart server
sudo service apache2 restart


To test: localhost/admin/users/login/

If you see the following, you know you have a problem (check out the support forums)
Different people have solved it different ways, depending on their system:













If you see the following, you know you have succeeded:


1 comment:

gnickers said...

Install of Omeka on Linux Mint 17.1 32bit xfce

Run terminal
sudo apt-get install php5
sudo apt-get install php5-mysql
sudo apt-get install apache2
sudo apt-get install mysql-server
/* set root password to zx8180 */
sudo apt-get install imagemagick
run web browser and go to http://localhost
and the Apache 2 Ubuntu default page is displayed
wget http://omeka.org/files/omeka-2.3.1.zip
unzip omeka-2.3.1.zip
sudo mv omeka-2.3.1/* /var/www
sudo groupadd webdev
sudo usermod -a -G webdev lee
cd /var
sudo chown -R root.webdev www
sudo chmod 775 www
cd /var/www
sudo find . -type d | xargs sudo chmod 775
sudo find . -type f | xargs sudo chmod 664
sudo find files -type d | xargs sudo chmod 777
sudo find files -type f | xargs sudo chmod 666

/* this is where it generates error messages */

/var/lib/sudo writable from non-owner, should be mode 0700
Unable to execute /bin/chmod: argument list too long
Chmod missing operand after '777'

mysql -u root -p
create database omeka;
grant all privileges on omeka.* to 'lee'@'localhost'
identified by 'zx8180';
flush privileges;
quit;
------------------- edit db.ini ---------------
host = "localhost"
username = "lee"
password = "zx8180"
dbname = "omeka"
prefix = "omeka_"

sudo a2enmod rewrite
sudo service apache2 restart

*/ the restart FAILS error msgs */

/var/lib/sudo writable by non-owner, should be mode 0700

*/ we are dead at this point - continued on but no joy */