ASP.NET Core Solution Template which works on Centos 7

Github Url:

Test App Url:

Test App Notes:

  • running on Centos 7
  • code first with fluent api (with postgresql provider)

Development Notes

dot net core install on centos 7

  • yum install libunwind libicu
  • curl -sSL -o dotnet.tar.gz ( dotnet core 1.0)
  • mkdir -p /home/opt/dotnet
  • tar zxf dotnet.tar.gz -C /home/opt/dotnet
  • ln -s /home3/opt/dotnet/dotnet /usr/local/bin
  • curl -sSL -o dotnet.tar.gz
    (extract only 1.1.0 dir to /home/opt/dotnet/shared/Microsoft.NETCore.App, so you would get 1.0.3 and 1.1.0 at the same time)
  • to test if it is working
    • mkdir hwapp
    • cd hwapp
    • dotnet new
    • dotnet restore
    • dotnet run ( after this if you see hello world, it is working)

apache proxy conf

add this to apache conf

<VirtualHost yourappdomain:80>
ProxyPreserveHost On
ProxyPass /
ProxyPassReverse /
ErrorLog /var/log/httpd/yourappname-error.log
CustomLog /var/log/httpd/yourappname-access.log common

if you are using cpanel you need something like this

  • create dir /etc/apache2/conf.d/userdata/std/2_4/cpanelusername/yourdomainname
  • add proxy.conf file to this dir and add following lines to that file
    • ProxyPreserveHost On
      ProxyPass /
      ProxyPassReverse /
      ErrorLog /home3/log/dotnetcore-yourdomainname-error.log
      CustomLog /home3/log/dotnetcore-yourdomainname-access.log common
  • /scripts/ensure_vhost_includes –all-users
  • systemctl restart httpd

publish your app

  • in your mvc app right click an publish
  • copy publish dir to /home/patthoyourpublishdir/ in server

Create service for your app

  • create file as /etc/systemd/system/kestrel-yourdomainname.service and fill it with the following
    • [Unit]
      Description=Example .NET Web API Application running on CentOS 7[Service]
      ExecStart=/usr/local/bin/dotnet /home/patthoyourpublishdir/yourappname.dll
      RestartSec=10                                          # Restart service after 10 seconds if dotnet service crashes
      User=root or cpanel username
      Group=root or cpanel username
  • systemctl enable kestrel-hdnet.service (if something goes wrong disable it)
  • systemctl start kestrel-hdnet.service
  • systemctl status kestrel-hdnet.service

and your dotnetcore mvc application should work.

I will add detailed documentation later.

ASP.NET MVC 5 Proje Şablonu

Test yazısı. ASP.NET MVC 5 web uygulamaları için oluşturduğum proje şablonu ile ilgili bilgiler yer alacak.

Github Adresi: