Jump to content

System:Service Management: Difference between revisions

From jb-vpn.uk Wiki
Content added - troubleshooting guide: Service Management (19 sections)
Updated documentation from markdown files
 
Line 1: Line 1:
This document describes how to manage services in the reverse proxy system.
This document describes how to manage edge proxy and related services on the VPS.


== Nginx Service ==
== Caddy (public reverse proxy) ==


=== Status Check ===
=== Status ===


<pre class="lang-bash">
<pre class="lang-bash">
systemctl status nginx
systemctl status caddy
</pre>
</pre>


=== Configuration Test ===
=== Validate configuration ===


<pre class="lang-bash">
<pre class="lang-bash">
nginx -t
caddy validate --config /etc/caddy/Caddyfile
</pre>
</pre>


=== Reload Configuration ===
=== Apply changes ===
 
Reload nginx to apply new configuration (graceful, no downtime):


<pre class="lang-bash">
<pre class="lang-bash">
systemctl reload nginx
systemctl reload caddy
</pre>
</pre>


=== Restart Service ===
=== Logs ===


<pre class="lang-bash">
<pre class="lang-bash">
systemctl restart nginx
journalctl -u caddy -f
journalctl -u caddy -n 100 --no-pager
</pre>
</pre>


== Logs ==
=== Backup Caddyfile ===


=== Access Logs ===
<pre class="lang-bash">
cp -a /etc/caddy/Caddyfile /root/backups/caddy/Caddyfile.$(date +%F)
</pre>


'''Location''': <code>/var/log/nginx/access.log</code>
== MediaWiki stack ==


* Records all HTTP requests
<pre class="lang-bash">
 
cd /var/www/wiki.jb
* Useful for traffic analysis and debugging
docker compose ps
docker compose logs -f wiki
docker compose restart wiki werbs-wiki
</pre>


=== Error Logs ===
See [[Webapp:Deployment|Documentation:Wiki Deployment]].


'''Location''': <code>/var/log/nginx/error.log</code>
== WebApp stack ==


* Records errors and warnings
See [[Webapp:Deployment|Webapp:Deployment]].


* First place to check for issues
== OpenVPN ==
 
=== View Logs ===


<pre class="lang-bash">
<pre class="lang-bash">
tail -f /var/log/nginx/access.log
systemctl status openvpn-server@server
tail -f /var/log/nginx/error.log
ip addr show tun0
</pre>
</pre>


== Maintenance ==
== Maintenance checklist ==


=== Regular Tasks ===
* Confirm Caddy is active and config validates after hostname changes


==== '''Certificate Monitoring''': Verify auto-renewal is working (certbot handles this) ====
* Review <code>journalctl -u caddy</code> after incidents
== '''Log Review''': Check nginx logs for errors or unusual activity ==
== '''Package Updates''': Keep nginx and certbot updated ==
== '''Configuration Backups''': Backup nginx configurations periodically ==


=== Backup Commands ===
* Keep Docker images updated for wiki and WebApp stacks


<pre class="lang-bash">
* Verify Let's Encrypt renewal (handled by Caddy; check logs if certificates near expiry)
==== Backup nginx configurations ====
 
tar -czf nginx-config-backup-$(date +%Y%m%d).tar.gz /etc/nginx/sites-available/
== Related documentation ==


== Backup SSL certificates (optional, usually not needed) ==
* [Network Architecture Network Architecture]
tar -czf certbot-backup-$(date +%Y%m%d).tar.gz /etc/letsencrypt/
</pre>


== Related Documentation ==
* [[Troubleshooting:Service Troubleshooting|Troubleshooting:Service Troubleshooting]]


* [Network Architecture](network-architecture.md) - Network overview
* [[Troubleshooting:Nginx Troubleshooting|Troubleshooting:Nginx Troubleshooting]] — legacy reference only


* [[Documentation:Index|Troubleshooting]] - Service troubleshooting


[[Category:Documentation]]
[[Category:Documentation]]
[[Category:Documentation/System]]
[[Category:Documentation/System]]

Latest revision as of 14:04, 16 May 2026

This document describes how to manage edge proxy and related services on the VPS.

Caddy (public reverse proxy)

[edit]

Status

[edit]
systemctl status caddy

Validate configuration

[edit]
caddy validate --config /etc/caddy/Caddyfile

Apply changes

[edit]
systemctl reload caddy

Logs

[edit]
journalctl -u caddy -f
journalctl -u caddy -n 100 --no-pager

Backup Caddyfile

[edit]
cp -a /etc/caddy/Caddyfile /root/backups/caddy/Caddyfile.$(date +%F)

MediaWiki stack

[edit]
cd /var/www/wiki.jb
docker compose ps
docker compose logs -f wiki
docker compose restart wiki werbs-wiki

See Documentation:Wiki Deployment.

WebApp stack

[edit]

See Webapp:Deployment.

OpenVPN

[edit]
systemctl status openvpn-server@server
ip addr show tun0

Maintenance checklist

[edit]
  • Confirm Caddy is active and config validates after hostname changes
  • Review journalctl -u caddy after incidents
  • Keep Docker images updated for wiki and WebApp stacks
  • Verify Let's Encrypt renewal (handled by Caddy; check logs if certificates near expiry)
[edit]
  • [Network Architecture Network Architecture]