Installation instructions for the Offers web application.
- php >= 5.3.x
- mysql >= 5.1.x (also tested with MariaDB >= 5.2.x)
- python-sphinx (to build documentation)
- git (to clone directly from the repository)
Required php modules:
- gd
- ldap
- mysql-pdo
- openssl
- soap
Get the source code from the git repository (clone) or a release tag. Also, the CakePHP bootstrap-helper is required, see Deploy on how to download it as a git submodule or from a relsease tag.
Repositories:
- Offers (coupons.git - also contains CakePHP framework)
- Offers documentation (coupons-docs.git)
- CakePHP framework
- CakePHP bootstrap-helper
Application setup:
- List of required configuration files and a list of the most important options.
- Permissions.
- Git submodules.
Rename each *.php.default
file to *.php
and edit accordingly if required.
- bootstrap.php.default
configuration.php.default
APP_URL
: set the application url (eg: http://offers.teiath.gr) no trailing slash here.ISSUE_URL
: redmine urlISSUE_TOKEN
: redmine's user access tokenISSUE_PROJECT_ID
: redmine project id to post issues to (project must have an issue tracker).ADMIN_EMAIL
: email for application's administratorMAX_OFFER_IMAGES
: maximum number of images allowed in offers.MAX_COMPANY_IMAGES
: maximum number of images allowed in company profile.
core.php.default
- contains salt and hash algorithm settings - keep it safe.
database.php.default
- database settings - set database name/credentials
encoding
: set toutf8
.
email.php.default
- configure application email address / email charset etc
ldap.php.default
- LDAP settings - set ldap credentials here
- if using LDAP with SSL remember that the
port
should remain empty and all parameters should be in theserver
directive in a form of url. eg:ldaps://foo.com:port
. See: ldap_connect().
The following folders must be writable from the http
user (or the relevant user that run the webserver).:
app
|-- tmp
|-- cache
| |-- models
| |-- persistent
| `-- views
`-- logs
The application's front-end uses Twitter's Bootstrap through a CakePHP helper. This helper is not optional. It resides inside the plugins
folder found in the project's root directory as a git submodule. In order to fetch the helper, after the first clone run: :
$ git submodule init
$ git submodule update
To keep up-to-date run: :
$ git submodule foreach git pull
Note that this will fetch any other posible git submodules used by the application. See the project's .gitmodules file for more information.
Database setup:
- From command line
- From PHPMyAdmin
Run the setup script found in schema/reset-db.sh
and provide the root username/password for your database when prompted. The database scripts assume you have the right to create databases. The default database created is named opendeals
.
- import
opendeals.sql
- import
days.sql
- import
counties.csv
, skiping the 1st row - import
municipalities.csv
skipping the 1st row and re-arranging columns properly - import
offercategories.sql
new_offers.sh
- notify users for new offers
- run:
once / day
a little after00:00
.
notify_improper.sh
- notify users for offers marked as spam (only if user has related coupons)
- run every:
6 hours
.
remove_old_visits.sh
- cleanup old status
- run every:
3 days
or longer.
update_state.sh
- check offer end time and mark finished offers as "finished"
- run at least every:
15 min
.
update_total_stats.sh
- calculate total stats for previous day
- run:
once / day
a little after00:00
.