Koel: Difference between revisions
| No edit summary |  (→Koel) | ||
| (29 intermediate revisions by the same user not shown) | |||
| Line 13: | Line 13: | ||
| __TOC__ | __TOC__ | ||
| == Basic Setup == | == Basic Setup == | ||
| ===  | <p>Install required packages</p> | ||
| <p>Install  | <syntaxhighlight lang="console">apt install nginx ffmpeg</syntaxhighlight> | ||
| <syntaxhighlight lang="console">apt install  | === PHP7.4 === | ||
| <p> | <p>Install required packages</p> | ||
| <syntaxhighlight lang="console"> | <syntaxhighlight lang="console">apt -y install lsb-release apt-transport-https ca-certificates</syntaxhighlight> | ||
| <p>Create and paste [[ | <p>Add repository</p> | ||
| <syntaxhighlight lang="console"  | <syntaxhighlight lang="console" line> | ||
| wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg | |||
| echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/php.list | |||
| </syntaxhighlight> | |||
| <p>Update packages</p> | |||
| <syntaxhighlight lang="console">apt update && apt upgrade</syntaxhighlight> | |||
| <p>Install PHP7.4</p> | |||
| <syntaxhighlight lang="console">apt install php7.4-{cli,fpm,json,common,mysql,sqlite,zip,gd,mbstring,curl,xml,bcmath,tokenizer} openssl</syntaxhighlight> | |||
| <p>Check if everything is running correctly</p> | |||
| <syntaxhighlight lang="console">systemctl status php7.4-fpm nginx</syntaxhighlight> | |||
| <p>Edit php.ini</p> | |||
| <syntaxhighlight lang="console">nano /etc/php/7.4/fpm/php.ini</syntaxhighlight> | |||
| <p>Find <code>memory_limit</code> and change it to</p> | |||
| <syntaxhighlight lang="console">memory_limit = 512M</syntaxhighlight> | |||
| <p>Find <code>upload_max_filesize</code> and change it to</p> | |||
| <syntaxhighlight lang="console">upload_max_filesize = 512M</syntaxhighlight> | |||
| <p>Find <code>post_max_size</code> and change it to</p> | |||
| <syntaxhighlight lang="console">post_max_size = 512M</syntaxhighlight> | |||
| <p>Restart php service</p> | |||
| <syntaxhighlight lang="console">systemctl restart php7.4-fpm</syntaxhighlight> | |||
| == NGINX == | |||
| <p>Remove default config file</p> | |||
| <syntaxhighlight lang="console">rm /etc/nginx/sites-enabled/default</syntaxhighlight> | |||
| <p>Create config file and paste from [[Koel.conf]]</p> | |||
| <syntaxhighlight lang="console">nano /etc/nginx/sites-available/koel.conf</syntaxhighlight> | |||
| <p>Activate configuration</p> | <p>Activate configuration</p> | ||
| <syntaxhighlight lang="console">ln -s /etc/nginx/sites-available/ | <syntaxhighlight lang="console">ln -s /etc/nginx/sites-available/koel.conf /etc/nginx/sites-enabled/</syntaxhighlight> | ||
| <p>Check if configuration is  | <p>Open nginx.conf</p> | ||
| <syntaxhighlight lang="console">nano /etc/nginx/nginx.conf</syntaxhighlight> | |||
| <p>Add following line in the <code>http</code> section to increase upload limit</p> | |||
| <syntaxhighlight lang="console">client_max_body_size 512M;</syntaxhighlight> | |||
| <p>Check if configuration is working</p> | |||
| <syntaxhighlight lang="console">nginx -t</syntaxhighlight> | <syntaxhighlight lang="console">nginx -t</syntaxhighlight> | ||
| <p>Reload  | <p>Reload nginx to apply configuration</p> | ||
| <syntaxhighlight lang="console">systemctl reload nginx.service</syntaxhighlight> | |||
| <syntaxhighlight lang="console">systemctl  | |||
| <p> | == Composer == | ||
| <p>Download install script</p> | |||
| <syntaxhighlight lang="console">php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"</syntaxhighlight> | |||
| <p>Install composer</p> | |||
| <syntaxhighlight lang="console">php composer-setup.php</syntaxhighlight> | |||
| <p>Remove script</p> | |||
| <syntaxhighlight lang="console">php -r "unlink('composer-setup.php');"</syntaxhighlight> | |||
| <p>Move composer to another path</p> | |||
| <syntaxhighlight lang="console">mv composer.phar /usr/local/bin/composer</syntaxhighlight> | |||
| == Koel == | |||
| <p>Download Koel</p> | |||
| <syntaxhighlight lang="console" line> | <syntaxhighlight lang="console" line> | ||
| cd /var/www | |||
| wget https://github.com/koel/koel/releases/download/v5.1.5/koel-v5.1.5.tar.gz | |||
| </syntaxhighlight> | </syntaxhighlight> | ||
| <p>Untar Koel</p> | |||
| <p> | <syntaxhighlight lang="console" line> | ||
| <syntaxhighlight lang="console"> | tar -zxvf koel-v5.1.5.tar.gz | ||
| rm koel-v5.1.5.tar.gz | |||
| </syntaxhighlight> | </syntaxhighlight> | ||
| <p>Create .env-file from template: [https://github.com/koel/koel/blob/master/.env.example .env.example] and add database information</p> | |||
| <p> | <syntaxhighlight lang="console" line> | ||
| <syntaxhighlight lang="console"> | cd koel | ||
| nano .env | |||
| </syntaxhighlight> | </syntaxhighlight> | ||
| <p>Find ffmpeg path with <code>whereis ffmpeg</code> for transcoding and set it</p> | |||
| <p> | |||
| <syntaxhighlight lang="console"> | <syntaxhighlight lang="console"> | ||
| FFMPEG_PATH=/usr/bin/ffmpeg | |||
| </syntaxhighlight> | </syntaxhighlight> | ||
| <p>Set following line in config for reverse proxy (not accessible via IP after setting it)</p> | |||
| <p> | <syntaxhighlight lang="console">FORCE_HTTPS=true</syntaxhighlight> | ||
| <syntaxhighlight lang="console"> | <p>Setup composer</p> | ||
| <syntaxhighlight lang="console">composer install</syntaxhighlight> | |||
| <p>Initialise Koel</p> | |||
| <syntaxhighlight lang="console">php artisan koel:init --no-assets</syntaxhighlight> | |||
| <p>Give rights to www-data user</p> | |||
| <syntaxhighlight lang="console" line> | |||
| chown -R www-data:www-data /var/www/koel | |||
| chmod -R 777 /var/www/koel/storage/ | |||
| </syntaxhighlight> | </syntaxhighlight> | ||
| <p>Default admin account:</p> | |||
| <p> | |||
| <syntaxhighlight lang="console" line> | <syntaxhighlight lang="console" line> | ||
| Username: admin@koel.dev | |||
| Password: KoelIsCool | |||
| </syntaxhighlight> | </syntaxhighlight> | ||
| <p> | == NFS-Share == | ||
| <p>Install required packages for nfs-share:</p> | |||
| <syntaxhighlight lang="console"> | <syntaxhighlight lang="console"> | ||
| apt install nfs-common nfs4-acl-tools | |||
| </syntaxhighlight> | </syntaxhighlight> | ||
| <p> | <p>Mount the nfs-share (NAS) to the data folder where all the user files will be stored</p> | ||
| <syntaxhighlight lang="console" line> | <syntaxhighlight lang="console" line> | ||
| mkdir / | mkdir /media/audio | ||
| mount -t nfs 192.168.88.5:/mnt/zpool1/Musik /media/audio | |||
| </syntaxhighlight> | </syntaxhighlight> | ||
| <p> | <p>Edit fstab to mount at boot:</p> | ||
| <syntaxhighlight lang="console"> | <syntaxhighlight lang="console"> | ||
| nano /etc/fstab | |||
| </syntaxhighlight> | </syntaxhighlight> | ||
| <p> | <p>Add following line at the end of file:</p> | ||
| <syntaxhighlight lang="console"> | <syntaxhighlight lang="console"> | ||
| 192.168.88.5:/mnt/zpool1/Musik /media/audio nfs defaults 0 0 | |||
| </syntaxhighlight> | </syntaxhighlight> | ||
| == Sources == | == Sources == | ||
| * [https:// | * [https://docs.koel.dev/#using-a-pre-compiled-archive Koel] | ||
Latest revision as of 22:16, 2 August 2021
| IP: | 192.168.88.17 | 
|---|---|
| MAC: | BE:7E:92:49:2D:AC | 
| OS: | Debian Buster | 
|---|---|
| Files: | Koel.conf | 
| RAM: | 1024MB | 
| Cores: | 1 | 
| Privileged: | Yes | 
Koel is reachable under 192.168.88.17 which is located in the ServerVLAN.
Basic Setup
Install required packages
apt install nginx ffmpeg
PHP7.4
Install required packages
apt -y install lsb-release apt-transport-https ca-certificates
Add repository
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/php.list
Update packages
apt update && apt upgrade
Install PHP7.4
apt install php7.4-{cli,fpm,json,common,mysql,sqlite,zip,gd,mbstring,curl,xml,bcmath,tokenizer} openssl
Check if everything is running correctly
systemctl status php7.4-fpm nginx
Edit php.ini
nano /etc/php/7.4/fpm/php.ini
Find memory_limit and change it to
memory_limit = 512M
Find upload_max_filesize and change it to
upload_max_filesize = 512M
Find post_max_size and change it to
post_max_size = 512M
Restart php service
systemctl restart php7.4-fpm
NGINX
Remove default config file
rm /etc/nginx/sites-enabled/default
Create config file and paste from Koel.conf
nano /etc/nginx/sites-available/koel.conf
Activate configuration
ln -s /etc/nginx/sites-available/koel.conf /etc/nginx/sites-enabled/
Open nginx.conf
nano /etc/nginx/nginx.conf
Add following line in the http section to increase upload limit
client_max_body_size 512M;
Check if configuration is working
nginx -t
Reload nginx to apply configuration
systemctl reload nginx.service
Composer
Download install script
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
Install composer
php composer-setup.php
Remove script
php -r "unlink('composer-setup.php');"
Move composer to another path
mv composer.phar /usr/local/bin/composer
Koel
Download Koel
cd /var/www
wget https://github.com/koel/koel/releases/download/v5.1.5/koel-v5.1.5.tar.gz
Untar Koel
tar -zxvf koel-v5.1.5.tar.gz
rm koel-v5.1.5.tar.gz
Create .env-file from template: .env.example and add database information
cd koel
nano .env
Find ffmpeg path with whereis ffmpeg for transcoding and set it
FFMPEG_PATH=/usr/bin/ffmpeg
Set following line in config for reverse proxy (not accessible via IP after setting it)
FORCE_HTTPS=true
Setup composer
composer install
Initialise Koel
php artisan koel:init --no-assets
Give rights to www-data user
chown -R www-data:www-data /var/www/koel
chmod -R 777 /var/www/koel/storage/
Default admin account:
Username: admin@koel.dev
Password: KoelIsCool
Install required packages for nfs-share:
apt install nfs-common nfs4-acl-tools
Mount the nfs-share (NAS) to the data folder where all the user files will be stored
mkdir /media/audio
mount -t nfs 192.168.88.5:/mnt/zpool1/Musik /media/audio
Edit fstab to mount at boot:
nano /etc/fstab
Add following line at the end of file:
192.168.88.5:/mnt/zpool1/Musik /media/audio nfs defaults 0 0


