Mac localhost is not available after upgrade to OSX El Capitan 10.11.1 - macos

From httpd -v, I get the below:
Server version: Apache/2.4.16 (Unix)
Server built: Aug 22 2015 16:51:57
Also, etc/hosts is as follows:
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
I start the server using sudo apachectl start and it returns no error. However, I am not able to connect to localhost on a web browser. Would you suggest a solution? Thanks for your time.

Please see if https://donatstudios.com/PHP-in-OS-X-Yosemite helps you re-configure the httpd.conf

If you don't need IPv6 there is an easy fix for this.
I was all of a sudden unable to access localhost:631 (CUPS).
I Changed IPv6 to link-local.
Problem solved.

Related

Mac won't connect to localhost server run from VirtualBox

My mac won't connect to localhost, I've tried with Safari and Mozilla, so it's not the browser, I tried other solutions I found on the internet, I ping 127.0.0.1 and it works correctly, if I run dscacheutil -q host -a name localhost I get the following:
name: localhost
ipv6_address: ::1
name: localhost
ip_address: 127.0.0.1
If I run apachectl configtest I get Syntax OK.
I've also read that my /etc/hosts might have been corrupted, this is how it looks like:
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
# Added by Docker Desktop
# To allow the same kube context to work on the host and the container:
127.0.0.1 kubernetes.docker.internal
# End of section
I have no idea what else to try
EDIT: I'm trying to run an application (Hortonworks Sandbox) from a virtual machine (VirtualBox) in mac, I was advised to try port forwarding but this is what I see when I check the port forwarding in VirtualBox, seems like everything is in order:
I also tried to run Vagrant from VirtualBox and Mac couldn't connect to the localhost server when needed

This address: 127.0.0.1:5000 on Mac Catalina not working (docker) but working on Windows

This address: 127.0.0.1:5000 on Mac Catalina not working (docker) but working on Windows.
Question:
How do I get access to port:5000 working on my MAC?
# Host Database # # localhost is used to configure the loopback
interface # when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
# Added by Docker Desktop
# To allow the same kube context to work on the host and the
container: 127.0.0.1 kubernetes.docker.internal
# End of section
Update the line ## 127.0.0.1 localhost to 127.0.0.1 localhost in your /etc/hosts file.
Basically # is used for commenting in bash.
After that, you will be able to access using 127.0.0.1:5000 and http://localhost:5000

Why does oracle connection opens so slow on mac os sierra?

I work on Docker with an oracle-xe-11g image. When I connect via ssh to Docker container, the connection is established immediately. But when I want to connect to oracle database using localhost:49162 ( port is forwarded to container's 1521 ) it will take about 15 - 25 seconds to open each connection.
It doesn't matter if I use JDBC connection or SQLDeveloper.
I have read that problem could be connected with DNS resolution, but I wasn't able to find any sufficient solution.
Slow DNS lookups
My hosts file:
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
My resolv.conf:
search home
nameserver 62.179.1.60
nameserver 62.179.1.61
System version:
macOS Sierra 10.12.3.
Has someone faced similar issues?
In my case, When I followed the link you mentioned in the question, and in particular when I changed the first line of my /etc/hosts of my mac from:
127.0.0.1 localhost
to:
127.0.0.1 localhost Muhammads-MacBook-Pro.local
Where Muhammads-MacBook-Pro.local is the output of the command hostname
Then it worked fine.

OSX can't access localhost, only username.local

I've been facing this problem in mountain lion 10.8.3 and I cannot seem to find an answer. The problem is that I can access my "localhost" using username.local or http://127.0.0.1/ but not through localhost. I'm using apache 2.2 and virtualhostx, and for now is fine becuase I map every virtual host with a folder, but when developing in java, using Tomcat, I cannot access localhost, also there I have to access username.local..
my hosts file
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
If I cant find a solution I only can think of a fresh reinstall.. And this will be very annoying..
check your httpd.conf for this line
# Virtual hosts
Include /private/etc/apache2/extra/httpd-vhosts.conf
i had the same issue. Then i discovered that the httod-vhosts.conf file was commented out when i upgraded my OS.

Installing Glassfish 3 on Mac OS X 10.8.2 fails in Domain Info setup

I am a Glassfish newbie, though a Java and Unix veteran. I am running the shell script to install Java EE 6 SDK, including Glassfish 3 on my Mac.
bash-3.2# sh java_ee_sdk-6u4-unix.sh
Everything goes along fine until I get to the Domain Info screen. I am sticking with the default info (except for passwords):
Domain Name: domain1
Admin Port: 4848 <- I have verified with netstat that both ports are free
Http Port: 8080 <-
Username: admin
Password: xxxxxxxxxxxx
Service Name: domain1Service
+ Start domain after creation
When I click Next, I get 2 error dialogs that tell me the following:
Admin Port: Host name not found
Http Port: Host name not found
Does anyone know how to get past this?
I confirm, I correct the same problem by changing my hostname to localhost using the command line hostname localhost in linux.
Looks like something is wrong with your network config. Maybe your hosts file is missing the entry for localhost.
Check the file /private/etc/hosts for
127.0.0.1 localhost
You can also try to set your hostname with
sudo hostname localhost
The answer was relatively simple. I had to add the hostname configured with MacOS Settings as an alias for localhost into my /etc/hosts file. I'm not sure where MacOS keeps the host name. But the hostname command (i.e. gethostname) was returning 'airguitar', which is what Glassfish was trying to connect to. Since it wasn't in /etc/hosts, the hostname couldn't be found.
This is a problem that happens on many systems, It's happening on my linux as well. The solution is quite simple, as chuck almost got it.
Check your hosts file, on linux is under /etc/hosts. You'll probably have a file like this:
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
Check your hostname with the command hostname
[root#glassfish1 opt]# hostname
glassfish1
And add this host name to your hosts file like this:
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 glassfish1
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
this did the trick for me.

Resources