Configure mosquitto broker on windows to available in the network - windows-server-2012

I am currently starting to use MQTT (and mosquitto as a broker) for a home automation project.
I installed mosquitto using the .exe from the homepage on my windows server and I can run it as a service or by directly starting the .exe. Using the _sub and _pub programs I can also publish and suscripe to messages.
Awesome ;)
But (at least by using the standard config) I can't connect from other system in the same LAN. I tried using the said _sub and _pub programs and mqtt-spy, but none of them is able to connect.
Is this a problem with ports and the firewall or with the configuration? I can't find any answers for this only and would be grateful for any help!
If you need any more infos just ask.

Ok it was a firewall problem I guess. I changed the config to:
bind_address #ipAdress
port #Portnumber
of course the # fields are the numbers. Then I created 2 rules to allow incoming and outgoing pakets for the mosquitto.exe to pass the firewall. Now it works.
If anyone has more settings/explanation thats usefull, please answer here! There is not a lot of usefull explanation for this on the web.

Related

Deploy ReactPHP on PHP host

I use the example for the chat server in ReactPHP. My server listens on port 8080
$socket = new React\Socket\Server(8080, $loop);
$server->listen($socket);
in my local PC. The written code is working correctly but when upload files into my Linux host, nothing works. I wrote a ticket to the support team from my hoster, they said that this is not possible in Linux. Is that correct?
ReactPHP core team member here. Your run-of-the-mill shared hosting won't be able to host this. You need your own server, VPS, or bare metal, to run ReactPHP as a server because you're dealing with a daemon process. And shared hosting generally doesn't support that.
My suggestion is to get a VPS somewhere and look into Supervisor to keep your process running and restart it when something happens to it. This also requires you to manage your own server with all the firewalling and networking knowledge that comes with it.

Setup Node-JS to run as a website without a port on a windows machine with apache

This has been a very difficult thing to investigate as well as configure, everyone oneline just have half documentation, for some reasons everyone is concentrated on the running of nodejs on the commandline, or if not, they want to run it on http://localhost:8080.
What I need is a full documentation from installation, configuration, vhost setup, to running a nodejs website such as http://node.local/ website on my work machine.
Please assist, I have been googling for 3 days on this, have not found anything, I need to setup http://node.local website fully running nodejs.
Use proxy http server. For example nginx is pretty easy to configure.
And it will proxy requests from port 80 to port 3000, for example.
Here you can find quick guide to setup one.

Setting up a web server for access outside of subnetwork (Node.js, Nginx maybe, Ubuntu server)

A little bit of context. I have developped a webapp on node.js (and a glamourous set of extensions). It has been approved for testing with true users at my company and i am supposed to deploy it now. Problem is that basically i have no idea unto how attack this problem. I have so many questions.
For the moment i have created a virtual machine on the local server. I have installed ubuntu server unto it and i have the intuition about how to deploy the app in this part (i suppose following the same steps as when i started to work on this project). I do not know however if i can have remote access from the outside of my network to this virtual machine. I also dont know if additional configuration in ubuntu's side is needed to make such an idea work (for example: in the installation there was a part about proxies that at the moment i decided to ignore)
From the few documents i have read about it since i was assigned this, a solution may lie in using nginx. The logic behind it if i am not mistaken (and please correct me if i am) is that nginx can help linking the HTTP requests (through the port 80 which is normally opened for access in most machines) and link it to a specific port on the machine (The sexy app i have developped).
In a more early stage, what ressources would i need to start this off? Would i need a domain name? IS it necessary? Do i need a different virtual server to link the apps or can they be on the same machine?
If you have additional comments or tips for someone that is learning to do this kind of thing, please do.
For remote access, you will need a couple of things. First of all, you will need to make sure that your virtual machine is on a bridged adapter. I'm not sure what virtual machine you are on, or I'd give you more detail on how to do this. Second, you will need to make sure that your router has port 80 (or whatever port you chose to use) setup via port forwarding so that requests coming in map to the server (a request comes to the router on the port, the router must then know where to send those requests to). Finally, if you want to use a port other than port 80, you should be able to configure this in the nodejs configuration. This may also be configurable in the router so that requests coming in on port 80 are mapped to, say 8080, but, given that this is a company, it's probably easier to reconfigure the nodejs server than have it set up special mapping.
This experience comes from personal experience with hosting web servers at home. Corporate routers should need similar configuration unless each system has a public IP address on the internet, which is unlikely.

Cannot access websites on apache from outside the server

I have a debian 7.5 based Ubuntu server, apache 2.2.22.
It's a rather vanilla installed XAMP used as a basic web server.
It used to work fine and I have no idea why it stopped working suddenly (there was some maintenance today but it worked when I left it - I changed partition sizes with Gparted).
When I try to access a website from the server (tried with w3m) all is working OK, including PHP and MySQL access.
When I try to access the same host (using a domain) from the outside, the browser keeps loading for a long while, eventually (after few minutes) saying the page could not be loaded.
I made sure that ports are open and accessible with outside scanner.
So I'm sure the Apache is available (working from inside the network, websites loading from SSH using w3M and pinging)
I'm sure the server is connected to the web (I can use putty to SSH)
the host is resolving to the correct IP (but won't ping from outside, only inside)
The ports seems to be opened (scanned and got OK for port 80)
I'm not a professional IT, so If there is info I can add that could help just ask away.
would really appreciate any idea or direction.
Thanks!
I still suspect the UFW/iptables firewall is blocking all incoming connections... Please go through this article and double check
http://www.cyberciti.biz/faq/ubuntu-server-disable-firewall/
If you're sure that the firewall config is OK, please try packet capturing with Wireshark to see what's going on underneath.
http://www.youtube.com/watch?v=sOTCRqa8U9Y How to install
Thanks for the help,
Oddly enough - It just started working again after 12 hours of not working.
A friend of mine, an IT person just called to try and help, and he simply connected (5 mins after I tried) and said it's all working for him.
I tried, and it's working for me also.
Have no idea why it stopped working, and why it is working now.
I think it might be an ISP problem or a router issue... The server is in our offices so I guess it could be both. I just don't understand why SSH would work and HTTP wouldn't.

Is it possible to run DNSCrypt server on myself?

OpenDNS introduced DNSCrypt, and they runs the server in their OpenDNS server.
http://www.opendns.com/technology/dnscrypt/
And the client program is opensourced:
https://github.com/opendns/dnscrypt-proxy
This is significant for network environment that is censorship-ed, like China.
But OpenDNS servers are quite slow responsive to China, I hope to setup a DNSCrypt server on my own server, but can find nothing like that.
Does anyone know about if the DNSCrypt server part opensource or not ?
Many other servers are supporting the protocol, and it is easy to add it to your own server as well.
See the DNSCrypt implementations section of the documentation for some information.
Most of the servers, if not all, use encrypted-dns-server, either directly or via the DNSCrypt docker image.
The dnscrypt-proxy client also includes step by step instructions to install a dnscrypt server on a VPS.
Another option is PowerDNS dnsdist.

Resources