title: Change the Kestrel port number for Asp.Net core 3.1 app with supervisor control: ERROR (file is not executable)
body: <p>SOLUTION:</p>
  
  <p>After compare old (before VS update) and new compiled app found no Pirkimai executable. In publish directory just </p>
  
  <pre><code>[admin@WEBCORE publish]$ chmod u+x Pirkimai
  </code></pre>
  
  <p>Modify /etc/nginx/conf.d/pirkimai.conf</p>
  
  <pre><code>...
  proxy_pass https://localhost:5101;
  ...
  </code></pre>
  
  <p><strong>QUESTION:</strong></p>
  
  <p>I have test server with default port number of Asp.Net core 3.1 mvc app. It works.</p>
  
  <p>Now modify ports in Program.cs</p>
  
  <pre><code>    public static IHostBuilder CreateHostBuilder(string[] args) =&gt;
          Host.CreateDefaultBuilder(args)
              .ConfigureWebHostDefaults(webBuilder =&gt; {
                  webBuilder.UseStartup&lt;Startup&gt;();
              **webBuilder.UseUrls("http://localhost:5100", "https://localhost:5101");**
              });
  </code></pre>
  
  <p>And copy app to Centos 8 testing server</p>
  
  <pre><code>C:\Users\id988\source\repos&gt;scp -r Pirkimai admin@10.161.18.88:
  </code></pre>
  
  <p>In linux server cd to publish directory and run dotnet</p>
  
  <pre><code>[admin@WEBCORE publish]$ dotnet Pirkimai.dll
  info: Microsoft.Hosting.Lifetime[0]
        Now listening on: http://localhost:5100
  info: Microsoft.Hosting.Lifetime[0]
        Now listening on: https://localhost:5101
  info: Microsoft.Hosting.Lifetime[0]
        Application started. Press Ctrl+C to shut down.
  info: Microsoft.Hosting.Lifetime[0]
        Hosting environment: Production
  info: Microsoft.Hosting.Lifetime[0]
        Content root path: /home/admin/Pirkimai/bin/Release/netcoreapp3.1/publish
  </code></pre>
  
  <p>Firefox localhost:5100 redirect to <a href="https://localhost:5101" rel="nofollow noreferrer">https://localhost:5101</a> and show content ok as before. Restart supervisor.</p>
  
  <pre><code>[root@WEBCORE supervisord.d]# supervisorctl restart all
  Pirkimai: **ERROR (file is not executable)**
  </code></pre>
  
  <p>Now Kestrel not starts as before. /var/log/supervisor/supervisord.log</p>
  
  <pre><code>...
  2020-03-05 09:11:48,976 WARN received SIGTERM indicating exit request
  2020-03-05 09:12:08,913 CRIT Supervisor is running as root.  Privileges were not dropped because no user is specified in the config file.  If you intend to run as root, you can set user=root in the config file to avoid this message.
  2020-03-05 09:12:08,915 INFO Included extra file "/etc/supervisord.d/Pirkimai.ini" during parsing
  2020-03-05 09:12:08,955 INFO RPC interface 'supervisor' initialized
  2020-03-05 09:12:08,955 CRIT Server 'unix_http_server' running without any HTTP authentication checking
  2020-03-05 09:12:08,963 INFO daemonizing the supervisord process
  2020-03-05 09:12:08,970 INFO supervisord started with pid 974
  2020-03-05 09:12:09,985 INFO spawnerr: command at '/home/admin/Pirkimai/bin/Release/netcoreapp3.1/publish/Pirkimai' is not executable
  2020-03-05 09:12:10,986 INFO spawnerr: command at '/home/admin/Pirkimai/bin/Release/netcoreapp3.1/publish/Pirkimai' is not executable
  2020-03-05 09:12:12,998 INFO spawnerr: command at '/home/admin/Pirkimai/bin/Release/netcoreapp3.1/publish/Pirkimai' is not executable
  2020-03-05 09:12:16,016 INFO spawnerr: command at '/home/admin/Pirkimai/bin/Release/netcoreapp3.1/publish/Pirkimai' is not executable
  2020-03-05 09:12:16,016 INFO gave up: Pirkimai entered FATAL state, too many start retries too quickly
  </code></pre>
  
  <p>My /etc/supervisord.d/Pirkimai.ini  </p>
  
  <pre><code>[program:Pirkimai]
  command=/home/admin/Pirkimai/bin/Release/netcoreapp3.1/publish/Pirkimai
  directory=/home/admin/Pirkimai/bin/Release/netcoreapp3.1/publish/
  environment=HOME="/home/admin",ASPNETCORE__ENVIRONMENT="Production"
  user=admin
  stopsignal=INT
  autostart=true
  autorestart=true
  startsecs=1
  stderr_logfile=/var/log/supervisor/Pirkimai.err.log
  stdout_logfile=/var/log/supervisor/Pirkimai.out.log
  </code></pre>
  
  <p>Something missing in supervisor configuration?</p>