Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

150
Vistas
ASP.NET core application showing apache default page

I've been following a blog on how to install ASP.NET Core In .NET 5 App On Ubuntu 20.04. When I visit the link api.example.com, it showing default apache page. It should be showing me the ASP.NET Core app.

All the application files are stored in /var/www/api/ and ownership has been given to www-data

VirtualHost api.conf

In the VirtualHost I have the following configurations and the conf is enabled.

<VirtualHost *:*>
    RequestHeader set "X-Forwarded-Proto" expr=%{REQUEST_SCHEME}
</VirtualHost>

<VirtualHost api.example.com:80>
    ProxyPreserveHost On
    ProxyPass / http://127.0.0.1:5000/
    ProxyPassReverse / http://127.0.0.1:5000/
    ServerName api.example.com
    ServerAlias api.example.com
    ErrorLog ${APACHE_LOG_DIR}api-error.log
    CustomLog ${APACHE_LOG_DIR}api-access.log common
</VirtualHost>

Add Service

The following service configuration has been added and service has been enabled.

[Unit]
Description=Api

[Service]
WorkingDirectory=/var/www/api/
ExecStart=/usr/bin/dotnet /var/www/api/Api.dll
Restart=always
# Restart service after 10 seconds if the dotnet service crashes:
RestartSec=10
KillSignal=SIGINT
SyslogIdentifier=api
User=www-data
Environment=ASPNETCORE_ENVIRONMENT=Production

[Install]
WantedBy=multi-user.target

When I run sudo systemctl status api.service I get the following

ubuntu@sandbox:~$ sudo systemctl status api.service
● api.service - Api
     Loaded: loaded (/etc/systemd/system/api.service; enabled; vendor preset: enabled)
     Active: active (running) since Sun 2021-07-04 12:28:54 UTC; 12h ago
   Main PID: 21133 (dotnet)
      Tasks: 13 (limit: 1116)
     Memory: 33.3M
     CGroup: /system.slice/api.service
             └─21133 /usr/bin/dotnet /var/www/api/Api.dll

Jul 04 12:28:55 sandbox api[21133]: warn: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[35]
Jul 04 12:28:55 sandbox api[21133]:       No XML encryptor configured. Key {cb00126e-6ce8-41cc-9568-800ff705be3a} may be persisted to storage in unencrypted form.
Jul 04 12:28:55 sandbox api[21133]: info: Microsoft.Hosting.Lifetime[0]
Jul 04 12:28:55 sandbox api[21133]:       Now listening on: http://localhost:5000
Jul 04 12:28:55 sandbox api[21133]: info: Microsoft.Hosting.Lifetime[0]
Jul 04 12:28:55 sandbox api[21133]:       Application started. Press Ctrl+C to shut down.
Jul 04 12:28:55 sandbox api[21133]: info: Microsoft.Hosting.Lifetime[0]
Jul 04 12:28:55 sandbox api[21133]:       Hosting environment: Production
Jul 04 12:28:55 sandbox api[21133]: info: Microsoft.Hosting.Lifetime[0]
Jul 04 12:28:55 sandbox api[21133]:       Content root path: /var/www/api
over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda