{"html_url": "https://github.com/simonw/datasette/issues/514#issuecomment-539721880", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/514", "id": 539721880, "node_id": "MDEyOklzc3VlQ29tbWVudDUzOTcyMTg4MA==", "user": {"value": 319156, "label": "ipmb"}, "created_at": "2019-10-08T22:00:03Z", "updated_at": "2019-10-08T22:00:03Z", "author_association": "NONE", "body": "If you are just using Nginx to open a reserved port, systemd can do that on its own. https://www.freedesktop.org/software/systemd/man/systemd.socket.html. ", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 459397625, "label": "Documentation with recommendations on running Datasette in production without using Docker"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/514#issuecomment-509431603", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/514", "id": 509431603, "node_id": "MDEyOklzc3VlQ29tbWVudDUwOTQzMTYwMw==", "user": {"value": 7936571, "label": "chrismp"}, "created_at": "2019-07-08T23:39:52Z", "updated_at": "2019-07-08T23:39:52Z", "author_association": "NONE", "body": "In `datasette.service`, I edited\r\n\r\n```\r\nUser=chris\r\n```\r\n\r\nTo...\r\n\r\n```\r\nUser=root\r\n```\r\n\r\nIt worked. I can access `http://my-server.com`. I hope this is safe. Thanks for all the help, everyone.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 459397625, "label": "Documentation with recommendations on running Datasette in production without using Docker"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/514#issuecomment-509154312", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/514", "id": 509154312, "node_id": "MDEyOklzc3VlQ29tbWVudDUwOTE1NDMxMg==", "user": {"value": 4363711, "label": "JesperTreetop"}, "created_at": "2019-07-08T09:36:25Z", "updated_at": "2019-07-08T09:40:33Z", "author_association": "NONE", "body": "@chrismp: Ports 1024 and under are privileged and can usually only be bound by a root or supervisor user, so it makes sense if you're running as the user `chris` that port 8000 works but 80 doesn't.\r\n\r\nSee [this generic question-and-answer](https://superuser.com/questions/710253/allow-non-root-process-to-bind-to-port-80-and-443) and [this systemd question-and-answer](https://stackoverflow.com/questions/40865775/linux-systemd-service-on-port-80) for more information about ways to skin this cat. Without knowing your specific circumstances, either extending those privileges to that service/executable/user, proxying them through something like nginx or indeed looking at what the nginx systemd job has to do to listen at port 80 all sound like good ways to start.\r\n\r\nAt this point, this is more generic systemd/Linux support than a Datasette issue, which is why a complete rando like me is able to contribute anything. ", "reactions": "{\"total_count\": 1, \"+1\": 1, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 459397625, "label": "Documentation with recommendations on running Datasette in production without using Docker"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/514#issuecomment-505232675", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/514", "id": 505232675, "node_id": "MDEyOklzc3VlQ29tbWVudDUwNTIzMjY3NQ==", "user": {"value": 7936571, "label": "chrismp"}, "created_at": "2019-06-25T00:43:12Z", "updated_at": "2019-06-25T00:43:12Z", "author_association": "NONE", "body": "Yep, that worked to get the site up and running at `my-server.com:8000` but when I edited `run-datasette.sh` to contain this...\r\n\r\n```\r\n#!/bin/bash\r\n/home/chris/Env/datasette/bin/datasette serve -h 0.0.0.0 -p 80 /home/chris/digital-library/databases/*.db --cors --metadata /home/chris/digital-library/metadata.json\r\n```\r\n\r\nI got this error.\r\n\r\n```\r\nJun 25 02:42:41 ns331247 run-datasette.sh[747]: [2019-06-25 02:42:41 +0200] [752] [INFO] Goin' Fast @ http://0.0.0.0:80\r\nJun 25 02:42:41 ns331247 run-datasette.sh[747]: [2019-06-25 02:42:41 +0200] [752] [ERROR] Unable to start server\r\nJun 25 02:42:41 ns331247 run-datasette.sh[747]: Traceback (most recent call last):\r\nJun 25 02:42:41 ns331247 run-datasette.sh[747]: File \"uvloop/loop.pyx\", line 1111, in uvloop.loop.Loop._create_server\r\nJun 25 02:42:41 ns331247 run-datasette.sh[747]: File \"uvloop/handles/tcp.pyx\", line 89, in uvloop.loop.TCPServer.bind\r\nJun 25 02:42:41 ns331247 run-datasette.sh[747]: File \"uvloop/handles/streamserver.pyx\", line 95, in uvloop.loop.UVStreamServer._fatal_error\r\nJun 25 02:42:41 ns331247 run-datasette.sh[747]: File \"uvloop/handles/tcp.pyx\", line 87, in uvloop.loop.TCPServer.bind\r\nJun 25 02:42:41 ns331247 run-datasette.sh[747]: File \"uvloop/handles/tcp.pyx\", line 26, in uvloop.loop.__tcp_bind\r\nJun 25 02:42:41 ns331247 run-datasette.sh[747]: PermissionError: [Errno 13] Permission denied\r\nJun 25 02:42:41 ns331247 run-datasette.sh[747]: During handling of the above exception, another exception occurred:\r\nJun 25 02:42:41 ns331247 run-datasette.sh[747]: Traceback (most recent call last):\r\nJun 25 02:42:41 ns331247 run-datasette.sh[747]: File \"/home/chris/Env/datasette/lib/python3.7/site-packages/sanic/server.py\", line 591, in serve\r\nJun 25 02:42:41 ns331247 run-datasette.sh[747]: http_server = loop.run_until_complete(server_coroutine)\r\nJun 25 02:42:41 ns331247 run-datasette.sh[747]: File \"uvloop/loop.pyx\", line 1451, in uvloop.loop.Loop.run_until_complete\r\nJun 25 02:42:41 ns331247 run-datasette.sh[747]: File \"uvloop/loop.pyx\", line 1684, in create_server\r\nJun 25 02:42:41 ns331247 run-datasette.sh[747]: File \"uvloop/loop.pyx\", line 1116, in uvloop.loop.Loop._create_server\r\nJun 25 02:42:41 ns331247 run-datasette.sh[747]: PermissionError: [Errno 13] error while attempting to bind on address ('0.0.0.0', 80): permission denied\r\nJun 25 02:42:41 ns331247 run-datasette.sh[747]: [2019-06-25 02:42:41 +0200] [752] [INFO] Server Stopped\r\n```\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 459397625, "label": "Documentation with recommendations on running Datasette in production without using Docker"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/514#issuecomment-504998302", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/514", "id": 504998302, "node_id": "MDEyOklzc3VlQ29tbWVudDUwNDk5ODMwMg==", "user": {"value": 7936571, "label": "chrismp"}, "created_at": "2019-06-24T12:57:19Z", "updated_at": "2019-06-24T12:57:19Z", "author_association": "NONE", "body": "Same error when I used the full path.\n\nOn Sun, Jun 23, 2019 at 18:31 Simon Willison \nwrote:\n\n> I suggest trying a full path in ExecStart like this:\n>\n> ExecStart=/home/chris/Env/datasette/bin/datasette serve -h 0.0.0.0\n> /home/chris/digital-library/databases/*.db --cors --metadata metadata.json\n>\n> That should eliminate the chance of some kind of path confusion.\n>\n> \u2014\n> You are receiving this because you authored the thread.\n> Reply to this email directly, view it on GitHub\n> ,\n> or mute the thread\n> \n> .\n>\n-- \n*Chris Persaud*\nChrisPersaud.com\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 459397625, "label": "Documentation with recommendations on running Datasette in production without using Docker"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/514#issuecomment-504789231", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/514", "id": 504789231, "node_id": "MDEyOklzc3VlQ29tbWVudDUwNDc4OTIzMQ==", "user": {"value": 7936571, "label": "chrismp"}, "created_at": "2019-06-23T21:35:33Z", "updated_at": "2019-06-23T21:35:33Z", "author_association": "NONE", "body": "@russss \r\n\r\nThanks, just one more thing.\r\n\r\nI edited `datasette.service`:\r\n\r\n```\r\n[Unit]\r\nDescription=Datasette\r\nAfter=network.target\r\n\r\n[Service]\r\nType=simple\r\nUser=chris\r\nWorkingDirectory=/home/chris/digital-library\r\nExecStart=/home/chris/Env/datasette/bin/datasette serve -h 0.0.0.0 databases/*.db --cors --metadata metadata.json\r\nRestart=on-failure\r\n\r\n[Install]\r\nWantedBy=multi-user.target\r\n```\r\n\r\nThen ran:\r\n\r\n```\r\n$ sudo systemctl daemon-reload\r\n$ sudo systemctl enable datasette\r\n$ sudo systemctl start datasette\r\n```\r\n\r\nBut the logs from `journalctl` show this datasette error:\r\n\r\n```\r\nJun 23 23:31:41 ns331247 datasette[1771]: Error: Invalid value for \"[FILES]...\": Path \"databases/*.db\" does not exist.\r\nJun 23 23:31:44 ns331247 datasette[1778]: Usage: datasette serve [OPTIONS] [FILES]...\r\nJun 23 23:31:44 ns331247 datasette[1778]: Try \"datasette serve --help\" for help.\r\n```\r\n\r\nBut the `databases` directory does exist in the directory specified by `WorkingDirectory`. Is this a datasette problem or did I write something incorrectly in the `.service` file?\r\n\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 459397625, "label": "Documentation with recommendations on running Datasette in production without using Docker"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/514#issuecomment-504686266", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/514", "id": 504686266, "node_id": "MDEyOklzc3VlQ29tbWVudDUwNDY4NjI2Ng==", "user": {"value": 7936571, "label": "chrismp"}, "created_at": "2019-06-22T17:58:50Z", "updated_at": "2019-06-23T21:21:57Z", "author_association": "NONE", "body": "@russss \r\n\r\nActually, here's what I've got in `/etc/systemd/system/datasette.service`\r\n\r\n```\r\n[Unit]\r\nDescription=Datasette\r\nAfter=network.target\r\n\r\n[Service]\r\nType=simple\r\nUser=chris\r\nWorkingDirectory=/home/chris/digital-library\r\nExecStart=/home/chris/Env/datasette/lib/python3.7/site-packages/datasette serve -h 0.0.0.0 databases/*.db --cors --metadata metadata.json\r\nRestart=on-failure\r\n\r\n[Install]\r\nWantedBy=multi-user.target\r\n```\r\n\r\nI ran: \r\n```\r\n$ sudo systemctl daemon-reload\r\n$ sudo systemctl enable datasette\r\n$ sudo systemctl start datasette\r\n```\r\nThen I ran:\r\n`$ journalctl -u datasette -f`\r\n\r\nGot this message.\r\n\r\n```\r\nHint: You are currently not seeing messages from other users and the system.\r\n Users in groups 'adm', 'systemd-journal', 'wheel' can see all messages.\r\n Pass -q to turn off this notice.\r\n-- Logs begin at Thu 2019-06-20 00:05:23 CEST. --\r\nJun 22 19:55:57 ns331247 systemd[16176]: datasette.service: Failed to execute command: Permission denied\r\nJun 22 19:55:57 ns331247 systemd[16176]: datasette.service: Failed at step EXEC spawning /home/chris/Env/datasette/lib/python3.7/site-packages/datasette: Permission denied\r\nJun 22 19:55:57 ns331247 systemd[16184]: datasette.service: Failed to execute command: Permission denied\r\nJun 22 19:55:57 ns331247 systemd[16184]: datasette.service: Failed at step EXEC spawning /home/chris/Env/datasette/lib/python3.7/site-packages/datasette: Permission denied\r\nJun 22 19:55:58 ns331247 systemd[16186]: datasette.service: Failed to execute command: Permission denied\r\nJun 22 19:55:58 ns331247 systemd[16186]: datasette.service: Failed at step EXEC spawning /home/chris/Env/datasette/lib/python3.7/site-packages/datasette: Permission denied\r\nJun 22 19:55:58 ns331247 systemd[16190]: datasette.service: Failed to execute command: Permission denied\r\nJun 22 19:55:58 ns331247 systemd[16190]: datasette.service: Failed at step EXEC spawning /home/chris/Env/datasette/lib/python3.7/site-packages/datasette: Permission denied\r\nJun 22 19:55:58 ns331247 systemd[16191]: datasette.service: Failed to execute command: Permission denied\r\nJun 22 19:55:58 ns331247 systemd[16191]: datasette.service: Failed at step EXEC spawning /home/chris/Env/datasette/lib/python3.7/site-packages/datasette: Permission denied\r\n```\r\nWhen I go to the address for my server, I am met with the standard \"Welcome to nginx\" message:\r\n\r\n```\r\nWelcome to nginx!\r\nIf you see this page, the nginx web server is successfully installed and working. Further configuration is required.\r\n\r\nFor online documentation and support please refer to nginx.org.\r\nCommercial support is available at nginx.com.\r\n\r\nThank you for using nginx.\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 459397625, "label": "Documentation with recommendations on running Datasette in production without using Docker"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/514#issuecomment-504685187", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/514", "id": 504685187, "node_id": "MDEyOklzc3VlQ29tbWVudDUwNDY4NTE4Nw==", "user": {"value": 7936571, "label": "chrismp"}, "created_at": "2019-06-22T17:43:24Z", "updated_at": "2019-06-22T17:43:24Z", "author_association": "NONE", "body": "> > > WorkingDirectory=/path/to/data\r\n> > \r\n> > \r\n> > @russss, Which directory does this represent?\r\n> \r\n> It's the working directory (cwd) of the spawned process. In this case if you set it to the directory your data is in, you can use relative paths to the db (and metadata/templates/etc) in the `ExecStart` command.\r\n\r\nIn my case, on a remote server, I set up a virtual environment in `/home/chris/Env/datasette`, and when I activated that environment I ran `pip install datasette`. \r\n\r\nMy datasette project is in `/home/chris/datatsette-project`, so I guess I'd use that directory in the `WorkingDirectory` parameter?\r\n\r\nAnd the `ExecStart` parameter would be `/home/chris/Env/datasette/lib/python3.7/site-packages/datasette serve -h 0.0.0.0 my.db` I'm guessing?\r\n ", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 459397625, "label": "Documentation with recommendations on running Datasette in production without using Docker"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/514#issuecomment-504684709", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/514", "id": 504684709, "node_id": "MDEyOklzc3VlQ29tbWVudDUwNDY4NDcwOQ==", "user": {"value": 7936571, "label": "chrismp"}, "created_at": "2019-06-22T17:36:25Z", "updated_at": "2019-06-22T17:36:25Z", "author_association": "NONE", "body": "> WorkingDirectory=/path/to/data\r\n\r\n@russss, Which directory does this represent?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 459397625, "label": "Documentation with recommendations on running Datasette in production without using Docker"}, "performed_via_github_app": null}