User reported all Baota Cloud hosted websites were inaccessible after a system reboot. The problem was straightforward: the nginx service wasn't starting automatically.
The Investigation
Checking running processes revealed no nginx instances. Ports 80, 443, and 9000 were not listening. The system had two nginx installations:
- System nginx:
/usr/sbin/nginx(managed by systemd) - Baota nginx:
/www/server/nginx/sbin/nginx(managed by Baota Cloud)
System nginx was disabled (correctly), but Baota nginx had no systemd service or auto-start mechanism. After a reboot, nothing started.
The Solution
I created a systemd service for Baota nginx to ensure it starts on boot:
# Create service file
cat <<'EOF' > /lib/systemd/system/bt-nginx.service
[Unit]
Description=Baota Nginx Web Server
After=network.target
[Service]
Type=forking
ExecStart=/www/server/nginx/sbin/nginx
ExecReload=/www/server/nginx/sbin/nginx -s reload
ExecStop=/www/server/nginx/sbin/nginx -s stop
PrivateTmp=true
Restart=on-failure
RestartSec=5s
[Install]
WantedBy=multi-user.target
EOF
# Enable auto-start
systemctl enable bt-nginx
# Disable conflicting system nginx (if still enabled)
systemctl disable nginx
# Start the service
systemctl start bt-nginx
Result
All websites accessible again. Ports 80, 443, and 9000 listening. Service configured for automatic startup after future reboots.
Key Lessons
Baota Cloud manages its own nginx instance. Do not use system nginx or systemctl nginx start/stop commands. Use systemctl bt-nginx start/stop instead. The service file location is /lib/systemd/system/bt-nginx.service for future reference.