Skip to content
This repository has been archived by the owner on Mar 18, 2019. It is now read-only.

Installation

Abhiroop Bhatnagar edited this page Aug 15, 2013 · 2 revisions

About this guide

These instructions focus on installing open311-sms on a *nix machine with the Apache webserver. If you are installing on Windows using IIS, you will need to do the equivalent steps for your environment.

Downloading

You can checkout the latest copy of the source code with the command:

git clone https://github.com/City-of-Bloomington/open311-sms.git

Moving into place

You can move the open311-sms directory anywhere accessible by Apache. We'll be editing Apache's configuration to tell it where we've put the application.

Apache will need read permissions for the application and write permissions for the data directory inside the application. The easiest thing to do is just give Apache ownership of the application.

chown -R apache open311-sms

Apache Configuration

We need to tell Apache where the application is and set up the URL to host it. We also need to set up the mod_rewrite rules to route all traffic to index.php.

Example configuration:

#-------------------------------------------------------------------------
# This Virtual Host config is intended to redirect all traffic from
# the unencrypted versions of the application to the encrypted version
#-------------------------------------------------------------------------
NameVirtualHost *:80
<VirtualHost *:80>
	Redirect /crm https://localhost/open311-sms
</VirtualHost*>
#------------------------------------------------------------------------
# Citizen reporting and work tracking system
#------------------------------------------------------------------------
Alias /crm "/var/www/sites/open311-sms/public"
<Directory "/var/www/sites/open311-sms/public">
    Options FollowSymLinks
    AllowOverride None
    Require all granted


    RewriteEngine On
    RewriteBase /open311-sms
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
	RewriteCond %{REQUEST_URI} !/media/[0-9]{4}
    RewriteRule .? /open311-sms/index.php [NC,L]

</Directory>

MySQL setup

You will need to create a database for Open311-SMS. It's safest to create a user just for this database. In MySQL, here's how to create a database, called "open311-sms". We can also create a user with a username of "open311-sms" and create a password for that user.

create database open311sms;
grant all privileges on open311sms.* to open311sms@localhost identified by 'somepassword';
flush privileges;

The database is now created, but it is still empty. We need to create all the tables needed inside the database, and load those tables with some initial data. In /scripts is a mysql.sql that will do just that. We can use the mysql command line to load this script.

cd /scripts
mysql -p open311sms < mysql.sql

Open311-SMS configuration

Open311-SMS comes with an empty configuration file called configuration.inc.default. The default file must be copied and the new file given the correct name, configuration.inc. You will need to run through the new configuration.inc and provide values for all the settings listed.

Verify installation

At this point, you should have the application installed on the webserver. With the configuration.inc in place, you should be able see the application in your browser. Point your browser to whatever URL you chose in your Apache configuration and make sure the page loads with no errors.

Create an Administrator account

At this point the application is completely empty and ready to start using. The rest of the setup will continue in the browser at your new site. However, you need to create the initial user account for you to log in with. This will need to be an Administrator account so it has permission to do all the rest of the setup. More administrators can be created as needed using the web interface.

In your application install directory is a PHP script that can create user accounts.

include '../configuration.inc';

$person = new Person();

// Fill these out as needed
$person->setFirstname('Admin');
$person->setLastname('Person');
$person->setEmail('admin@localhost');
$person->setUsername('administrator');
$person->setAuthenticationMethod('local');
$person->setPassword('');

// No more changes needed
$person->setRole('Administrator');
$person->save();

Once it's been modified, you'll need to run it from the command line.

php scripts/createAdminUser.php

Once the createAdminUser.php script has been run, you should be able to log into the site using the account information you just created.