Running Repository with a Proxy on Linux

Reverse Proxy

You may wish to use another web server, such as Apache or nginx, as a reverse proxy. In this scenario, your web server would forward requests to the Repository application, and return the responses to the requesting client.

See also

See the Microsoft documentation for help deciding whether to use a reverse proxy.

Systemd

On Linux systems with systemd, you may wish to create a systemd service to run the Repository application. This helps ensure the Repository application is always accessible. Follow these steps to create and run a systemd service for Colectica Repository. This service file assumes you will run the server on a non-privileged port such as 8080, with HTTP communication with the proxy. If you are using HTTPS, review the running-on-linux-standalone.rst documentation for an example using HTTPS.

  1. Create a service unit configuration file with content similar to the following.

[Unit]
Description=Colectica Repository

[Service]
WorkingDirectory=/home/colectica/deploy/repository/ColecticaRepository
ExecStart=/home/colectica/deploy/repository/ColecticaRepository/ColecticaRepository
SyslogIdentifier=ColecticaRepository
User=colectica
Restart=always
RestartSec=5

KillSignal=SIGINT
Environment=ASPNETCORE_ENVIRONMENT=Production
Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false
Environment=ASPNETCORE_URLS=http://*:8080

[Install]
WantedBy=multi-user.target
  1. Edit the WorkingDirectory and ExecStart lines with the appropriate disk path.

  2. Edit the User line with the user that will run the application.

  3. Edit the Environment=ASPNETCORE_URLS line to set the hostname and port.

  4. Save the file as /etc/systemd/system/ColecticaRepository.service.

  5. You may have to update any built in firewall to allow traffic.

    sudo firewall-cmd --zone=public --add-port 8080/tcp --permanent
    sudo firewall-cmd --reload
    
  6. Run the following command so systemd loads the new service.

    sudo systemctl daemon-reload
    
  7. To enable the service to start when the system boots, run:

    sudo systemctl enable ColecticaRepository
    
  8. To start the service, run:

    sudo systemctl start ColecticaRepository