Comments (3)
Okay now it is running with systemd. Did not think about systemd :D I needed to modify your scripts and now it runs just fine. For quick testing a "-d" would still be great :)
Please add one of the solutions to the docs.
Here are my steps:
- Create start.sh in the zoraxy folder with:
nano start.sh
Put in those lines
#!/bin/bash
./zoraxy -port=:8000
- make executable with
chmod +x start.sh
- Now create systemd-service with
sudo nano /etc/systemd/system/zoraxy.service
Put in following lines:
[Unit]
Description=Zoraxy Reverse Proxy Server
After=network-online.target #waits for network to be online
Wants=network-online.target
[Service]
Type=simple
User=root #no sudo required in start.sh
Group=root
WorkingDirectory=/zoraxy/src/ #folder where zoraxy is
ExecStart=/bin/bash /zoraxy/src/start.sh #absolute path for start.sh
[Install]
WantedBy=multi-user.target
- Start and enable autostart with:
sudo systemctl enable --now zoraxy.service
Now status and logs can be displayed with:
sudo systemctl status zoraxy
Logs-files would still be great, but thanks for the help with autostart
A sidenote for LXC-Users: After login as root the working directory is not /zoraxy/src but /root/zoraxy/src
(/root/ is the home of root user) Tested with LXC Ubuntu 22.04
from zoraxy.
Thanks for that grate tool! ๐๐ป
A little fix. :)
Description=Zoraxy Reverse Proxy Server
#waits for network to be online
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
#no sudo required in start.sh
User=root
Group=root
#folder where zoraxy is
WorkingDirectory=/zoraxy/src/
#absolute path for start.sh
ExecStart=/bin/bash /zoraxy/src/start.sh
[Install]
WantedBy=multi-user.target
from zoraxy.
"-d" argument seems like an interesting idea. However, adding this might bring some issue with Windows compatibility.
For my linux setups, I am using systemd for this purpose. Here is how I did it.
First, you would like to create a start.sh file next to your zoraxy binary. Assuming your binary file is located at /home/user/zoraxy/src/zoraxy
cd /home/user/zoraxy/src/zoraxy
nano start.sh
Put the following lines into start.sh, save and exit
#!/bin/bash
sudo ./zoraxy
Then assign the correct permission to the start script
sudo chmod 775 ./start.sh
Next, you can add it to systemd service with the following commands
cd /etc/systemd/system/
sudo systemctl enable systemd-networkd.service systemd-networkd-wait-online.service
sudo nano zoraxy.service
In the service file, fill in the following info
[Unit]
Description=Zoraxy Reverse Proxy Server
After=systemd-networkd-wait-online.service
Wants=systemd-networkd-wait-online.service
[Service]
Type=simple
ExecStartPre=/bin/sleep 10
WorkingDirectory=/home/user/zoraxy/src/
ExecStart=/bin/bash /home/user/zoraxy/src/start.sh
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
Lastly, enable and start the systemd service
sudo systemctl enable zoraxy
sudo systemctl start zoraxy
Then it should be running as a valid daemon which will start following your server (or container) startup. As I am no expert in LXC, I can only provide you answer under normal Linux (Debian) based installation. If you have issues using systemd in your container, I guess you might need to seek help from the developer who provided the container / docker configs.
from zoraxy.
Related Issues (20)
- [BUG] High Memory Consumption HOT 3
- [ENHANCEMENTS] Letsencrypt Auto Renewal HOT 2
- [ENHANCEMENTS] Potential security issues HOT 3
- Serve a static site directly [ENHANCEMENTS]
- [BUG] Service Expose Proxy Page Blank HOT 1
- [BUG] Let's Encrypt certs are Staging ones, so they're untrusted on browsers HOT 33
- Autostart Webserver when Proxy Root set to static webserver [BUG] HOT 1
- [ENHANCEMENTS] Access list per subdomain HOT 3
- [BUG] Cannot handle HTTP 301 response correctly HOT 5
- [BUG] Very high CPU usage HOT 6
- [ENHANCEMENTS] Multiple Subdomains in Single Rule HOT 2
- [BUG] Uptime Monitor shows old port
- [BUG]SMTP without auth HOT 2
- [QUESTION] Wildcard lets'encrypt certificat HOT 16
- [ENHANCEMENTS] SMTP without Auth and port 25
- [ENHANCEMENTS] Dark Theme
- [Help Wanted] Unable to create ACME cert behind opnsense and proxmox HOT 4
- [ENHANCEMENTS] "getting started" in documentation HOT 1
- [ENHANCEMENTS] Multi account accรจs webmin page HOT 1
- [BUG] BAD HANDSHAKE HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zoraxy.