Jattie van der Linde

Shoe string engineering

User Tools

Site Tools


projects:3dprint:octoprint

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
projects:3dprint:octoprint [2023/05/18 13:34] – [Autostart Octoprint as a Linux Service] jattieprojects:3dprint:octoprint [2023/05/18 19:26] (current) – ↷ Links adapted because of a move operation jattie
Line 2: Line 2:
  
 <WRAP center round info 60%> <WRAP center round info 60%>
-The long way is for if you care about the technical steps and want to reproduce it yourself. See the [[projects:3dprint:octoprint_image|short way to just get the LXC Octoprint image]] and get up and running as easy as possible.+The long way is for if you care about the technical steps and want to reproduce it yourself. See the [[projects:3dprint:octoprint_short|short way to just get the LXC Octoprint image]] and get up and running as easy as possible.
 </WRAP> </WRAP>
  
Line 539: Line 539:
  
 </cli> </cli>
 +
 +===== Advanced Features =====
 +
 +==== Enable .local network access ====
 +
 +to resolve the machine name with octo.local we need the avahi service.
 +
 +  * sudo apt install avahi-daemon
 +  * systemctl restart avahi-daemon
 +  * systemctl status avahi-daemon
 +
 +
  
 ==== Make everything accessible on port 80 ==== ==== Make everything accessible on port 80 ====
Line 561: Line 573:
 </cli> </cli>
  
-<code bash>+<code apache haproxy.cfg>
 global global
         log /dev/log    local0         log /dev/log    local0
Line 609: Line 621:
         http-request replace-path /webcam/(.*)   /\1         http-request replace-path /webcam/(.*)   /\1
         server webcam1  127.0.0.1:8080         server webcam1  127.0.0.1:8080
- 
 </code> </code>
 +
 +  * Restart the service
 +  * Check the status after the edits and restart
 +
 +<cli>
 +(venv) octo@octo:~$ sudo systemctl restart haproxy
 +(venv) octo@octo:~$ sudo systemctl status haproxy
 +● haproxy.service - HAProxy Load Balancer
 +     Loaded: loaded (/lib/systemd/system/haproxy.service; enabled; vendor preset: enabled)
 +     Active: active (running) since Thu 2023-05-18 13:43:46 UTC; 7s ago
 +       Docs: man:haproxy(1)
 +             file:/usr/share/doc/haproxy/configuration.txt.gz
 +    Process: 16750 ExecStartPre=/usr/sbin/haproxy -Ws -f $CONFIG -c -q $EXTRAOPTS (code=exited, status=0/SUCCESS)
 +   Main PID: 16752 (haproxy)
 +      Tasks: 9 (limit: 9209)
 +     Memory: 138.4M
 +        CPU: 239ms
 +     CGroup: /system.slice/haproxy.service
 +             ├─16752 /usr/sbin/haproxy -Ws -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -S /run/haproxy-master.sock
 +             └─16754 /usr/sbin/haproxy -Ws -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -S /run/haproxy-master.sock
 +
 +May 18 13:43:46 octo haproxy[10866]: [NOTICE]   (10866) : haproxy version is 2.4.22-0ubuntu0.22.04.1
 +May 18 13:43:46 octo haproxy[10866]: [NOTICE]   (10866) : path to executable is /usr/sbin/haproxy
 +May 18 13:43:46 octo haproxy[10866]: [ALERT]    (10866) : Current worker #1 (10868) exited with code 143 (Terminated)
 +May 18 13:43:46 octo haproxy[10866]: [WARNING]  (10866) : All workers exited. Exiting... (0)
 +May 18 13:43:46 octo systemd[1]: haproxy.service: Deactivated successfully.
 +May 18 13:43:46 octo systemd[1]: Stopped HAProxy Load Balancer.
 +May 18 13:43:46 octo systemd[1]: haproxy.service: Consumed 4.332s CPU time.
 +May 18 13:43:46 octo systemd[1]: Starting HAProxy Load Balancer...
 +May 18 13:43:46 octo haproxy[16752]: [NOTICE]   (16752) : New worker #1 (16754) forked
 +May 18 13:43:46 octo systemd[1]: Started HAProxy Load Balancer.
 +(venv) octo@octo:~$
 +
 +</cli>
 +
 +We should now be able to access the server on the standard port 80, i.e. no port specification required.
  
 ==== Setting up SSH access to your container ==== ==== Setting up SSH access to your container ====
projects/3dprint/octoprint.1684416895.txt.gz · Last modified: 2023/05/18 13:34 by jattie