Ruby: hide WEBrick httpd version - version

I'm using OpenVZ Web Panel to manage my VPS servers and when I scanned my server with nmap I saw:
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 6.0p1 Debian 4 (protocol 2.0)
135/tcp filtered msrpc
139/tcp filtered netbios-ssn
445/tcp filtered microsoft-ds
3000/tcp open http **WEBrick httpd 1.3.1 (Ruby 1.8.7 (2012-02-08))**
Service Info: OS: Linux; CPE: cpe:/o:linux:kernel
How do I hide the **WEBrick httpd 1.3.1 (Ruby 1.8.7 (2012-02-08))**?

Late to the party as I am, I encountered this question so I might as well answer it. I don't find your requirements entirely clear, so I'll give a conditional answer:
If you don't want WEBrick to be visible at all, remove or comment its virtual host entry
If you don't want WEBrick to be running on :3000, you have two choices:
Change the virtual host entry so that it listens on :80 instead
Put nginx in front of it, proxying somedomain:3000 to 127.0.0.1:80 and change WEBrick's virtual host entry so that it listens on 127.0.0.1:80 (you will need a domain name pointed at this machine)
If you want WEBrick to be running but only accessible locally, change its virtual host entry so that it listens on 127.0.0.1:3000
You cannot have WEBrick running and publicly accessible without nmap being able to discover it, because nmap discovers it the same way any client discovers it: by attempting to establish a connection with the indicated IP address and port.

Related

how to self-hosting a website on ubuntu 18.04 system and using lampp server?

I'm trying to self hosting a website on ubuntu 18.04 system and using lampp server. i can not access the site through my public ip address. can anyone help me out?
i have also created a virtual server in my router. but till something is wrong.
you can do that by logging into the router which provides you the internet …
then make port forward to all the requests that coming from external under port 80 ( which is the http browsing port ) and forward it to the IP which has your ubunto OS …
you may as well add RDP connection if you have windows , in short , you will have to find the responsible port which works for each protocol and then forward it to your ubunto OS
like https , will work under 443 so you may as well forward it if you wan your website to work securely as https .
as for the domain name … you may use services fore free like DYN.com or noip.com
some routers btw can accept logins directly from dyn and noip and other similar websites which provide the dynamic hosting service .

Not able to access a port on ec2 instance for an Angular app

I am working on an angular app using the angular cli to set things up. Running the ng serve command spawns a server at this address <my_ec2_host_name>:4200. When I try to access the page on the browser it doesn't work (connection timed out error). I believe this is because of security reasons so I added the following rule to my security groups for the ec2 instance:
Port 4200 should now be accessible but I still can't get the page to load. Can someone think of how to get this to work?
Start angular with below command.
ng serve --host=0.0.0.0 --disable-host-check
it will disable host check and allow to access with IP
You can set up the host option like this:
ng serve -host 0.0.0.0
The steps you are doing are correct for opening a port via Security Groups in the EC2 console. Make sure you are modifying the correct security group, and make sure that your changes have been saved.
Your container may have additional firewalls in place, so you will want to check the OS documentation. For Example, RHEL uses iptables as a further security measure: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Security_Guide/sect-Security_Guide-IPTables.html.
That looks correct. Are you sure that your server is running and listening for connections?
You should ssh to that server and verify that the page can be loaded locally. Eg:
curl http://<YOUR HOST IP ADDRESS>:4200
eg: curl http://54.164.10.123:4200
You should be careful to use the public ip address (eg: IPv4 Public IP when you're in the EC2 console). I've run into problems in the past where I've got a server listening on one IP address (often localhost) and not the public ip address.
Also maybe a problem: Is your host inside a VPC of some sort?

How to use local macbook server to allow multiple devices to view Reactjs page?

I have a local server running Reactjs on my Macbook. (newbie in React)
1) How could I change the http://localhost:4001 name to something else (e.g. http://www.test.com)
--> I'm using webpack-dev-server --port 4001
2) How could I allow up to 500 iOS/Android device to connect to this local server? (e.g do how to setup a router to broadcast this?)
--> Found this ReactJS-and-ngrok but not sure what's the concurrent users it's able to support.
3) How to allow the device to connect to a wifi without internet access?
First, see what IP is your Macbook in your local network. System Preferences->Network. Suppose your Macbook IP is 192.168.1.70 and your server is on 4001 port. Then you can start your webpack-dev-server with the following options: --output-public-path="http://192.168.1.70:4001/" --host="0.0.0.0" --public="192.168.1.70:4001". You can still access it via localhost name on Macbook, but on other devices use full IP + port number as address.
Can't say anything about setting domain... may be you can configure your router somehow? Sorry, newer had to face such a task

Public LAMP with a modem and router

I am using an Apache2 with a PHP and MySQL installed on Ubuntu. What I would like to do is to run the server public, to access it from outside my network.
However, I am having trouble configuring it, since I am using a ZyXEL P660HW-T3 v2 ADSL Modem with an IP 90.xxx.xxx.xxx together with an ASUS RT-N16 Wi-Fi router with the LAN address 192.168.1.1.
Could someone help me to set up the configuration file correctly to make the server public?
You need to configure your router to forward port 80 from the WAN interface to 192.168.1.1.

How to respond requests with the windows host file?

Using the windows host file located in
windows/system32/drivers/etc/host
Is it possible to respond a request from an application like when it is offline(not connected to the Internet)? Could you please give an example of this is done.
The hosts file only lists aliases for ip-addresses. For example:
192.168.0.1 foo bar foo.com bar.com
If that line is in the hosts file, then you can use the host-names foo, bar, foo.com and bar.com to reach the computer with ip-address 192.168.0.1.
If the computer, or the service you want to reach on that address, is not online, you can't reach it no matter what you have in your hosts file.
If you are willing to map your local development environment to a domain name, you can edit the domain name in hosts file and map it to 127.0.0.1, which is the loopback address.
That way, any requests done to that particular domain will fallback to your local machine.
You can also assign different LAN/WAN IP addresses.
When your development phase is done, you can remove the entry.
I would not recommend doing so, stick with the localhost and just make use of that to test virtualhosts setup or some sort of domain based configurations.
If there is anything else I can answer, please don't hesitate to post further comments on my answer.
If you mean to respond to HTTP requests then you need a Web Server configured to respond to any host (or that specific host name) on port 80. If you are not using it for anything else IIS can do this1 – configure it to return 404 (not found) or some other relatively neutral fail response.
1 If IIS is already being used then things get much harder, later versions of IIS are more flexible either with a combination of using HTTP.SYS to allow other applications to respond to certain URLs or using different Web Sites in IIS (until Windows 7, or maybe Vista, only available on Server editions of Windows).

Resources