LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 11-20-2018, 08:10 AM   #1
HisokaMorow
LQ Newbie
 
Registered: Nov 2018
Posts: 1

Rep: Reputation: Disabled
Exclamation Host ASP.NET Core on Centos with Nginx service is "activating"


Hi all! I'm new on linux.
I'm learning this tutorial https://docs.microsoft.com/en-US/asp...aspnetcore-2.1

I need Host my Web Application ASP.NET Core on my CentOS with Nginx

I followed the steps but I have a problem status kestrel-helloapp.service is*activating

Why this service not complete to activate?

ERROR:"activating"
Code:
[root@CentOS /]# sudo systemctl status kestrel-helloapp.service
● kestrel-helloapp.service - Example .NET Web API App running on Ubuntu   Loaded: loaded (/etc/systemd/system/kestrel-helloapp.service; enabled; vendor preset: disabled)
   Active: activating (auto-restart) (Result: exit-code) since Sun 2018-11-18 09:45:06 -04; 5s ago
  Process: 16742 ExecStart=/usr/bin/dotnet /usr/share/nginx/html/prueba.dll (code=exited, status=217/USER)
 Main PID: 16742 (code=exited, status=217/USER)
/etc/nginx/nginx.conf


run Nginz Test
Code:
[root@CentOS ~]# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
Code:
worker_processes  1;
events {
    worker_connections  1024;
}


http {

    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
    
    server {
        listen       80;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   html;
            index  index.html index.htm;
        }

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }
}

Code:
/etc/nginx/conf.d/default.conf

#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    sendfile        on;
    keepalive_timeout  65;

    server {
    listen 80;
    location / {
    proxy_pass http://localhost:5000;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection keep-alive;
    proxy_set_header Host $host;
    proxy_cache_bypass $http_upgrade;
    }
}
my app default root

/usr/share/nginx/html

here stay my AppNetCore.dll




/etc/nginx/proxy.conf*
Code:
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
client_max_body_size 10m; 
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffers 32 4k;
/etc/systemd/system/kestrel-helloapp.service

[Unit]
Description=Example .NET Web API App running on Ubuntu

[Service]
WorkingDirectory=/usr/share/nginx/html
ExecStart=/usr/bin/dotnet /usr/share/nginx/html/prueba.dll
Restart=always
# Restart service after 10 seconds if the dotnet service crashes:
RestartSec=10
KillSignal=SIGINT
SyslogIdentifier=dotnet-example
User=www-data
Environment=ASPNETCORE_ENVIRONMENT=Production
Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false

[Install]
WantedBy=multi-user.target
 
Old 11-22-2018, 03:25 AM   #2
OBenned
LQ Newbie
 
Registered: Nov 2018
Distribution: CentOS
Posts: 1

Rep: Reputation: Disabled
Did the nginx run without the aps.net core config?
Does /var/log/nginx give any idea on what might be happening?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Microsoft backtracks: 'We are going to support .NET Framework with ASP.NET Core 2.0' LXer Syndicated Linux News 0 05-12-2017 12:06 AM
LXer: Microsoft's .NET-mare: ASP.NET 2.0 won't work on Windows-only .NET LXer Syndicated Linux News 0 05-10-2017 06:32 AM
ASP and ASP .NET running on Apache? isra_mv Linux - Server 1 10-28-2007 05:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

All times are GMT -5. The time now is 04:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration