You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A lightweight, Python-based **Custom HTTP Server** that runs as a Linux systemd service. This project is ideal for serving static files, logs, test results, or building RESTful APIs with no external dependencies.
7
+
A lightweight, Python-based **Custom HTTP Server** that runs as a **Linux systemd service** or a **macOS `launchd` agent**. Ideal for serving static files, logs, test results, or internal documentation.
8
+
This is a minimal yet powerful **custom HTTP server** written in pure Python. It includes MIME-type awareness and seamless integration with **systemd (Linux)** and **launchd (macOS)** for automatic startup on boot.
8
9
9
-
This is a minimal yet powerful **custom HTTP server** written in pure Python. It includes MIME-type awareness and seamless systemd integration for automatic startup.
* To allow users to easily update the **port** and **path** used by the custom HTTP server, you’ve already provided a config file (`/etc/custom-http-server.conf`). Here's how they can update the **port** specifically:
30
-
31
-
## Step-by-Step: Update Port
36
+
### 🔧 Configure Port and Directory
32
37
33
-
1.**Open the config file:**
38
+
Edit the config file:
34
39
35
40
```bash
36
41
sudo vi /etc/custom-http-server.conf
37
42
```
38
43
39
-
2.**Change the value of `SERVE_PORT`:**
40
-
41
-
You're currently using port `80`, so your config will look like:
44
+
Example:
42
45
43
46
```ini
44
47
# Path to serve (change this to your target directory)
45
48
SERVE_PATH=/root
46
49
SERVE_PORT=80
47
50
```
48
51
49
-
> ℹ️ **Note:** Port `80` is the default HTTP port and requires the service to run as **root**. This is already handled by the systemd unit (`User=root`), so no additional configuration is required for privileged port access.
50
-
51
-
> For non-root ports like `8080` or `8000`, you can freely change the `SERVE_PORT` without needing elevated permissions.
52
+
* Port `80` requires **root** privileges (already handled by systemd).
53
+
* You can use any non-privileged port like `8080`, `8000`, etc., without root.
52
54
53
-
3.**Save and exit**
54
-
55
-
4.**Restart the service to apply changes:**
55
+
Restart to apply changes:
56
56
57
57
```bash
58
58
sudo systemctl restart custom-http-server
59
59
```
60
60
61
61
---
62
62
63
-
### Verify the Port
64
-
65
-
You can check whether the server is now running on port 80:
63
+
### ✅ Verify
66
64
67
65
```bash
68
-
sudo lsof -i :80
69
-
```
70
-
71
-
Or access it via:
72
-
73
-
```
74
-
http://<your-ip>/
66
+
sudo systemctl status custom-http-server
67
+
sudo lsof -i :80 # Or your configured port
75
68
```
76
69
77
-
---
78
-
79
70
Check service status to confirm it's running properly:
0 commit comments