Monday, June 10, 2019

apache 2.2 - 127.0.0.1 is working but localhost is not working on mac XAMPP



I installed XAMPP on my mac months ago and was working great.



Now i get "Test Page For Apache Installation" when i try to browse /localhost



and /localhost/xampp is not found.




But when i browse /127.0.0.1 it just works as localhost used to be.



I double checked my /etc/hosts file that i have 127.0.0.1 localhost and not commented.



Also when i browse localhost/~username/test.php , i get contents of test.php:







but if i browse 127.0.0.1/~username/test.php , i get:



ganim


what could change redirecting of localhost or how can i get localhost work again?


Answer



Maybe the OS X built-in web server is active and managed to bind to localhost, while XAMPP managed to bind to 127.0.0.1? Try turning off Web Sharing in System Preferences and restart XAMPP.


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...