项目作者: inab

项目描述 :
iPC Catalogue outbox REST API
高级语言: PHP
项目地址: git://github.com/inab/iPC-Catalogue-outbox-api.git
创建时间: 2020-08-17T14:04:51Z
项目社区:https://github.com/inab/iPC-Catalogue-outbox-api

开源协议:

下载


iPC Catalogue Outbox api

Dependencies

  • Web server (e.g. Apache2 Nginx)
  • PHP and composer
  • MongoDB

Usage

Installation

1. Clone the repository
2. Install 3rd party modules:

Use composer to install the PHP libraries required to run the application

  1. composer update

Install PHP extension for CURL
apt install php-curl
systemctl restart apache2.service

Install MongoDB PHP extension (https://docs.mongodb.com/php-library/current/tutorial/install-php-library/)

  1. apt install php-dev
  2. pecl install mongodb
  3. echo "extension=mongodb.so" >> /etc/php/7.2/apache2/php.ini
  4. composer require mongodb/mongodb
  5. systemctl restart apache2.service
3. Create log file:

Create and empty file that the application is going to use as log file. Make sure that the UNIX user of the web server has write permissions:

  1. touch logs/app.log
  2. chmod 777 logs/app.log
4. Configure web access:

The web server (e.g. Apache2 or Nginx) is to be set so that the public/ folder of the application is accessible from the internet. In the following example, the DocumentRoot of an Apache2 server is pointing to the installation path :

  1. <VirtualHost *:80>
  2. ServerName my.site.es
  3. ServerAdmin webmaster@localhost
  4. DocumentRoot /var/www/html
  5. Alias "/catalogue_outbox/api/" "/path-to-api/public/"
  6. <Directory "/path-to-api/public/">
  7. Options Indexes FollowSymLinks
  8. AllowOverride All
  9. Require all granted
  10. </Directory>
  11. ErrorLog ${APACHE_LOG_DIR}/error.log
  12. CustomLog ${APACHE_LOG_DIR}/access.log combined
  13. </VirtualHost>
  1. sudo systemctl restart apache2
4.Configure application:

Configure all the particulars of the installation at app/settings.php. Take as template the following file:

  1. cp app/settings.php.sample app/settings.php

Configure the following key parameters:

  • settings.logger : Configure the log module
  • settings.db: Configure the connection with the Mongo database
  • globals.dataDir: Path to the api data folder (userdata).
  • globals.api: OAuth2 endpoints of the OIDC authentication server