127.0.0.1 Error 404 but http://localhost works - mamp

I've got a problem this my MAMP Pro, I don't understand...
127.0.0.1 give me a 404 error but http://localhost works.
I found no problem with my hosts configuration...
Maybe a problem with Apache but I don't know.
I'm on MAC OS High Sierra, My MAMP Pro version 4.4.1.

In MAMP Pro try editing host Setting: localhost
Add to Additional parameters for <VirtualHost>
ServerAlias 127.0.0.1

When you are editing your host Localhost, in IP Address, choose your local ip (192.168.0.xxx).
And now, 127.0.0.1 is callable as your local ip 192.168.0.xxx

Related

The Python http server not working in local network

I´ve tried to start the python server with the following command python -m http.server and it says serving... so it should be working. I have this in a VM Linux maschine and the network adapter is set to bridged. When I access the localhost on port 8000 on the linux maschine the server is running on I can get access to the site and all the folders which the server serves but the problem is that I can´t access the site on any other VM nor the host maschine via the IP adress 192.168.2.206:8000 . The site is simply not loading. Can someone tell me whats wrong? I´ve also checked the firewall settings and allowed it for chrome. But this is not working as well.

How to disable IPv4 and enable only IPv6 on arm Linux target?

I am testing bind9 dns server for AAAA records. I would like to disable IPv4 to stop dns requests going to my default ipv4 dns server.
In the resolv.conf i have added
domain mydomain.com
nameserver xxxx:xxxx:xxxx:xxxx:xxxx::xxxx
search mydomain.com
When I try to call
getaddrinfo("mydomain.com",NULL,&hints,&res);
to resolve the
domain name to IPv6 address , I see error message
"No Route to Host".
The same program can resolve to IPv6 address when i run on the Ubuntu PC.
I have tried to test
nslookup mydomain.com
server: 10.1.xx.xx
address 1: 10.1.xx.xx dnsserver.com
nslookup: can't resolve 'mydomain.com'
The nslookup command works correctly on Linux PC.
Is there any thing additional I need to do in the /etc/network. or else where?
Edit:
The issue is resolved with changes in the bind9 reverse zone configuration file.

Connect to postgres db in docker on host from guest vagrant box

Not sure if this is possible, but I have a Vagrant box running ubuntu 18.04 running in VirtualBox on my macbook. I also have a docker container running on my mac which has a postgres database in it.
I would like to be able to connect from within ubuntu to the database in docker.
My first attempt at this was to add the following to my VagrantFile
config.vm.network "forwarded_port", guest: 5432, host: 5432
However that resulted in the following error:
Vagrant cannot forward the specified ports on this VM, since they
would collide with some other application that is already listening
on these ports. The forwarded port to 5432 is already in use
on the host machine.
To fix this, modify your current project's Vagrantfile to use another
port. Example, where '1234' would be replaced by a unique host port:
config.vm.network :forwarded_port, guest: 5432, host: 1234
Sometimes, Vagrant will attempt to auto-correct this for you. In this
case, Vagrant was unable to. This is usually because the guest machine
is in a state which doesn't allow modifying port forwarding. You could
try 'vagrant reload' (equivalent of running a halt followed by an up)
so vagrant can attempt to auto-correct this upon booting. Be warned
that any unsaved work might be lost.
I understand the error, it makes perfect sense because the host is already listening to port 5432 (or rather the docker/postgres container is). but i don't know how to fix the problem. If i do as suggested and change the host port number it would not work because then I wouldn't be connecting to the right port.
Suggestions?
I figured it out. it's pretty easy actually.
You see, the docker postgres db is availabe at 'localhost' or '127.0.0.1' on the HOST machine, but the HOST machine appears at 10.0.2.2 for some reason to the GUEST machine. All i had to do was point my database connect script to 10.0.2.2 and no extra network config was needed.

Connecting Xdebug with NetBeans and Vagrant

I have spent quite a bit of time on this with no success. I am trying to connect my Xdebug through NetBeans to my Vagrant server.
The IP address of the Vagrant box is 192.168.33.10.
When NetBeans opens the debugging connection it says that it's looking at 192.168.33.1.
My php.ini settings are as follows
zend_extension=/usr/lib/php/20151012/xdebug.so
xdebug.profiler_enable=1
xdebug.profiler_output_name="cachegrind.out.%t.%p"
xdebug.collect_params=4
xdebug.collect_return=1
xdebug.remote_enable=1
xdebug.remote_log = /tmp/xdebug.log
xdebug.remote_port = 9000
xdebug.remote_host=192.168.33.1
xdebug.remote_handler="dbgp"
xdebug.remote_autostart=0
xdebug.idekey="vagrant"
xdebug.remote_mode=req
;xdebug.remote_connect_back=1
In NetBeans my project URL is set to http://192.168.33.1:9000
debugger port is 9000 and Session ID is vagrant.
I know that NetBeans also looks at IP address 10.0.2.2 and I can't get this going either. When I run the debugger NetBeans just says that it's waiting for connection and my log stats that the connection has timed out.
I have also tried it with remote_connect_back=1 and to no avail.
Thank LazyOne for your feedback much appreciated
What I had to do to get this going was to open the ports 9000 on my windows machine and port 9000 on my server. I then login to my ssh server connecting to 127.0.0.1:2222 as specified by the vagrant bootup messages. Then set up a ssh tunnel to connect to port 9000. I did this using putty

Polymer: ERROR no ports available start_server.js

can anybody help me with my issue when i do polymer serve -H [77.68.84.107] it brings up an error saying no ports available? im really stuck on this.
i am running a 1&1 cloud server with centOS 7
I had this problem.
I changed --hostname value to the ip instead of the domain name or localhost
if you are doing it on your machine put 127.0.0.1 instead of localhost.