Library DIY is built on Drupal, so the basic Drupal installation will end in a working system.
-
Create a database and user account.
-
Install the software to the web server's root. This will place Library DIY in a subdirectory /diy off the web server's root. Note: Library DIY can be installed in a different location, including the site root with a minor change to the .htaccess file. Please see Appendix A for for more information.
cd /var/www/html
git clone https://github.com/pdxlibrary/Library-DIY.git diy
cd diy
git checkout master
- Configure Drupal.
a. Copy the the default settings file.
cp sites/default/default.settings.php sites/default/settings.php
b. Edit $databases (to set the database connection information) and $drupal_hash_salt.
$databases = array (
'default' =>
array (
'default' =>
array (
'database' => 'diy_db_name',
'username' => 'diy_db_user',
'password' => 'diy_db_pass',
'host' => 'db_server_name',
'port' => '',
'driver' => 'mysql',
'prefix' => '',
),
),
);
$drupal_hash_salt = 'big_long_string';
- Add the site files directory.
mkdir sites/default/files
- Set permissions on writable directories; likely needs to be performed as root or using sudo.
# Debian, Ubuntu, etc.
chown -R www-data.www-data sites/default
# RHEL, CentOS, etc.
chown -R apache.apache sites/default
- Load the initial database tables.
mysql -u diy_db_user -p diy_db_name < library-diy.mysql
- Login to the site using the default admin account
http://server-name/diy/user
user: admin
pass: yiddiy
- Adding a custom header/footer (optional)
To add a custom header/footer, edit the core template file:
\sites\all\themes\diy\page.tpl.php
Replace with custom header code:
<!-- CUSTOM HEADER GOES HERE -->
Replace with custom footer code:
<!-- CUSTOM FOOTER GOES HERE -->
View the Library DIY Wiki for tips on getting started with Library DIY.
Appendix A: Installing Library DIY in a location other than the default location
.htaccess changes – set the RewriteBase to "/" to install at the webroot or change
{subdirectory} to the path where Library DIY is installed off of the webroot.
# Modify the RewriteBase if you are using Drupal in a subdirectory or in a
# VirtualDocumentRoot and the rewrite rules are not working properly.
# For example if your site is at http://example.com/drupal uncomment and
# modify the following line:
# RewriteBase /drupal
#
# If your site is running in a VirtualDocumentRoot at http://example.com/,
# uncomment the following line:
RewriteBase /{subdirectory}
Appendix B: Common Installation Errors
- http://server-name/diy/user is inaccessible
When the admin login page is inaccessible from an Ubuntu server, the cause is typically Apache mod_rewrite hasn't been enabled.
a2enmod rewrite
service apache2 restart
- MultiViews must be enabled in Options directive, for Table of Contents (/sitemap) to work.
When using the delivered "Table of Contents" links, the Apache server must use a configuration like:
Options All MultiViews