milaq / YCast

Self hosted vTuner internet radio service emulation
Other
244 stars 93 forks source link

Add deployment example using FastCGI server and lighttpd #68

Open yay6 opened 3 years ago

yay6 commented 3 years ago

lighttpd.conf file stub and minimal FastCGI server file

Essoloani commented 3 years ago

In my first attempts, YCast was served on the local IP of the pi, on port 8010. With this setup I had to wait about 2 minutes after each pi boot for YCast to run. By staying on port 80 I see that YCast is executed instantly when PI starts up. Out of curiosity, what is the point of using FastCGI? Nevertheless I practiced doing the deployment by FastCGI. How do I check that I have succeeded? YCast continues to work very well. No error message by doing: cat /var/log/lighttpd/error.log

Essoloani commented 3 years ago

My application:

!/usr/bin/python3

Path to cloned YCast repository

PATH_YCAST = '/usr/local/lib/python3.7/dist-packages'

Path to my stations file

PATH_MY_STATIONS = '/var/www/ycast/stations.yml'

import sys sys.path.insert(0, PATH_YCAST)

from flup.server.fcgi import WSGIServer from ycast import server

if name == 'main': server.check_my_stations_feature(PATH_MY_STATIONS) WSGIServer(server.app).run()

Essoloani commented 3 years ago

My server:

Using FastCGI server for Ycast

$HTTP["host"] =~ ".(radiosetup|vtuner).com" { fastcgi.server = ( "/" => (( "socket" => "/tmp/ycast-fcgi.sock", "bin-path" => "/var/www/ycast/ycast.fcgi", "check-local" => "disable", "max-procs" => 1, "fix-root-scriptname" => "enable", )) ) }