How to sequence an webserver like nodejs or kestrel in app-v? - webserver

i need to have a webserver in an app-v container.
I could not find examples how to sequence and configure a webserver with app-v.
Are there examples available for sequencing e.g. nodejs or even .net core webserver kestrel?
Thank you for the help.
Simon

Never seen a web server packaged with app-v, but I've used app-v seldom, so I may be wrong.
Solutions like Docker are much more suitable for web apps virtualization.

Related

REST Server without GUI

I've started working with delphi quite some while ago but I would say I'm still a newbie in all this.
So basically I tried creating REST Server, which can validate license keys. I got in working with Indy, but one thing bothers me. The GUI. The Server shouldn't have any kind of gui so it can work on any OS (Win, Linux, etc). Is there a way to make a REST Server without any GUI/FMX/VCL?
BTW: Working in Delphi 10.2.3 Professional.
Any advice is appreciated.
EDIT: I forgot to mention one thing: the server is supposed to run on an independent Data Center away from any user.
You can create the WebServer as a Windows Service.
You can use DelphiMVCFramework or any other Framework to create it.
With DMVC you can create console application, Windows Service, Linux daemon, Apache module (Windows and Linux) and IIS ISAPI (Windows).
With Intraweb you can also create Services.
Take a look at our mORMot Open Source REST framework, which works on Delphi but also on FPC/Lazarus.
FPC support ensures that you can target Linux with this free compiler. No need to upgrade to a newer version of Delphi Architect, which supports Linux, and is very pricey - and less stable (to my knowledge) since Linux support is quite new.
As you requested, the mORMot REST server has no UI part. You define your services as interface and class - like you do e.g. with DotNet - and you will have full JSON/REST support generated.
mORMot is used on production since years for very high performance and stability, hosted on both Windows and Linux. A version 2 is on its way, which would be even easier to use for new projects.
And you can create a Windows service or Linux daemon without using any third party framework. Delphi include everything you need. However, it is possible that third party framework will facilitate your programming. Don't forget you'll have to learn those third party framework.
Creating a Linux daemon service in Delphi
Creating a Windows Service in Delphi
In both cases, you can use the sample code you've found that make use of TIdTCPServer.

Material on Building a REST api from within a docker container

I'm looking to build an api on a application that is going to run its own docker container. It needs to work with some applications via its REST apis. I'm new to development and dont understand the process very well. Can you share the broad steps necessary to build and release the APIs so that my application runs safely within the docker but externally whatever communication needs to happen they work out well.
For context: I'm going to be working on a Google Compute VM instance and the application I'm building is a HyperLedger Fabric program written in GoLang.
Links to reference material and code would also be appreciated.
REST API implementation is very easy in Go. You can use the inbuilt net/http package. Here's a tutorial which will help you understand its usage. https://tutorialedge.net/golang/creating-restful-api-with-golang/
Note : If you are planning on developing a production server, the default HTTP client is not recommended. It will knock down the server on heavy frequency calls. In that case, you have to use a custom HTTP client as described here, https://medium.com/#nate510/don-t-use-go-s-default-http-client-4804cb19f779
For learning docker I would recommend the docker docs they're very good and cover a handful of stuff. Docker swarm and orchestration are useful things to learn but most people aren't using docker swarm anymore and use things like kubernetes instead. Same principles, but different tech. I would definitely go through this website: https://docs.docker.com/ and implemented on your own computer. Then just practice by looking at other peoples dockerfiles and building your own. A good understanding a linux will definitely help with installing packages and so on.
I haven't used go myself but I suspect it shouldn't be too hard to deploy into a docker container.
The last production step of deployment will be similar for whatever your using if it's docker or no docker. The VM will need an webserver like apache or nginx to expose the ports you wish to use to the public and then you will run the docker container or the go server independently and then you'll have your system!
Hope this helps!

What are the main web server types, and the documentation on the files and programs to configure them?

I already know enough about the Apache HTTP Server, but what are the other most popular web server types? And where I can get the programs and documentation on how to set them up?
that depends on which OS you are using.
in Linux the apache http in all his forms ( tomcat/catalina/httpd ) is the most common , afterwards the nginx is also quite common.
I am less familiar with windows but I think IIS is the most common in windows.

Installer for Software? Paas?

currently I'm looking for an open source project that gives me the opportunity to install software easily. I prefer direct calls or access with a REST interface.
I thought that CloudFoundry would fits my needs but it is'nt so.
AppFog (https://www.appfog.com/product/) comes much closer to my goal. It allows me to install Drupal, Wordpress, PhpMyAdmin, NodeJS Apps and so on.
The conclusion is that I'm looking for an project that...
is open source.
gives that possibility to install, configure and
uninstall software
is extendable when a specific software not
available
is accessible with an interface like REST.
is "hostable" on my own linux server
I would be happy for all kind of hints and tips :)
Cheers Tobias
Docker is seems to be the next big thing in the PaaS world. There are dozens new projects that build on top of docker or supporting it. For example OpenShift and Apache Stratos support docker. So if you look at solutions based on docker you can find a solution for you needs.
Right now I'm using docker for hosting couple of Drupal websites with simple bash scripts to manage them. Nginx is used for web traffic routing
Docker is open source
Gives you ability to prepare and install apps
You can build what you need on top of it
It has REST interface
It is running on nearly all major Linux distros
Its relatively easy to learn and use
Has great community
Tobias,
Suggest you look at Apache Stratos:
100% open source
Easy to Get Up and Running
Highly extensible, flexible, expandable
Uses REST APIs
Runs on Linux (Ubuntu or SUSE)
Mature (version 4)
See:
Intro article -- "Why Apache Stratos is the Preferred Choice in the PaaS Space"
http://wso2.com/library/articles/2014/05/why-apache-stratos-is-the-preferred-choice-in-the-paas-space/
Apache Stratos Project site -- which notes that "Stratos PaaS is easy to get it up and running in quick time. A developer will be able to run and test PaaS framework on a single machine to try out."
http://stratos.apache.org/
Cheers,
Michael
OpenShift is what you looking for :
it is open source and free for 3 gears for ever.
gives that possibility to install, configure and uninstall software in openshift.redhat.com or in rhc client tools.
it is extendable when a specific software not available is accessible throw DIY(Do it yourself)
with an REST interface
is "hostable" on Fedora or CentOS .
It is really easy to setup throw Eclipse.

Deploying Sinatra app .rb

I know this is probably a stupid question. But I created a .rb file with Sinatra framework and I am not sure how to "deploy" it. When I posted the file on the server I just get a simple text file that reads back my code. It works great when I run it with Sinatra.
Thanks in advance!
It looks like your web server (Apache?) is just serving you with your Ruby script (that is a text, ASCII file) instead of running it (that is: instead of passing it through the Ruby interpreter).
Hence:
Is the Ruby interpreter installed on your server?
Is your web server configured to run Ruby scripts (files terminating with ".rb")
through the Ruby interpreter?
And, is Sinatra itself installed on your web server?
Anyway, Ruby applications (Rails, Sinatra, Padrino) are usually deployed to a server using GIT. Have a look at Heroku and Engine Yard.
Also, there are tools specifically designed to help the developer in deploying Ruby applications. Have a look at Capistrano or Vlad and/or Google for "how to deploy a sinatra application".
For Sinatra/Rails/etc, most people use a Webserver (ie Apache, Nginx, etc) AND an Application Server (Thin, Passenger, Unicorn). For a simple app these can live on the same host. The webserver manages the incoming traffic and the application server executes the ruby code and passes results to the webserver.
When you execute ruby app.rb to run your Sinatra application, you're actually loading up WEBrick which is an application server. Since your development machine is local, you can access it directly at localhost:3000 or some similar address.
Look into tutorial on setting up your webserver with Thin, it's one of the easier ones to work with. When/if you outgrow it, then look into Unicorn.