How to access local web server from another computer - linux

I know this may be asked in different threads, but I really couldn't find a solutions for my simple problem.
I have a web server (Ubuntu) on port 4000 running and I want to access it from my second computer (same network). I don't mind if it's exposed to the Internet (it's only temporally).
I can ping the web server computer, but port 4000 is not reachable.
Can some give me a simple solution for this problem? That would make my day.
EDIT:
I run jekyll serve
EDIT:
Okay I found a really helpful blog entry for solving my problem.
link

If you are running Apache2 webserver edit your configuration like this:
From:
Listen 127.0.0.1:4000
To:
Listen 4000
See https://httpd.apache.org/docs/current/en/bind.html for reference.
Configuration examples for nginx are available here: https://nginx.org/en/docs/http/ngx_http_core_module.html#listen
Restart/reload your apache2 or nginx service to apply configuration changes.
Your webserver is now reachable through http://[webserverip]:4000

Related

IIS Manager Error - Unable to bind to the underlying transport for [::]:80.The process cannot access the file because

I know that this question has been asked in multiple forums and have several versions of the answers.. Unfortunately, none of those answers helped me out to resolve my issue.
I stood up an AWS EC2 instance of Windows Server 2016 and installed IIS, MSMQ, Windows Process Activation Service and few other things.. When I cracked open my IIS Manager, I noticed that the "Default Web Site" is stopped and when I tried to start it I get an error "The process cannot access the file because it is being used by another process (Exception from HRESULT:0x80070020)". Tried to dig a little more and found these two exceptions in my Event Viewer:
Unable to bind to the underlying transport for [::]:80. The IP Listen-Only list may contain a reference to an interface which may not exist on this machine. The data field contains the error number.
The World Wide Web Publishing Service (WWW Service) did not register the URL prefix http://:80/SmsHandler for site 1. The site has been disabled. The data field contains the error number.*
Researching more online I found more than 2 dozen articles on this issue and more than 95% of them saying that the potential application that might be conflicting with IIS and using port 80 and 443 could be Skype.. But I DON'T HAVE SKYPE installed on my server..
I ran the "netstat -aon" command and found this:
C:\Windows\system32>netstat -aon | findstr :80
TCP 169.254.170.2:80 0.0.0.0:0 LISTENING 1164
Going by what's mentioned in other articles online.. I tried to trace down the PID - 1164 in my Task Manager and found that its the "Service Host - Local System" process having 15 System services running into it.. There's no way I can kill that process to make my IIS work..
I then tried to change the Bindings in my IIS to listen on a different port than 80 and was able to get it up and running.. But I don't want IIS to run on any other port than 80 since I don't want the user to specify the port in the URL every time when they hit the website..
I'm now running short of ideas here.. Any suggestions would be greatly appreciated.
Thanks!
I ran into a similar issue, but not with port 80. In my case it was because the ip address [::] wasn't allowed to listen on any port. Adding it to the ListenOnly list in the registry fixed the issue.
From an admin command prompt:
netsh http add iplisten ipaddress=::
From this thread.
Found the culprit.. It apparently wasn't skype for me (as it is in most of the cases), it was this service called IP Helper which was running on port 80 and was conflicting with IIS. The way I found that out was, I checked all the services running under the PID for Service Host - Local System (which in my case as 1164) and started stopping them one at a time and saw if IIS starts working.. Just wanted to close this thread.. Hope this helps if someone else get stuck with the same issue.
I had VMware Workstation installed, the solution is: "VMware -> Edit -> Preferences -> Shared VMs -> "Disable Sharing".

nginx Ubuntu nodeJs - Server only handles requests from local network

I followed all kinds of instructions all day to get my first server up and running. I tested it on 3 devices and thought I had it... until my friend tried it and discovered "site can't be reached."
In double-checking on my end, I found that if I disconnected my phone from wi-fi, sure enough, I couldn't reach my server.
I realize there could be a million things wrong, but I don't know where to start. I am not even sure what additional information I should include to help find the issue. If I had to guess, I'd say I failed to open the firewall on my server port 80. But I really have no clue. Ubuntu is new to me.
Can you include details about your setup? How is the Ubuntu server configured? If it's your own hardware, have you forwarded the ports on your router? Do you have a Dynamic DNS server in place? Is there an internal firewall (ufw?). Is the Node.js server bound to the loopback? Is Nginx in proxy_pass mode?
As mentioned by the OP, the ports weren't forwarded.

How do I get acces to server running on Bluemix Paas?

Few days ago I wanted to launch my own Agario server. I assumed not to spend any money on hosting/vps etc. After a long search I found Bluemix PaaS, I put open source Agario clone Ogar (https://github.com/OgarProject/Ogar) in them and server has already started in 1523 port, but when i try to connect to this server via agario site ( connect("ws://appname.eu-gb.mybluemix.net:1523") ) I can't connect. I tried also other ways e.g. prepared agar.io link (agar.io?ip=appname.eu-gb.mybluemix.net), but nothing worked.
Has anyone met similar problem?
Inbound traffic is only on standard HTTP/HTTPS ports 80/443. Bluemix will tell your application what port to listen on with the VCAP_APP_PORT env variable. Inbound requests are then mapped to that port. So, once you bind to the VCAP_APP_PORT port, you should be able to connect to : ws://appname.eu-gb.mybluemix.net

cant hit ghost blog on remote server (Failed to load resource: net::ERR_CONNECTION_REFUSED)

I've installed ghost as per the instructions on the official documentation: http://support.ghost.org/installing-ghost-linux/
When I run ghost in development or prod mode, I get this output:
Ghost is running in development...
Listening on 127.0.0.1:2368
Url configured as: http://localhost:2368
Which is exactly what I expect. Now my remote server has an ip of something, lets say 123.456.68.1. I should be able to hit the running ghost server by going to http://123.456.68.1:2368 right? Well when I try doing that I get this error:
Failed to load resource: net::ERR_CONNECTION_REFUSED
What am I doing wrong? Please help!
NOTE
If I run a node server on port 80 I can hit it by going to 123.456.68.1. For somereason I cant hit the ghost server.
Without some more details on where your server is ect this is a bit hard to answer.
First check to ensure that your server socket is bound to the correct interface. The fact that it is saying it is on 127.0.0.1 may mean that it is bound to the loopback interface and this means that you can't connect to it from another machine. Run the following to check:sudo netstat -ntlp. If this shows your process bound to 127.0.0.1 then this is likely the problem. You can fix it by passing 0.0.0.0 in the listen call: connect().use(connect.static('public')).listen(3000, "0.0.0.0");
If that isn't the problem then it is likely that you network setup is the problem. There are many places here it could be. Firewalls, routers, port forwarding configurations ect. If the above doesn't work then we will need to know a little bit more about your setup to help further.

Hosting Ghost blog without NginX or Apache

I've decided to take the plunge and make my next blog in Ghost 0.4.1 rather than Wordpress. My client has a VERY small amount of traffic, and it is easy to say that they will never need to be load balanced across multiple servers.
My question is:
Ghost can be configured to listen to a certain port, so can I use it as my web server listening to port 80? Is there a problem to doing this?
Followup Question:
Every example shows hosting it with Apache or NginX, is there a security or performance reason for this?
Thanks in advance!
You definitely can run Ghost on port 80 but it is recommended to run Ghost on port 2368 and proxy requests through Apache or Nginx.
You can checkout this article for an example of how to install Ghost and run it on port 80. But I would highly recommend reading through this article and proxying requests through Nginx. With Ghost running on port 2368 you can use a low privileged user to start Ghost and therefore will not have to use a higher privileged user to start Ghost.
Yes. But you must run Ghost under root privilege or add ghost to sudoers
server: {
host: '0.0.0.0',
port: '80'
}
I tried and it worked.

Resources