Aniworld/SERVER_COMMANDS.md
2025-11-02 08:33:44 +01:00

3.7 KiB

Server Management Commands

Quick reference for starting, stopping, and managing the Aniworld server.

Start Server

./start_server.sh

Using conda directly

conda run -n AniWorld python run_server.py

Using uvicorn directly

conda run -n AniWorld python -m uvicorn src.server.fastapi_app:app --host 127.0.0.1 --port 8000 --reload

Stop Server

./stop_server.sh

Manual commands

Kill uvicorn processes:

pkill -f "uvicorn.*fastapi_app:app"

Kill process on port 8000:

lsof -ti:8000 | xargs kill -9

Kill run_server.py processes:

pkill -f "run_server.py"

Check Server Status

Check if port 8000 is in use:

lsof -i:8000

Check for running uvicorn processes:

ps aux | grep uvicorn

Check server is responding:

curl http://127.0.0.1:8000/api/health

Restart Server

./stop_server.sh && ./start_server.sh

Common Issues

"Address already in use" Error

Problem: Port 8000 is already occupied

Solution:

./stop_server.sh
# or
lsof -ti:8000 | xargs kill -9

Server not responding

Check logs:

tail -f logs/app.log

Check if process is running:

ps aux | grep uvicorn

Cannot connect to server

Verify server is running:

curl http://127.0.0.1:8000/api/health

Check firewall:

sudo ufw status

Development Mode

Run with auto-reload:

./start_server.sh  # Already includes --reload

Run with custom port:

conda run -n AniWorld python -m uvicorn src.server.fastapi_app:app --host 127.0.0.1 --port 8080 --reload

Run with debug logging:

export LOG_LEVEL=DEBUG
./start_server.sh

Production Mode

Run without auto-reload:

conda run -n AniWorld python -m uvicorn src.server.fastapi_app:app --host 0.0.0.0 --port 8000 --workers 4

Run with systemd (Linux):

sudo systemctl start aniworld
sudo systemctl stop aniworld
sudo systemctl restart aniworld
sudo systemctl status aniworld

URLs

Default Credentials

  • Password: Hallo123!

Log Files

  • Application logs: logs/app.log
  • Download logs: logs/downloads/
  • Error logs: Check console output or systemd journal

Quick Troubleshooting

Symptom Solution
Port already in use ./stop_server.sh
Server won't start Check logs/app.log
404 errors Verify URL and check routing
WebSocket not connecting Check server is running and firewall
Slow responses Check system resources (htop)
Database errors Check data/ directory permissions

Environment Variables

# Set log level
export LOG_LEVEL=DEBUG|INFO|WARNING|ERROR

# Set server port
export PORT=8000

# Set host
export HOST=127.0.0.1

# Set workers (production)
export WORKERS=4
  • start_server.sh - Start the server
  • stop_server.sh - Stop the server
  • run_server.py - Python server runner
  • scripts/setup.py - Initial setup

More Information