I've downloaded nginx into my debian 10 server. GCP Compute instance. When I run the command in cloud terminal to start it:
> sudo systemctl start nginx
I get this error:
> System has not been booted with systemd as init system (PID 1). Can't
> operate. Failed to connect to bus: Host is down
Really any operation with systemctl doesn't work.
How would I get nginx running? does Debian not have systemctl?
Many thanks
can try nginx directly
sudo /etc/init.d/nginx start
Related
I have done everything according to manuals from https://jfrog.com/open-source/ :
My Ubuntu version is 20.04. Since there is no "focal" in https://releases.jfrog.io/artifactory/artifactory-debs/, I've added "bionic":
$ cat /etc/apt/sources.list.d/artifactory.list
deb https://releases.jfrog.io/artifactory/artifactory-debs bionic main
Then I've installed jfrog-artifactory-oss version 7.12.6 and tried launching the service.
It has launched, but browser, connected to ports :8081 or :8082 of localhost, shows that 3 services don't start:
So, what does it need?
I came here, because I had the very same problem on docker.
I finally figured out, that inside the docker the environment variables http_proxy, https_proxy, HTTP_PROXY and HTTPS_PROXY where all set to localhost:8080. This caused the problem for me.
So when I start the docker this way, everything works as expected:
docker run --name artifactory-cpp-ce -ehttp_proxy="" -e https_proxy="" -e HTTP_PROXY="" -e HTTPS_PROXY="" -v $JFROG_HOME/artifactory/var/:/var/opt/jfrog/artifactory -d -p 8081:8081 -p 8082:8082 releases-docker.jfrog.io/jfrog/artifactory-cpp-ce:latest
On my machine, I found that libvirtd was running. It wasn't libvirtd, itself, that prevented artifactory from coming up. It was the fact that the virbr0 interface was up. It doesn't seem to be a problem bringing this interface back up after artifactory comes up.
For us this was on a Windows OS which was running McAfee Services. McAfee services listens on port 8081, same as the default Artifactory. Changing McAfee listening port was not an option for us.
I copied the JFROG_HOME\artifactory\var\etc\system.full-template.yaml, changed the name to system.yaml and searched for 8081 and changed it ( uncommented) to a different port. Restarted the Artifactory Service.
I have installed docker on windows , when I try to run hello-world for testing on docker. I get following error
Unable to find image
My computer is using proxy server for communication. I need to configure that server in the docker. I know proxy server address and port. Where I need to update this setting. I tried using https://docs.docker.com/network/proxy/#set-the-environment-variables-manually.
It is not working.
Try setting the proxy. Right click on the docker icon in system tray, go to settings, proxy and add the below settings:
"HTTPS_PROXY=http://<username>:<password>#<host>:<port>"
If you are looking to set a proxy on Linux, see here
The answer of Alexandre Mélard at question Cannot download Docker images behind a proxy works, here is the simplified version:
Find out the systemd script or init.d script path of the docker service by running:service docker status or systemctl status docker, for example in Ubuntu16.04 it's at /lib/systemd/system/docker.service
Edit the script for example sudo vim /lib/systemd/system/docker.service by adding the following in the [Service] section:
Environment="HTTP_PROXY=http://<proxy_host>:<port>"
Environment="HTTPS_PROXY=http://<proxy_host>:<port>"
Environment="NO_PROXY=<no_proxy_host_or_ip>,<e.g.:172.10.10.10>"
Reload and restart the daemon: sudo systemctl daemon-reload && sudo systemctl restart docker or sudo service docker restart
Verify: docker info | grep -i proxy should show something like:
HTTP Proxy: http://10.10.10.10:3128
HTTPS Proxy: http://10.10.10.10:3128
This adds the proxy for docker pull, which is the problem of the question. If for running or building docker a proxy is needed, either configure ~/.docker/config as the official docs explained, or change Dockerfile so there is proxy inside the container.
I had the same problem on a windows server and solved the problem by setting the environment variable HTTP_PROXY on powershell:
[Environment]::SetEnvironmentVariable("HTTP_PROXY", "http://username:password#proxy:port/", [EnvironmentVariableTarget]::Machine)
And then restarting docker:
Restart-Service docker
More information at Microsoft official proxy-configuration guide.
Note: The error returned when pulling image, with version 19.03.5, was connection refused.
After a restart of my VM instances my site is down. I checked the IP address, but it didn't change. Do you have any ideas about what is wrong and how to fix it?
I run WordPress (Bitnami) on a Debian-based OS. I use Cloudflare CDN. I understand that on stopping a VM it doesn't keep the settings. Can I restore them?
About your last error message
Syntax OK (98)Address already in use: AH00072: make_sock: could not
bind to address 0.0.0.0:80 no listening sockets available, shutting
down AH00015: Unable to open logs /opt/bitnami/apache2/scripts/ctl.sh
: httpd could not be started Monitored apache
I have found similar errors due to Nginx, it could happen if you have it installed and it is creating conflicts. make sure you remove it as follow:
sudo apt-get remove nginx nginx-common
sudo apt-get autoremove #to remove unneeded dependencies
Your environment doesn't loose configuration "settings", but rather the servers that use those configurations will terminate their processes when the VM shuts downs and will need to be restarted.
The problem is likely that you need to restart both your Apache web server (which starts the PHP runtime and proxies HTTP requests) and your MySQL server (which is your database)...
Restart Apache:
sudo service apache2 restart
Restart MySQL:
sudo service mysql restart
OR
sudo /etc/init.d/mysql restart
EDIT: It appears your Bitnami image has a different configuration...
Start All services: sudo /opt/bitnami/ctlscript.sh start
Restart Apache: sudo /opt/bitnami/ctlscript.sh restart apache
Restart MySQL: sudo /opt/bitnami/ctlscript.sh restart mysql
I have noticed that when ever I start nginx with ubuntu command "nginx" and I do systemctl status nginx. It shows that systemctl is disabled. More over if I first start nginx with command systemctl start nginx and i try to start nginx with command nginx, it check the availbility of the ports and then says nginx: [emerg] still could not bind(). So i thought there must be a differene and their purpose. When I strt nginx with command nginx the only way to stop nginx is by the means of force using killlall nginx or kill -9 (process id) or by clearing the port. So I am pretty sure there is some difference in them.
The difference between the examples you have provied is how the processes are being started.
Running the command nginx will start the application and wait for your user action to stop it.
The systemctl or service commands are nearly the same thing and running service nginx start or systemctl start nginx will start a service in the background running the Nginx daemon.
You can also use this to do a service nginx restart or systemctl restart nginx to restart the service, or even a service nginx reload / systemctl reload nginx to reload the configuration without completely stopping the Nginx server.
The reason why you can't do both nginx and systemctl start nginx is due to the nginx configuration already listening port 80, and you can't listen on the same port on a single IP address at the same time.
You can also force the nginx service to start on boot by running systemctl enable nginx which will be why your systemctl status nginx returns 'disabled'.
Hope this makes sense.
service command is just a simple script which basically abstract choosing the underlying init system (upstart, systemmd , /etc/init.d or systemctl).
since it being a very concise script, it only supports a very limited set of operations (start | stop | reload .. ).
However, if you actually want to perform the additional operation you need to make use of the actual init system in this case systemctl
An apt example would be starting the service on boot time using systemctl sudo systemctl enable the-name-of-service which is not possible using service
I have been working in a remote RStudio server for the last few months without any issues. Today, I restarted the rstudio server in using this command
sudo rstudio-server restart
After this, I am not able to access the server via browser. It keeps on waiting.
I checked the status using this:
sudo rstudio-server status
This resulted in:
rstudio-server stop/waiting
My server is configured to run on port 80
I have found the solution myself
The RStudio server was configured to run on port 80
Kill all the processess using port 80 and then start RStudio server
sudo fuser -k 80/tcp
sudo rstudio-server start
This solved the problem!