-
-
Notifications
You must be signed in to change notification settings - Fork 270
Installation (feature elasticsearch)
Irfan edited this page Apr 10, 2022
·
4 revisions
⚠ DO NOT use this guide. This is for the feature/elasticsearch branch only which is currently under development.
Not available.
ℹ This installation guide is for Jikan REST API v4 only.
-
- Does not require a self-managed installation, you can connect to a cloud-managed MongoDB instance as well
-
- Does not require a self-managed installation, you can connect to a cloud-managed Elasticsearch instance as well
-
Apache (optional)
✅ Tested with Ubuntu 20
- Install Git and build-essentials for compiling the PHP MongoDB Driver
sudo apt install git build-essential
- Install PHP 8.0
- Install Required PHP 8.0 dependencies
sudo apt install php8.0-{xml,mbstring,common,curl,pear}
- Note:
pear
will install PECL for you
- Install PHP MongoDB Driver
sudo pecl install mongodb
- Add
extension=mongodb.so
to yourphp.ini
(On Ubuntu 20 it will be in/etc/php/8.0/
)
- Clone the repo in
/var/www
git clone https://github.com/jikan-me/jikan-rest.git
- Jikan REST API v4 will now be in
/var/www/jikan-rest
- Change Directory:
cd jikan-rest
- If you haven't installed Composer 2 yet, now's the time
- Make sure you have appropriate write permissions for
/var/www/jikan-rest
- Install Jikan REST API v4 dependencies
-
composer install
(If you have Composer installed Globally. php path/to/composer.phar install
-
- Copy Environment variables
-
cp .env.dist .env
(Read: Configuring your Jikan REST API v4 Instance)
-
- Run Database Migrations with
php artisan migrate
- Enable the scheduler by adding it to
corntab -e
* * * * * cd /var/www/jikan-rest && php artisan schedule:run >> /dev/null 2>&1
- You can modify the scheduler here
- For Development purposes, you can use PHP's own built-in webserver
- Run the following in
/var/www/jikan-rest
:php artisan serve
(Read: Artisan Commands)
- Run the following in
You can use Apache to host the Jikan REST API (it's what I use personally too)
sudo apt install apache2
- Set
AllowOverride All
in/etc/apache2/apache2.conf
inside<Directory /var/www/>
- Edit your virtual host document root
- By default it's in
/etc/apache2/sites-available/000-default.conf
:DocumentRoot /var/www/jikan-rest/public
- If you have other sites, you can set up a different virtual host (Learn More)
- By default it's in
- Enable Mod Rewrite and Mod Deflate (for GZIP'd responses)
sudo a2enmod deflate && sudo a2enmod rewrite
- Restart the Apache server
sudo service apache2 restart
Your very own Jikan REST API v4 is now good to go!
- Tune into http://localhost/v4
to access the API
- ℹ️ If you wish to configure it for Nginx or anything else, you'll have to port the rewrite rules located at
public/.htaccess
https://github.com/jikan-me/jikan-rest/wiki/Configuration
Please read the troubleshooting guide. For any additional help, join our Discord server.
Please read the commands guide. For any additional help, join our Discord server.
If you don't want to host your instance, there's a public API available.
See the list of wrappers here