geemusic icon indicating copy to clipboard operation
geemusic copied to clipboard

Thanks, works great! 2 minor setup things

Open twuttke opened this issue 7 years ago • 4 comments

I installed on to a fresh Ubuntu 16.04 LTS. While it did come python 3.5.2, it defaults to python 2.7.12, so when I run

virtualenv .venv

it didn't seem like it was virtualizing the python3 environment.

I did this instead, and it seemed to work better:

virtualenv .venv -p `which python3`

Also, when I got to the part about using foreman, I didn't really want to install ruby and all that stuff just to start a process. What I really wanted was a simple way to add a service description to start at boot time. Ubuntu >= 15 uses systemd, so this worked:

Create a file

sudo vim /etc/systemd/system/geemusic.service

And fill it with something like this (replace myusername, and any other paths that look wrong)

[Unit]
Description=Geemusic Service
After=network.target

[Service]
Type=simple
User=myusername
EnvironmentFile=/home/myusername/geemusic/.env
WorkingDirectory=/home/myusername/geemusic/
ExecStart=/home/myusername/geemusic/.venv/bin/python3 /home/myusername/geemusic/server.py
Restart=on-abort

[Install]
WantedBy=multi-user.target

Then, run these

sudo systemctl enable geemusic.service
sudo systemctl daemon-reload
sudo systemctl start geemusic.service

Anyway, thanks again. Feel free to use or ignore any of these suggestions. I'm no expert, so there is likely better ways to do it than what I did.

-- Tom

~ ~

twuttke avatar Dec 23 '17 08:12 twuttke

Big thumbs up to this! Adding this to the docs could be very helpful. I initially set up a docker container but after finding this it is a much better solution with less overhead and setup time.

The app works great.

DavidRGriswold avatar Feb 13 '18 23:02 DavidRGriswold

This was very helpful for me as well. Thanks for this.

funkho avatar Mar 28 '18 04:03 funkho

@twuttke Works for me as well, but it spawns a server via http protocol. Is it possible to spin up https without foreman as well?

crow-ua avatar Jun 29 '18 06:06 crow-ua

Not sure if you can do https directly like that or not. I was already running an apache2 instance for my general purpose external facing HTTPS server on that box. I use a free cert got from letsencrypt. I proxypass any requests to /alexa to the local http server on port 4000. My config snippet looks like this:

` <VirtualHost *:443> ProxyPass /alexa http://127.0.0.1:4000/alexa ProxyPassReverse /alexa http://127.0.0.1:4000/alexa

SSLCertificateFile /etc/letsencrypt/live/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/privkey.pem Include /etc/letsencrypt/options-ssl-apache.conf </VirtualHost> `

twuttke avatar Jun 29 '18 07:06 twuttke