Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thanks, works great! 2 minor setup things #164

Open
twuttke opened this issue Dec 23, 2017 · 4 comments
Open

Thanks, works great! 2 minor setup things #164

twuttke opened this issue Dec 23, 2017 · 4 comments

Comments

@twuttke
Copy link

twuttke commented Dec 23, 2017

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

~
~

@DavidRGriswold
Copy link

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.

@funkho
Copy link

funkho commented Mar 28, 2018

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

@crow-ua
Copy link

crow-ua commented Jun 29, 2018

@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?

@twuttke
Copy link
Author

twuttke commented Jun 29, 2018

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

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants