Atilla Tanrikulu

I am an experienced software engineer and architect living in Germany. I’m passionate about distributed scalable enterprise web-based microservices/applications and delivering great user experiences. I have created some amazing enterprise-level applications that many people have used and hopefully enjoyed.

Articles

Java Quick Reference Apache Kafka Tutorial Guvenli Kod Gelistirme Making an Enterprise Scale Angular Project Step by Step Nightly SQL Server Database Backup with command line batch file and windows scheduler AOP Framework without proxy pattern IdentityServer Nedir Middleware Pattern With Csharp And Javascript Docker most used commands Online Proje Dokumantasyonu, Docker, Nginx, mdwiki How to use Github Pages for static websites Inheritance with JavaScript, EC6 (ECMAScript 6, ECMAScript 2015) Object oriented javascript and Inheritance Singleton Pattern with Javascript Factory Pattern with Javascript Open terminal here mac os x service IdentityServer4-Angular-6-integration JMater notlari, kurulum ve kullanim Learn Jekyll in 12 Steps Make Mac Application with Automater from sh script Make spotlight index markdown or code files OAuth 2.0 Nedir (RFC6749) Using Custom CSS and Custom JavaScript to an Angular Project Cross Platform Desktop Application With .Net Core 2x and Angular 6x front-end projects with nodejs gulp bower yeoman and angularjs Host Asp.Net Core on Linux with Apache Redis kurulumu ve ayarlari Useful Mac OS Apps Choosing internet connection on multiple interface windows Name Server Kurulumu How to define domain name for your dynamic IP SQL table data compare, and prepare insert satements Useful Git Commands TFS ile Otomatik deployment yapmak Spring Boot Tutorial Sql server icin maliyetli sorgularin tespit edilmesi Arama Motoru Optimizasyonu (SEO) My installed mac apps

Host ASP.NET Core on Linux with Apache

Apache is a very popular HTTP server and can be configured as a proxy to redirect HTTP traffic to kestrel. We will learn how to set up Apache on CentOS 7 and use it as a reverse proxy to welcome incoming connections and redirect them to the ASP.NET Core application running on Kestrel. We must install the mod_proxy extension and other related Apache modules.

1. Connect your linux server with

$ ssh root@123.123.123.123

2. Install Apache

$ sudo yum update -y
$ sudo yum -y install httpd mod_ssl

3. Install and enable the .NET SDK

After registering with the Subscription Manager and enabling the .NET Core channel, you are ready to install and enable the .NET SDK.

In your command prompt, run the following commands:

$ yum install rh-dotnet20 -y
$ scl enable rh-dotnet20 bash

4. Create your app

$ mkdir /app/web
$ cd /app/web
$ dotnet new mvc -o dotnet-mvc
$ cd dotnet-mvc

5. Run your app

$ dotnet run

6. Configure Apache for reverse proxy

Create your apache configuration file in this location

$ cd /etc/httpd/sites-available
$ touch mydomain.com.conf
$ nano mydomain.com.conf

insert below text in your configuration file

<VirtualHost *:80>
  ServerName www.mydomain.com
  ProxyPreserveHost On
  ProxyPass / http://127.0.0.1:5000/
  ProxyPassReverse / http://127.0.0.1:5000/
  ErrorLog /var/log/httpd/mvc-error.log
  CustomLog /var/log/httpd/mvc-access.log common
</VirtualHost>

7. Run Apache

$ sudo service httpd configtest
$ sudo systemctl restart httpd

if you get an http-503 error, you can run below command

sudo setsebool -P httpd_can_network_connect on

8. Monitoring our application

you can see httpd logs with tail

$ tail -f /var/log/httpd/mvc-access.log   
$ tail -f /var/log/httpd/mvc-error.log
Date: 2017-11-23 10:20:00 +0000