how to configure component pubsub to tigase server in ubuntu machine(localhost)? - linux

I have installed tigase server in my linux machine.
After successfully installed tigase i found following in etc/init.properties.
--user-db = mysql
--admins = admin#username
--user-db-uri = jdbc:mysql://localhost/tigasedb?user=tigase&password=tigase12
config-type = --gen-config-def
--virt-hosts = username
--debug = server
Now, I want to install pubsub component with already installed server.

You need to reinstall with advance configuration options instead of basic installation.
You will get options for which component you need to configure with server.

Related

Stack fails to download any ghc

I am renting a Ubuntu server. I want to execute a build on it, but Stack is failing to download the GHC. I could not found any solution on the internet. I also tried to downgrade Stack, but that fails when trying to download GHC. Can you help me? Do you have a solution or workaround for that?
stack install
Preparing to install GHC to an isolated location.
This will not interfere with any system-level installation.
Preparing to download ghc-8.10.3 ...
Download expectation failure: HttpExceptionRequest Request {
host = "downloads.haskell.org"
port = 443
secure = True
requestHeaders = [("User-Agent","The Haskell Stack")]
path = "/~ghc/8.10.3/ghc-8.10.3-x86_64-deb9-linux.tar.xz"
queryString = ""
method = "GET"
proxy = Nothing
rawBody = False
redirectCount = 10
responseTimeout = ResponseTimeoutDefault
requestVersion = HTTP/1.1
}
ConnectionTimeout
Thank you for your time.
I suspect that this is an issue with the firewall settings on the rented Ubuntu server. The industry standard is to have these very tight by default when first created. It is very likely that Stack does not have permission to create the connection it needs to download GHC. To get a more detailed answer, it would help to know more about the Ubuntu server you are renting. You also might see if you can connect to https://downloads.haskell.org with something like wget or curl.

How to configure and install nano server using DSC powershell on Windows server 2019

I have Windows Server 2019, where I want to setup Nano Server installation and Docker using DSC powershell scripts.
This requirement is for Azure VM using State Configuration from Azure Automation.
The Script
configuration Myconfig
{
Import-DscResource -ModuleName DockerMsftProvider
{
Ensure = 'present'
Module_Name = 'DockerMsftProvider'
Repository = 'PSGallery'
}
}
I know, I am missing few parameters here.. please help me in completing this script
Similarly, I need it to setup Nano server if possible.

RemoteCertificateNameMismatch when auth using SslStream on linux

I've come across some strange behaviour of dotnet SslStream, when running my dotnet-core app on linux environment.
here is the code:
TcpClient cl = new TcpClient();
cl.Connect("52.209.63.190", 443);
var ssl = new SslStream(cl.GetStream());
ssl.AuthenticateAsClient("api.bitfinex.com");
Auth result is success, when running on windows.
But same code ends with auth error (RemoteCertificateNameMismatch), when linux.
dotnet --info:
.NET Command Line Tools (2.1.4)
Product Information:
Version: 2.1.4
Commit SHA-1 hash: 5e8add2190
Runtime Environment:
OS Name: fedora
OS Version: 27
OS Platform: Linux
RID: linux-x64
Base Path: /usr/share/dotnet/sdk/2.1.4/
Microsoft .NET Core Shared Framework Host
Version : 2.0.5
Build : 17373eb129b3b05aa18ece963f8795d65ef8ea54
Why code behaviour is so different on linux?
How can I handle it and pass ssl auth?
Thank you in advance
So, you can connect to that host with
TcpClient cl = new TcpClient();
cl.Connect("api.bitfinex.com", 443);
var ssl = new SslStream(cl.GetStream());
ssl.AuthenticateAsClient("api.bitfinex.com");
I don't know how you got the IP address of api.bitfinex.com, but it's under cloudflare, and may be you don't need to connect bitfinex with his real IP address.
But if it is required to connect that special IP address, you can override verification callback before you do any connection
System.Net.ServicePointManager.ServerCertificateValidationCallback =
(sender, certificate, chain, errors) => true;
Looks like the answer is simple: too old dotnet version.
2.0 seems to have some ssl issues, which were fixed since 2.1
When I installed the newest one (2.1.3), my app still didn't work, decause I had to uninstall prev version (2.0.5) manually to be able to use 2.1.3
Now the app ends with the same result on both windows and linux environments.
Many thanks to M. Hovhannisyan. I've started trying different linux versions, and figured out what I did wrong

Using NSSM to start a NodeJs process as a windows service is not working

I have seen countless articles on how to use NSSM (http://nssm.cc/) to start a NodeJS process.
So, I have the following simple NodeJS file:
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, { 'Content-Type': 'text/html' });
res.end('<p>Hello World</p>');
}).listen(8000);
console.log('Server running on http://localhost:8000/');
I am using this command to install the NodeJS file as a windows service:
"C:\Program Files\SimpleNode\nssm.exe" install SimpleNode "C:\Program Files\SimpleNode\node.exe" "C:\Program Files\SimpleNode\simple.js"
The service is installed. When I start it I get an error message, the services is in the Paused state and I see the following error in Event Viewer:
GetProcessTimes() failed: The handle is invalid.
This should be pretty simple. I have tried using a domain account that has local admin rights. I have tried a couple of different port numbers. The app does work correctly when I start it from the command line.
MORE NOTES:
This is running on 64-bit Windows 2008 R2 server. I have made sure I am running all 64-bit executables for both NSSM and Node. I have also tried using 32-bit executables for both.
Can anyone tell me what I am missing? Can someone else replicate this issue?
Found the issue.
The problem is that is that the path to the simple.js file has a space in it (Good Old "Program Files"). You have to escape the quotes with a backslash for NSSM to interpret it correctly. The correct installation command line is:
"C:\Program Files\SimpleNode\nssm.exe" install SimpleNode "C:\Program Files\SimpleNode\node.exe" \"C:\Program Files\SimpleNode\simple.js\"
It sounds like you don't have access to ports for some reason. try setting the service to run as administrator (server Manager>Services>Servicename on windows server 2008) and see what happens.
NSSM usually works fine with Node.js so this is probably a permissions issue. Review this tutorial showing how to setup Node.js with our commercial application to troubleshoot. And feel free to use the 30-day trial too as it it may return a more helpful error message indicating what the problem is.

How to install node.js as windows service?

I have downloaded node.js executable. How can I run that executable as windows service?
I cannot use standard node.js installer, since I need to run multiple version of node.js concurrently.
Late to the party, but node-windows will do the trick too.
It also has system logging built in.
There is an API to create scripts from code, i.e.
var Service = require('node-windows').Service;
// Create a new service object
var svc = new Service({
name:'Hello World',
description: 'The nodejs.org example web server.',
script: 'C:\\path\\to\\helloworld.js'
});
// Listen for the "install" event, which indicates the
// process is available as a service.
svc.on('install',function(){
svc.start();
});
svc.install();
FD: I'm the author of this module.
I found the thing so useful that I built an even easier to use wrapper around it (npm, github).
Installing it:
npm install -g qckwinsvc
Installing your service:
qckwinsvc
prompt: Service name: [name for your service]
prompt: Service description: [description for it]
prompt: Node script path: [path of your node script]
Service installed
Uninstalling your service:
qckwinsvc --uninstall
prompt: Service name: [name of your service]
prompt: Node script path: [path of your node script]
Service stopped
Service uninstalled
WinSer is a node.js friendly wrapper around the popular NSSM (Non-Sucking Service Manager)
From this blog
Next up, I wanted to host node as a service, just like IIS. This way
it’d start up with my machine, run in the background, restart
automatically if it crashes and so forth.
This is where nssm, the non-sucking service manager, enters the
picture. This tool lets you host a normal .exe as a Windows service.
Here are the commands I used to setup an instance of the your node
application as a service, open your cmd like administrator and type
following commands:
nssm.exe install service_name c:\your_nodejs_directory\node.exe c:\your_application_directory\server.js
net start service_name
I'm not addressing the question directly, but providing an alternative that might also meet your requirement in a more node.js fashion way.
Functionally the requirements are:
Have the logic (app) running in the background
Be able to start/stop the logic
Automatically start the logic when system boots up
These requirements can be satisfied by using a process manager (PM) and making the process manager start on system startup. Two good PMs that are Windows-friendly are:
PM2
forever
To make the PM start automatically, the most simple way is to create a scheduled task with a "At Startup" trigger:
Since qckwinsvc has not been updated for a while there's a new version called qckwinsvc2 (npm, github)
It now supports args passed to the service. It also keeps a local cache so you don't have to provide a path every time you want to perform an action
Use the now arg to start the service as soon as it's installed
qckwinsvc2 install name="Hello" description="Hello World" path="C:\index.js" args="--y" now
qckwinsvc2 uninstall name="Hello"
qckwinsvc2 list
The process manager + task scheduler approach I posted a year ago works well with some one-off service installations. But recently I started to design system in a micro-service fashion, with many small services talking to each other via IPC. So manually configuring each service has become unbearable.
Towards the goal of installing services without manual configuration, I created serman, a command line tool (install with npm i -g serman) to install an executable as a service. All you need to write (and only write once) is a simple service configuration file along with your executable. Run
serman install <path_to_config_file>
will install the service. stdout and stderr are all logged. For more info, take a look at the project website.
A working configuration file is very simple, as demonstrated below. But it also has many useful features such as <env> and <persistent_env> below.
<service>
<id>hello</id>
<name>hello</name>
<description>This service runs the hello application</description>
<executable>node.exe</executable>
<!--
{{dir}} will be expanded to the containing directory of your
config file, which is normally where your executable locates
-->
<arguments>"{{dir}}\hello.js"</arguments>
<logmode>rotate</logmode>
<!-- OPTIONAL FEATURE:
NODE_ENV=production will be an environment variable
available to your application, but not visible outside
of your application
-->
<env name="NODE_ENV" value="production"/>
<!-- OPTIONAL FEATURE:
FOO_SERVICE_PORT=8989 will be persisted as an environment
variable machine-wide.
-->
<persistent_env name="FOO_SERVICE_PORT" value="8989" />
</service>
https://nssm.cc/ service helper good for create windows service by batch file
i use from nssm & good working for any app & any file

Resources