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

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 .

Related

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.

Ruby: hide WEBrick httpd 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.

Restrict selenium 2 port - localhost only - no external IP access

I have a headless setup in a VPS where selenium server can run - without X server. However, the selenium port is accessible via port 444 across the internet.
Is it possible so that only localhost:4444 is only allowed and external access is not allowed? Be it selenium command line option or firewall/ip table option.
I usually let the port 4444 open like 2-3 hours while doing testing and I'm afraid of being attacked on that port.
I'm using selenium-server-standalone-2.32.0.jar and behat+mink.
Thanks
Why not trying to close port on WAN interface using iptables or equivalent ?
If you and only you, need to access it using internet, consider setup a VPN.

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