tyohan / pemiluAPI

2014 Pemilu API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pemiluAPI

Build Status

2014 Pemilu API

Installation

The steps below assume you are working on a Ubuntu machine.

Apache2 and PHP5

  1. Install Apache2

    $ sudo apt-get install -y apache2
  2. Enable mod_rewrite and mod_headers

    $ sudo a2enmod rewrite
    $ sudo a2enmod headers
    $ sudo service apache2 restart
  3. Install PHP5

    $ sudo apt-get install -y php5 libapache2-mod-php5 php5-cli php5-curl

    For Ubuntu Saucy or above (>= 13.10), also install the following package:

    $ sudo apt-get install php5-json

Application

  1. Install Git

    $ sudo apt-get install -y git
  2. Clone this project

    $ git clone https://github.com/pemiluAPI/pemiluAPI.git
  3. Go to the project directory and dowload Composer

    $ cd pemiluAPI
    $ wget http://getcomposer.org/composer.phar
  4. Install the framework's dependencies

    $ php composer.phar install
  5. Set the web directory as the DocumentRoot. Modify the /etc/apache2/sites-available/default file as follow

    DocumentRoot /var/www/pemiluAPI/web
    <Directory /var/www/pemiluAPI/web>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride all
        Order allow,deny
        allow from all
    </Directory>
    

    Please note that your modification need may vary depending on your Apache2 setup.

  6. Restart Apache2

    $ sudo service apache2 restart
  7. Open up http://127.0.0.1/status and you should see message

    {"error":{"type":"invalid_request_error"}}
    
  8. Open up http://127.0.0.1 and you should see

    {"error":{"message":"Unrecognized request URL (GET: \/).  Please see http:\/\/developer.pemiluapi.org\/.","type":"invalid_request_error"}}
    

About

2014 Pemilu API