The DUNE Catalog web application is configured to run as a systemd service, which ensures it runs continuously in the background, automatically restarts if it crashes, and starts automatically when the server boots up. The application is accessible at https://dune-tech.rice.edu/dunecatalog.
To start the DUNE Catalog web application:
sudo systemctl start dune-catalog.serviceTo stop the DUNE Catalog web application:
sudo systemctl stop dune-catalog.serviceTo restart the DUNE Catalog web application (e.g., after making changes):
sudo systemctl restart dune-catalog.serviceTo check the current status of the web application:
sudo systemctl status dune-catalog.serviceTo view the application logs:
sudo journalctl -u dune-catalog.serviceTo follow the logs in real-time:
sudo journalctl -u dune-catalog.service -fTo make the web application start automatically when the server boots (enabled by default):
sudo systemctl enable dune-catalog.serviceTo prevent the web application from starting automatically at boot:
sudo systemctl disable dune-catalog.serviceIf you need to run the application manually instead of as a service, you can use the following commands:
cd /home/dune-tech-admin/DUNE-Catalog
source ./.venv/bin/activate
python run.py --productionHowever, this method will not keep the application running when you close the terminal. For production environments, using the systemd service is recommended.
If the service fails to start, check the logs for error messages:
sudo journalctl -u dune-catalog.service -n 50Common issues include:
- Missing environment variables
- Python virtual environment not activated
- Permission problems
- Port conflicts
The systemd service configuration is located at /etc/systemd/system/dune-catalog.service. If you need to modify how the service runs, edit this file and then reload the daemon and restart the service:
sudo systemctl daemon-reload
sudo systemctl restart dune-catalog.serviceThe DUNE Catalog application runs behind an Nginx web server that handles SSL termination and proxies requests to the appropriate ports:
- Frontend (Next.js): Runs on port 3000 locally
- Backend (FastAPI): Runs on port 8000 locally
The Nginx configuration is located at /etc/nginx/sites-available/dune-tech.conf and includes the following proxy settings:
# DUNE-Catalog frontend
location /dunecatalog {
proxy_pass http://localhost:3000;
# ... other proxy settings ...
}
# DUNE-Catalog backend API
location /dunecatalog/api/ {
proxy_pass http://localhost:8000/;
# ... other proxy settings ...
}If you need to modify the Nginx configuration, edit the file and then reload Nginx:
sudo nano /etc/nginx/sites-available/dune-tech.conf
sudo systemctl reload nginxIf you encounter port conflicts (e.g., "address already in use"), you can check which process is using a specific port:
sudo lsof -i :3000 # Check what's using port 3000
sudo netstat -tuln | grep 3000 # Alternative way to check
sudo fuser -n tcp 3000 # Get the process IDTo kill a process using a specific port:
sudo kill -9 <PID> # Replace <PID> with the process ID