Running python -m http.server does not load localhost - http

Previously when I ran the python -m http.server command from a folder it would show the link as something like "http://localhost:5500", but after I accidentally installed npm install http-server it no longer correctly shows localhost and instead shows something like this
Serving HTTP on :: port 8000 (http://[::]:8000/) ...
Is there any way to fix this back to localhost? The http://[::]:8000/ does not work and I get the error "This site can’t be reached"

Related

Website available even with no NGINX processes running

I have pulled into my web server so it has the latest code from my repo, i try to restart nginx - this doesnt do anything.
So I try the command
sudo nginx -s stop, and get the response that its failed because there is no such file or directory "run/nginx.pid" failed.
Trying to run the command ps aux | grep nginx gives me the response: unsupported option (BSD syntax) -- it actually comes out as ps aux > grep nginx in the digital ocean console.
Basically it seems that even though there are apparently no nginx processes running (although the command to check isnt working) my website is still running and using the old code, is there a way for me to check more definitively on the running processes?
Thanks if you can help.
Try sudo netstat -plunt to check if there's any nginx process running. See if there's anything running on port 80 or 443 and then look at the corresponding program name. You might have another server running possibly apache since it ships by default with most distributions which may be why nginx failed to start.
Another reason why it won't start might be due to faulty config. Go to /etc/nginx/ and double check that it's correct. You can also run sudo nginx -t to ensure that the config syntax is correct.
Alternatively, just check your nginx access log to see if it's actually serving any requests. You can also check the error log to see why it might fail to start. These resides in /var/log/nginx by default or check your nginx.conf for any custom path to logs.

Rsync command not working

I am trying to run rsync as follows and running into error sshpass: Failed to run command: No such file or directory .I verified the source /local/mnt/workspace/common/sectool and destination directories/prj/qct/wlan_rome_su_builds are available and accessible?what am I missing?how to fix this?
username#xxx-machine-02:~$ sshpass –p 'password' rsync –progress –avz –e ssh /local/mnt/workspace/common/sectool cnssbldsw#hydwclnxbld4:/prj/qct/wlan_rome_su_builds
sshpass: Failed to run command: No such file or directory
Would that be possible for you to check whether 'rsync' works without 'sshpass'?
Also, check whether the ports used by rsync is enabled. You can find the port info via cat /etc/services | grep rsync
The first thing is to make sure that ssh connection is working smoothly. You can check this via "sudo ssh -vvv cnssbldsw#hydwclnxbld4" (please post the message). In advance, If you are to receive any messages such as "ssh: connect to host hydwclnxbld4 port 22: Connection refused", the issue is with the openssh-server (not being installed or a broken package). Let's see what you get you get for the first command

Why can't I access a host port from my Docker container?

I've read this post which asks the same question, but the solutions there don't seem to work. Basically I'm trying to access a port on the host os from inside the docker, and I'm using the --net="host" flag as suggested in the linked post. However, I'm still unable to access the port. The only thing that works for me is to run my host web service on 0.0.0.0 and then access it from 192.168.###.###, but that address changes based on what Wifi I'm on, so I don't want to do that. Here's what I've tried:
Set up a test webserver that I can try to access from inside the container:
bash-3.2$ echo hi > index.html
bash-3.2$ python -m SimpleHTTPServer 1234 >/dev/null 2>&1 &
[1] 57942
Curl it from the host to make sure it's running:
bash-3.2$ curl localhost:1234
hi
Start up a container that has curl installed (this is just ubuntu + curl):
bash-3.2$ docker run --rm -it --net="host" tutum/curl bash
Try curling from inside the container:
root#moby:/# curl localhost:1234
curl: (7) Failed to connect to localhost port 1234: Connection refused
I am on macOS, so I'm thinking it might have something to do with the container's host being boot2docker rather than my mac, but I still don't know how to mitigate this.
Any advice would be much appreciated! :)

Command run on bash but not from nginx conf exec

So I just build a media server using NGINX and NGINX-RTMP by arut, using this docker image here. The server works great, I can stream RTMP and view in HLS.
What I want to do now is taking a screenshot periodically, found this npm module that can do the thumbnail generation.
The strange things is, when I tried execute it from the nginx.conf, it won't work. I tried running the command manually from the docker bash and it runs smoothly.
This is my nginx.conf, you can download it here
Forgot to add env PATH inside the nginx.conf file. So that doesn't recognize the command.

curl can't connect to only certain HTTPS hosts

I am trying to install Meteor.js on a VM (Ubuntu 12.04) created with Vagrant.
The install should be as simple as:
curl https://install.meteor.com | /bin/sh
However this fails with curl: (7) couldn't connect to host
I have isolated the failure to a request within that shell script to this URL:
https://warehouse.meteor.com/bootstrap/0.7.0.1/meteor-bootstrap-Linux_i686.tar.gz
When I changed it to use HTTP instead of HTTPS it works. However I am running into problems elsewhere where it needs to pull things from httpS://warehouse.meteor.com/...
I thought the problem was with https, but if I do:
curl https://google.com
I get the page no problem, so what could be the issue?
Per another Ubuntu/Meteor question, it appears that there's some kind of certificate error (Meteor's SSL CA may not be installed by default in Ubuntu?) that goes away when you:
sudo apt-get update && sudo apt-get upgrade
For me upgrade didn't solve the problem.
My solution was to download the script from install.meteor.com and replace TARBALL_URL from https to http and I ran the script manually.

Resources