@@ -179,8 +179,9 @@ sudo systemctl restart custom-https-server
179179
180180``` bash
181181sudo systemctl status custom-https-server
182- sudo lsof -i :80 # Or your configured HTTP port
183- sudo lsof -i :443 # Or your configured HTTPS port
182+ sudo lsof -i :80 # Or HTTP / HTTPS port from config
183+ sudo lsof -i :443 # Or HTTP / HTTPS port from config
184+ sudo lsof -i :8080 # Or HTTP / HTTPS port from config
184185```
185186
186187---
@@ -190,32 +191,86 @@ sudo lsof -i :443 # Or your configured HTTPS port
190191The server ** auto-creates logs** in the user directory (` LOG_DIR ` ) if missing. Example:
191192
192193``` bash
193- tail -f /Users /< username> /custom_https_server_log/logs/custom_https_server.log
194- tail -f /Users /< username> /custom_https_server_log/logs/custom_https_server.err
194+ tail -f /home /< username> /custom_https_server_log/logs/custom_https_server.log
195+ tail -f /home /< username> /custom_https_server_log/logs/custom_https_server.err
195196```
196197
197198> Replace ` <username> ` with your actual user.
198199
199200---
200201
201- ### 🔓 Allow Port in Firewall
202+ ### 🔓 Allow Port in Firewall (Linux)
203+
204+ The firewall configuration depends on your Linux distribution.
205+
206+ ---
202207
203- #### Rocky Linux
208+ #### 🟥 Rocky / Alma / CentOS / RHEL (firewalld)
204209
205210``` bash
206211sudo firewall-cmd --permanent --add-port=80/tcp
207212sudo firewall-cmd --permanent --add-port=443/tcp
213+ sudo firewall-cmd --permanent --add-port=8080/tcp
208214sudo firewall-cmd --reload
209215```
210216
211- #### Ubuntu
217+ Verify:
218+
219+ ``` bash
220+ sudo firewall-cmd --list-ports
221+ ```
222+
223+ ---
224+
225+ #### 🟧 Ubuntu / Debian (UFW – recommended)
212226
213227``` bash
214228sudo ufw allow 80/tcp
215229sudo ufw allow 443/tcp
230+ sudo ufw allow 8080/tcp
216231sudo ufw reload
217232```
218233
234+ Verify:
235+
236+ ``` bash
237+ sudo ufw status
238+ ```
239+
240+ ---
241+
242+ #### 🟦 Generic Linux (iptables – immediate but NOT persistent)
243+
244+ ``` bash
245+ sudo iptables -I INPUT 1 -p tcp --dport 8080 -m conntrack --ctstate NEW -j ACCEPT
246+ ```
247+
248+ Verify:
249+
250+ ``` bash
251+ sudo iptables -L INPUT -n --line-numbers
252+ ```
253+
254+ ⚠️ ** Important:**
255+ This rule will be ** lost after reboot** unless persistence is enabled.
256+
257+ To make it persistent on Ubuntu/Debian:
258+
259+ ``` bash
260+ sudo apt install iptables-persistent
261+ sudo netfilter-persistent save
262+ sudo netfilter-persistent reload
263+ ```
264+
265+ ---
266+
267+ ### 📝 Notes
268+
269+ * Use ** UFW** on Ubuntu whenever possible
270+ * Use ** firewalld** on RHEL-based systems
271+ * Use raw ** iptables** only for testing or minimal systems
272+ * If you change ` SERVE_PORT ` , update the firewall rule accordingly
273+
219274---
220275
221276### ❌ Uninstall (Linux)
0 commit comments