2014 Pemilu API
The steps below assume you are working on a Ubuntu machine.
-
Install Apache2
$ sudo apt-get install -y apache2
-
Enable
mod_rewrite$ sudo a2enmod rewrite $ sudo service apache2 restart
-
Install PHP5
$ sudo apt-get install -y php5 libapache2-mod-php5 php5-cli php5-curl
-
Install Git
$ sudo apt-get install -y git
-
Clone this project
$ git clone https://github.com/pemiluAPI/pemiluAPI.git
-
Go to the project directory and dowload Composer
$ cd pemiluAPI $ wget http://getcomposer.org/composer.phar -
Install the framework's dependencies
$ php composer.phar install
-
Set the
webdirectory as theDocumentRoot. Modify the/etc/apache2/sites-available/defaultfile as followDocumentRoot /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.
-
Restart Apache2
$ sudo service apache2 restart
-
Open up http://127.0.0.1/status and you should see message
{"error":{"type":"invalid_request_error"}} -
Open up http://127.0.0.1 and you should see
{"error":{"message":"Unrecognized request URL (GET: \/). Please see http:\/\/docs.pemiluapi.org\/.","type":"invalid_request_error"}}